Thread: Adding 508 maps (Or any revision)

Results 1 to 6 of 6
  1. #1 Adding 508 maps (Or any revision) 
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    I know what you are thinking. "Oh god, another tutorial on adding maps" I know there is several snippets on adding high revision maps but yet people still cannot add them. Even though they are not spoon fed snippets, it's pretty easy to add maps though. So this tutorial will guide you through every step.

    Step 1: Things needed
    Index repacking snippet by Galkon:
    http://www.rune-server.org/runescape...repacking.html

    Cache suite:
    Toms Suite

    Gzipper(Only download if the maps models/and or object models are gzipped already)
    Download All.InOne.Zipper.jar @ UppIT

    Maps/objects/index and data files
    http://www.rune-server.org/runescape...-releases.html

    Step 2: Editing the correct client files
    PLEASE BACKUP YOU CACHE AND CLIENT FILES BEFORE DOING ANYTHING AFTER STEP 1!

    ObjectDef/ObjectDefinition/ObjectType

    Replace this:

    Readvalues:
    Code:
    private void readValues(Buffer buffer) {
    		int i = -1;
    		label0: do {
    			int opcode;
    			do {
    				opcode = buffer.readUnsignedByte();
    				if (opcode == 0)
    					break label0;
    				if (opcode == 1) {
    					int k = buffer.readUnsignedByte();
    					if (k > 0)
    						if (anIntArray773 == null || lowMem) {
    							anIntArray776 = new int[k];
    							anIntArray773 = new int[k];
    							for (int k1 = 0; k1 < k; k1++) {
    								anIntArray773[k1] = buffer.readUnsignedWord();
    								anIntArray776[k1] = buffer.readUnsignedByte();
    							}
    						} else {
    							buffer.currentOffset += k * 3;
    						}
    				} else if (opcode == 2)
    					name = buffer.readString();
    				else if (opcode == 3)
    					description = buffer.readBytes();
    				else if (opcode == 5) {
    					int l = buffer.readUnsignedByte();
    					if (l > 0)
    						if (anIntArray773 == null || lowMem) {
    							anIntArray776 = null;
    							anIntArray773 = new int[l];
    							for (int l1 = 0; l1 < l; l1++)
    								anIntArray773[l1] = buffer.readUnsignedWord();
    						} else {
    							;//buffer.currentOffset += l * 2;
    						}
    				} else if (opcode == 14)
    					anInt744 = buffer.readUnsignedByte();
    				else if (opcode == 15)
    					anInt761 = buffer.readUnsignedByte();
    				else if (opcode == 17)
    					aBoolean767 = false;
    				else if (opcode == 18)
    					aBoolean757 = false;
    				else if (opcode == 19) {
    					i = buffer.readUnsignedByte();
    					if (i == 1)
    						hasActions = true;
    				} else if (opcode == 21)
    					aBoolean762 = true;
    				else if (opcode == 22)
    					aBoolean769 = false;//
    				else if (opcode == 23)
    					aBoolean764 = true;
    				else if (opcode == 24) {
    					anInt781 = buffer.readUnsignedWord();
    					if (anInt781 == 65535)
    						anInt781 = -1;
    				} else if (opcode == 28)
    					anInt775 = buffer.readUnsignedByte();
    				else if (opcode == 29)
    					aByte737 = buffer.readSignedByte();
    				else if (opcode == 39)
    					aByte742 = buffer.readSignedByte();
    				else if (opcode >= 30 && opcode < 39) {
    					if (actions == null)
    						actions = new String[10];
    					actions[opcode - 30] = buffer.readString();
    					if (actions[opcode - 30].equalsIgnoreCase("hidden"))
    						actions[opcode - 30] = null;
    				} else if (opcode == 40) {
    					int i1 = buffer.readUnsignedByte();
    					modifiedModelColors = new int[i1];
    					originalModelColors = new int[i1];
    					for (int i2 = 0; i2 < i1; i2++) {
    						modifiedModelColors[i2] = buffer.readUnsignedWord();
    						originalModelColors[i2] = buffer.readUnsignedWord();
    					}
    				} else if (opcode == 60)
    					anInt746 = buffer.readUnsignedWord();
    				else if (opcode == 62)
    					aBoolean751 = true;
    				else if (opcode == 64)
    					aBoolean779 = false;
    				else if (opcode == 65)
    					anInt748 = buffer.readUnsignedWord();
    				else if (opcode == 66)
    					anInt772 = buffer.readUnsignedWord();
    				else if (opcode == 67)
    					anInt740 = buffer.readUnsignedWord();
    				else if (opcode == 68)
    					anInt758 = buffer.readUnsignedWord();
    				else if (opcode == 69)
    					anInt768 = buffer.readUnsignedByte();
    				else if (opcode == 70)
    					anInt738 = buffer.readSignedWord();
    				else if (opcode == 71)
    					anInt745 = buffer.readSignedWord();
    				else if (opcode == 72)
    					anInt783 = buffer.readSignedWord();
    				else if (opcode == 73)
    					aBoolean736 = true;
    				else if (opcode == 74) {
    					aBoolean766 = true;
    				} else {
    					if (opcode != 75)
    						continue;
    					anInt760 = buffer.readUnsignedByte();
    				}
    				continue label0;
    			} while (opcode != 77);
    				anInt774 = buffer.readUnsignedWord();
    			if (anInt774 == 65535)
    				anInt774 = -1;
    				anInt749 = buffer.readUnsignedWord();
    			if (anInt749 == 65535)
    				anInt749 = -1;
    			int j1 = buffer.readUnsignedByte();
    			childrenIDs = new int[j1 + 1];
    			for (int j2 = 0; j2 <= j1; j2++) {
    				childrenIDs[j2] = buffer.readUnsignedWord();
    				if (childrenIDs[j2] == 65535)
    					childrenIDs[j2] = -1;
    			}
    
    		} while (true);
    		if (i == -1) {
    			hasActions = anIntArray773 != null && (anIntArray776 == null || anIntArray776[0] == 10);
    			if (actions != null)
    				hasActions = true;
    		}
    		if (aBoolean766) {
    			aBoolean767 = false;
    			aBoolean757 = false;
    		}
    		if (anInt760 == -1)
    			anInt760 = aBoolean767 ? 1 : 0;
        }
    forID/get
    Code:
    public static ObjectDefinition forID(int i) {
    		if (i > streamIndices.length)
    			i = streamIndices.length - 1;
    		for(int j = 0; j < 20; j++)
    			if(cache[j].type == i) {
    				return cache[j];
    			}
    			cacheIndex = (cacheIndex + 1) % 20;
    			ObjectDefinition objectDef = cache[cacheIndex];
    			try {
    				buffer.currentOffset = streamIndices[i];
    			} catch(Exception e) {
    				e.printStackTrace();
    			}
    			objectDef.type = i;
    			objectDef.setDefaults();
    			objectDef.readValues(buffer);
    		return objectDef;
    	}
    OnDemandFetcher (You might have to rename few things,
    mapIndex - mapIndices
    CacheArchive - StreamLoader
    Buffer - Stream
    ectect
    Code:
    public void start(CacheArchive archive, Client client) {
            byte[] data = archive.getFile("map_index");
            Buffer stream2 = new Buffer(data);
            int length = data.length / 7;
            mapIndex1 = new int[length];
            mapIndex2 = new int[length];
            mapIndex3 = new int[length];
            for (int i2 = 0; i2 < length; i2++) {
                mapIndex1[i2] = stream2.getUShort();
                mapIndex2[i2] = stream2.getUShort();
                mapIndex3[i2] = stream2.getUShort();
            }
            System.out.println("Maps Loaded: " + length);
    		data = archive.getFile("anim_index");
    		stream2 = new Buffer(data);
    		length = data.length / 2;
    		animIndex = new int[length];
    		for (int i = 0; i < length; i++) {
    			animIndex[i] = stream2.getUShort();
    		}
    		data = archive.getFile("midi_index");
    		stream2 = new Buffer(data);
    		length = data.length;
    		midiIndex = new int[length];
    		for (int i = 0; i < length; i++) {
    			midiIndex[i] = stream2.getUByte();
    		}
    		this.client = client;
    		running = true;
    		client.startThread(this, 2);
    	}
    Step 3: Packing the models/data/index files
    Make 2 new folders in your cache named index1 and index4
    extract the object models into index1, and the map models into index4
    then in client.java, startUp method add

    repackCacheIndex(1);
    repackCacheIndex(4);

    After you have done that, open up toms cache suite, load your cache,
    then once it has loaded, click the tab "View/Edit JaGex Archives"
    then choose the option config.jag
    and replace loc.dat and loc.idx with the ones you downloaded, then click the button repack archive.
    Once it has repacked, close down that itnerface and click Jagex archives again, but this time go to the tab, versionlist.jag
    and replace map_index.dat with the one you downloaded.

    Step 4: Finishing off.
    After you have completed step 2 & 3 without getting any errors, run your client and wait for the objects and maps to pack into your cache, you will see in the cmd it spamming
    "Repacking: #"

    Credits:
    Galkon
    Poesy700

    Hopefully this is enough to help a newbie add high revision maps to their client!
    If you have any questions at all, feel free to PM me or leave a comment below.
    Reply With Quote  
     

  2. #2  
    Registered Member AFGscape's Avatar
    Join Date
    May 2009
    Posts
    3,549
    Thanks given
    458
    Thanks received
    636
    Rep Power
    39
    This has been released alot of time, you've also forgotten to add the new under\overlay floor.
    • Old username:
    • Lost Valentino

    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2007
    Posts
    65
    Thanks given
    4
    Thanks received
    4
    Rep Power
    1
    so this should work with 474 data? i have the flo and loc files as well as the object models and map files


    EDIT:
    what am i doing wrong!

    Code:
    Exception in thread "Thread-5" java.lang.ArrayIndexOutOfBoundsException: 56320
            at Animable_Sub5.<init>(Animable_Sub5.java:77)
            at ObjectManager.method188(ObjectManager.java:1111)
            at Client.method142(Client.java:11180)
            at Client.method115(Client.java:9570)
            at Client.mainGameProcessor(Client.java:3711)
            at Client.processGameLoop(Client.java:2235)
            at RSApplet.run(RSApplet.java:102)
            at Client.run(Client.java:5283)
            at java.lang.Thread.run(Unknown Source)
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Oct 2009
    Posts
    734
    Thanks given
    168
    Thanks received
    54
    Rep Power
    0
    Quote Originally Posted by Corzzscape View Post
    so this should work with 474 data? i have the flo and loc files as well as the object models and map files


    EDIT:
    what am i doing wrong!

    Code:
    Exception in thread "Thread-5" java.lang.ArrayIndexOutOfBoundsException: 56320
            at Animable_Sub5.<init>(Animable_Sub5.java:77)
            at ObjectManager.method188(ObjectManager.java:1111)
            at Client.method142(Client.java:11180)
            at Client.method115(Client.java:9570)
            at Client.mainGameProcessor(Client.java:3711)
            at Client.processGameLoop(Client.java:2235)
            at RSApplet.run(RSApplet.java:102)
            at Client.run(Client.java:5283)
            at java.lang.Thread.run(Unknown Source)
    Yeah I'm getting the same thing and a black screen.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2013
    Posts
    118
    Thanks given
    17
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Chris SS View Post
    Yeah I'm getting the same thing and a black screen.
    you need to update animable sub5.java
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Apr 2014
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    9
    can some1 please post new links to the 508 maps please, pressh
    Reply With Quote  
     


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. [PayPal]adding 508 maps
    By Snake in forum Requests
    Replies: 1
    Last Post: 07-20-2011, 01:48 AM
  2. [$20]Adding 508 Maps
    By Snake in forum Help
    Replies: 17
    Last Post: 07-14-2011, 02:10 AM
  3. [PI] Adding 508 Maps
    By H O R R O R in forum Help
    Replies: 2
    Last Post: 02-01-2011, 12:14 AM
  4. Replies: 6
    Last Post: 01-13-2011, 01:18 AM
  5. [GALKONS]Adding 508 maps 100% objects 80%
    By AFGscape in forum Tutorials
    Replies: 27
    Last Post: 09-03-2010, 09:45 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
  •