Thread: How can I rename object's name in chat message?

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 How can I rename object's name in chat message? 
    Registered Member Versatile's Avatar
    Join Date
    Dec 2014
    Age
    26
    Posts
    433
    Thanks given
    247
    Thanks received
    9
    Rep Power
    9



    This is my code
    Code:
    String objectName = GameObjectDefinition.forId(stall).getName();
    					c.getPacketSender().sendMessage("You stole from the "+objectName+".");
    How can I chance the text "food stall" to "banana stall"? Because the food stall is the default and i renamed it to banana stall client sided.
    Spoiler for Don't be a deadfool:
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by StruggleIsREAL View Post



    This is my code
    Code:
    String objectName = GameObjectDefinition.forId(stall).getName();
    					c.getPacketSender().sendMessage("You stole from the "+objectName+".");
    How can I chance the text "food stall" to "banana stall"? Because the food stall is the default and i renamed it to banana stall client sided.
    If you got a list check your "GameObjectDefinition" how it grabs the id.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member Versatile's Avatar
    Join Date
    Dec 2014
    Age
    26
    Posts
    433
    Thanks given
    247
    Thanks received
    9
    Rep Power
    9
    Quote Originally Posted by arch337 View Post
    If you got a list check your "GameObjectDefinition" how it grabs the id.
    How can I edit this?
    I saw it is reading from this
    Spoiler for gameobjectdefinition:
    Code:
    public static void init() {
    		long startup = System.currentTimeMillis();
    		System.out.println("Loading cache game object definitions...");
    		
    		dataBuffer525 = new ByteStreamExt(getBuffer("loc.dat"));
    		ByteStreamExt idxBuffer525 = new ByteStreamExt(getBuffer("loc.idx"));
    		
    		dataBuffer667 = new ByteStreamExt(getBuffer("667loc.dat"));
    		ByteStreamExt idxBuffer667 = new ByteStreamExt(getBuffer("667loc.idx"));
    		
    		int totalObjects525 = idxBuffer525.readUnsignedWord();
    		totalObjects667 = idxBuffer667.readUnsignedWord();
    				
    		streamIndices525 = new int[totalObjects525];
    		int i = 2;
    		for (int j = 0; j < totalObjects525; j++) {
    			streamIndices525[j] = i;
    			i += idxBuffer525.readUnsignedWord();
    		}
    		
    		streamIndices667 = new int[totalObjects667];
    		
    		i = 2;
    		for (int j = 0; j < totalObjects667; j++) {
    			streamIndices667[j] = i;
    			i += idxBuffer667.readUnsignedWord();
    		}
    		
    		cache = new GameObjectDefinition[20];
    		for (int k = 0; k < 20; k++) {
    			cache[k] = new GameObjectDefinition();
    		}
    		
    		System.out.println("Loaded " + totalObjects525 + " cache object definitions #525 and " 
    				+ totalObjects667 + " cache object definitions #667 in " + (System.currentTimeMillis() - startup) + "ms");
    	}
    
    	public static byte[] getBuffer(String s) {
    		try {
    			java.io.File f = new java.io.File("./data/clipping/objects/" + s);
    			if (!f.exists())
    				return null;
    			byte[] buffer = new byte[(int) f.length()];
    			java.io.DataInputStream dis = new java.io.DataInputStream(new java.io.FileInputStream(f));
    			dis.readFully(buffer);
    			dis.close();
    			return buffer;
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		return null;
    	}


    And there is 2 files with "food stall"

    667loc.dat
    Code:
    Food Stall
    This table has ripe bananas on show.
    Steal from
    And loc.dat
    Code:
    —Food Stall
    It's a Food Stall
    ˙˙hidden
    Steal from
     hidden
    !hidden
    "hidden
    Spoiler for Don't be a deadfool:
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by StruggleIsREAL View Post
    How can I edit this?
    I saw it is reading from this
    Code:
    java.io.File f = new java.io.File("./data/clipping/objects/" + s);
    And there is 2 files with "food stall"

    667loc.dat
    Code:
    Food Stall
    This table has ripe bananas on show.
    Steal from
    And loc.dat
    Code:
    —Food Stall
    It's a Food Stall
    ˙˙hidden
    Steal from
     hidden
    !hidden
    "hidden
    try change "Food Stall" to "test name"


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Registered Member Versatile's Avatar
    Join Date
    Dec 2014
    Age
    26
    Posts
    433
    Thanks given
    247
    Thanks received
    9
    Rep Power
    9
    Quote Originally Posted by arch337 View Post
    try change "Food Stall" to "test name"
    Spoiler for Don't be a deadfool:
    Reply With Quote  
     

  6. #6  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by StruggleIsREAL View Post
    Alright then you cant do that.
    Try open this file "./data/clipping/objects/" and see if it has name in it. Could be it tries to get the name from the cache too. If that is the case you will need to edit it.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Oct 2016
    Posts
    65
    Thanks given
    42
    Thanks received
    17
    Rep Power
    0
    cant use frosty for this revision?
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    In objectDef.java
    Look for something like this:
    Code:
    if (i == 26392) {
    				objectDef.anIntArray773 = new int[2];
    				objectDef.anIntArray773[0] = 27816;
    				objectDef.anIntArray773[1] = 27836;
    				objectDef.hasActions = false;
    	}
    Add this:
    Code:
    if (i == 2403) { //Object ID
    				objectDef.name = "RFD Shop"; // Object name
    				
    	}
    That should do it.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Sep 2016
    Posts
    122
    Thanks given
    4
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by Luke132 Jr View Post
    In objectDef.java
    Look for something like this:
    Code:
    if (i == 26392) {
    				objectDef.anIntArray773 = new int[2];
    				objectDef.anIntArray773[0] = 27816;
    				objectDef.anIntArray773[1] = 27836;
    				objectDef.hasActions = false;
    	}
    Add this:
    Code:
    if (i == 2403) { //Object ID
    				objectDef.name = "RFD Shop"; // Object name
    				
    	}
    That should do it.
    y hardcode this?
    Reply With Quote  
     

  10. #10  
    Registered Member Versatile's Avatar
    Join Date
    Dec 2014
    Age
    26
    Posts
    433
    Thanks given
    247
    Thanks received
    9
    Rep Power
    9
    Quote Originally Posted by arch337 View Post
    Alright then you cant do that.
    Try open this file "./data/clipping/objects/" and see if it has name in it. Could be it tries to get the name from the cache too. If that is the case you will need to edit it.
    That's what I just checked and yea, i'm thinking it's from the cache. Though, I don't know how to edit this...

    Quote Originally Posted by Shean View Post
    cant use frosty for this revision?
    Do you know how to edit loc.dat in frosty? Could you help out? Thnkx, pm me please if you can.

    Quote Originally Posted by Luke132 Jr View Post
    In objectDef.java
    Look for something like this:
    Code:
    if (i == 26392) {
    				objectDef.anIntArray773 = new int[2];
    				objectDef.anIntArray773[0] = 27816;
    				objectDef.anIntArray773[1] = 27836;
    				objectDef.hasActions = false;
    	}
    Add this:
    Code:
    if (i == 2403) { //Object ID
    				objectDef.name = "RFD Shop"; // Object name
    				
    	}
    That should do it.
    You're talking about server sided right? If not, then it's only in my client sided for that .java The server sided version is the one me and arch337 is trying to solve.
    Spoiler for Don't be a deadfool:
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 07-23-2012, 09:50 PM
  2. How do I delete objects in Devo?
    By jordan641 in forum Help
    Replies: 5
    Last Post: 04-18-2010, 05:14 AM
  3. Replies: 7
    Last Post: 06-22-2009, 06:13 AM
  4. how to add new objects in server?
    By hackerboy in forum Help
    Replies: 5
    Last Post: 05-26-2009, 05:28 PM
  5. How can i change ip in bluurs client
    By david4444 in forum Help
    Replies: 1
    Last Post: 05-01-2009, 05:58 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •