Thread: Index Repacking

Page 24 of 25 FirstFirst ... 1422232425 LastLast
Results 231 to 240 of 250
  1. #231  
    Retired. Stop PMing me.


    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    17
    Posts
    7,526
    Thanks given
    1,805
    Thanks received
    2,830
    Rep Power
    5000
    Quote Originally Posted by baluga View Post
    Hi, I have followed this tutorial and was in need of a little bit of help. Here is my problem:

    I am trying to fix random hilly locations in my 317 maps, like this one:
    I am 95% sure this is not how it is in the actual game (this area is near Callisto in OSRS). I toyed with the idea of fixing it with a map editor, but decided since i didn't need anything custom, just a fix i should just get the latest OSRS maps and repack them.
    So I found #104 XTEAs and downloaded the maps from there.
    The maps came in a zip and looked like this:

    I followed the instructions and gzipped all of these.
    I used a GZIP Utility also by Galkon. (If this all works thank you so much buddy)

    So after following the instructions, troubleshooting and reading around, here is where I am at now:

    The maps are gzipped in the directory: My Documents > Cache > index4

    Each gzip looks like this:

    I copy pasted all of the methods and put repackCacheIndex(4) after loadTitleScreen() as suggested in previous comments. I have also tried calling the maps() method after and that did not seem to work either:

    My console outputs all the right results with no errors:


    Despite this I am seeing no change in my maps in game. I tried to provide as much detail as possible so someone can tell me where I may have messed up. Any assistance would be greatly appreciated. I am going to try another set of map files in case it is that. Thanks in advance.
    Looks like you are packing XTEAs which are keys used to decode map files themselves? This is for packing map files, usually saved to a ".dat" file not ".txt".
    Attached image
    Reply With Quote  
     

  2. #232  
    Registered Member
    Join Date
    Jul 2014
    Posts
    73
    Thanks given
    22
    Thanks received
    12
    Rep Power
    16
    Quote Originally Posted by Galkon View Post
    For those of you who want to pack models, animations, and maps into the cache but don't know how, here are some methods I've written to make the client do it for you with one simple calling of a method.

    Add these methods in client.java:
    Spoiler for Methods:
    Code:
    	public String indexLocation(int cacheIndex, int index) {
    		return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
    	}
    
    	public void repackCacheIndex(int cacheIndex) {
    		System.out.println("Started repacking index " + cacheIndex + ".");
    		int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
    		File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
    		try {
    			for (int index = 0; index < indexLength; index++) {
    				int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
    				byte[] data = fileToByteArray(cacheIndex, fileIndex);
    				if(data != null && data.length > 0) {
    					decompressors[cacheIndex].method234(data.length, data, fileIndex);
    					System.out.println("Repacked " + fileIndex + ".");
    				} else {
    					System.out.println("Unable to locate index " + fileIndex + ".");
    				}
    			}
    		} catch(Exception e) {
    			System.out.println("Error packing cache index " + cacheIndex + ".");
    		}
    		System.out.println("Finished repacking " + cacheIndex + ".");
    	}
    
    	public byte[] fileToByteArray(int cacheIndex, int index) {
    		try {
    			if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
    				return null;
    			}
    			File file = new File(indexLocation(cacheIndex, index));
    			byte[] fileData = new byte[(int)file.length()];
    			FileInputStream fis = new FileInputStream(file);
    			fis.read(fileData);
    			fis.close();
    			return fileData;
    		} catch(Exception e) {
    			return null;
    		}
    	}

    And if you need getFileNameWithoutExtension, here it is:
    Code:
    	public static String getFileNameWithoutExtension(String fileName) {
    		File tmpFile = new File(fileName);
    		tmpFile.getName();
    		int whereDot = tmpFile.getName().lastIndexOf('.');
    		if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
    			return tmpFile.getName().substring(0, whereDot);
    		}
    		return "";
    	}
    If you want to add models past 40k or so:
    Spoiler for Unlimiting cache size:

    Decompressor.java, replace this method:
    Code:
    	private synchronized void seekTo(RandomAccessFile randomaccessfile, int j) throws IOException {
    		try {
    			/*if (j < 0 || j > 0x3c00000) {
    				System.out.println("Badseek - pos:" + j + " len:" + randomaccessfile.length());
    				j = 0x3c00000;
    				try {
    					Thread.sleep(1000L);
    				} catch (Exception _ex) {
    				}
    			}*/
    			randomaccessfile.seek(j);
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    	}
    signlink.java, replace the top part of run() with this:
    Code:
        public void run() {
            active = true;
            String s = findcachedir();
            uid = getuid(s);
            try {
                cache_dat = new RandomAccessFile(s + "main_file_cache.dat", "rw");
                for(int j = 0; j < 5; j++) {
                    cache_idx[j] = new RandomAccessFile(s + "main_file_cache.idx" + j, "rw");
    			}
            } catch(Exception exception) {
                exception.printStackTrace();
            }


    Now if you want to repack an index:
    • Place the folder containing all the gzipped files in the cache folder.
    • Make sure the folder is called index#, so for example models would be located at "/cache/index1/#.gz".
    • In the startup method, simply call 'repackCacheIndex(#)'.

    models = index1
    animations = index2
    sounds = index3
    maps = index4

    What this will do is it will find the index directory with the gzipped files, and pack only the files in the directory, so you can also use this to repack a few models at a time.
    Thanks alot man i have ran into some trouble however if you dont mind looking at my thread i would really appreciate it
    https://www.rune-server.org/runescap...-new-data.html
    Reply With Quote  
     

  3. #233  
    Registered Member
    Join Date
    Nov 2015
    Posts
    83
    Thanks given
    9
    Thanks received
    21
    Rep Power
    30
    If anyone in this thread has expertise in this subject, here is my issue: https://www.rune-server.org/runescap...t-working.html
    Reply With Quote  
     

  4. #234  
    Donator
    Nhz RSPS's Avatar
    Join Date
    Nov 2014
    Posts
    103
    Thanks given
    20
    Thanks received
    22
    Rep Power
    12
    Thanks for this thread #1 release love it.
    Attached image
    Reply With Quote  
     

  5. #235  
    Registered Member

    Join Date
    Nov 2014
    Posts
    337
    Thanks given
    47
    Thanks received
    12
    Rep Power
    187
    What about objects? whats the index packing number for that?
    Reply With Quote  
     

  6. #236  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    Quote Originally Posted by scoping king View Post
    What about objects? whats the index packing number for that?
    Index 4 incase you haven't figured
    Reply With Quote  
     

  7. #237  
    Member
    Join Date
    Nov 2016
    Posts
    86
    Thanks given
    44
    Thanks received
    14
    Rep Power
    0
    How do i repack item models and GFX's?? the only one that worked was the animations.
    Reply With Quote  
     

  8. #238  
    Registered Member
    Join Date
    Oct 2011
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    I have added Animation for dragon claws, but in game it doesn't replace already existing bad animation. How can I fix it ? It said that it repacked the needed id but when I do ::anim [id] the animation is still messed.
    Reply With Quote  
     

  9. #239  
    Registered Member
    Join Date
    Dec 2016
    Posts
    5
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I gzipped my models added everything u told me to put and when i put in a model it still doesn't work
    Idk if u need 2 know this but im in a vencillio client

    if u can help me i would appreciate it.
    Reply With Quote  
     

  10. #240  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    Quote Originally Posted by poopjr View Post
    I gzipped my models added everything u told me to put and when i put in a model it still doesn't work
    Idk if u need 2 know this but im in a vencillio client

    if u can help me i would appreciate it.
    1) Create map "index1" in your cache directory
    2) Put the gzipped model there (.gz file)
    3) Call repackCacheIndex(1); while running your client (just place it in the startup method or call it with a command)
    > Should repack the model
    > Now restart your client
    Reply With Quote  
     

Page 24 of 25 FirstFirst ... 1422232425 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. 634 map index for 317
    By mige5 in forum Downloads
    Replies: 223
    Last Post: 09-27-2016, 05:08 AM
  2. index?t=something
    By minutes in forum Application Development
    Replies: 0
    Last Post: 02-20-2011, 12:38 PM
  3. model_index archive repacking
    By Xaves in forum Help
    Replies: 9
    Last Post: 01-07-2011, 11:36 PM
  4. Repacking Data
    By Stewie in forum Help
    Replies: 1
    Last Post: 05-02-2010, 07:45 AM
  5. Index Help
    By Streetwave in forum Application Development
    Replies: 6
    Last Post: 10-21-2009, 12:38 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •