Thread: 177 Animations readvalues error

Results 1 to 4 of 4
  1. #1 177 Animations readvalues error 
    Registered Member
    Join Date
    Aug 2008
    Posts
    29
    Thanks given
    7
    Thanks received
    9
    Rep Power
    0
    Hi there, I've got the latest data files and packed them into the cache, tried to fix the readvalues of Animations atm since it's giving an error I can't seem to fix on my own. I'm new to readvalues and trying to learn, been stuck on this for 2 days now lol, hope someone can point me in the right direction.

    Source,Client & Cache used: Ascend 171

    Only things I've done to the cache and client is pack 177 data (dumped with openrs) and changed readvalues.

    Error in Eclipse:
    Code:
    java.lang.ArrayIndexOutOfBoundsException: 847059
    Error: loaderror Unpacking config 83
    	at com.client.Stream.readUnsignedByte(Stream.java:216)
    	at com.client.definitions.AnimationDefinition.readValues(AnimationDefinition.java:560)
    	at com.client.definitions.AnimationDefinition.unpackConfig(AnimationDefinition.java:17)
    	at com.client.Client.startUp(Client.java:10597)
    	at com.client.RSApplet.run(RSApplet.java:218)
    	at com.client.Client.run(Client.java:6129)
    	at java.lang.Thread.run(Unknown Source)
    Stream.java readUnsignedByte: (red line is line 216)
    Code:
        public int readUnsignedByte() {
         return buffer[currentOffset++] & 0xff;
        }
    AnimationDefinition.java Readvalues: (red line is line 560 from the error)
    Code:
        private void readValues(Stream stream) {
    		int i;
    		while ((i = stream.readUnsignedByte()) != 0){
    			
    		
    		if (i == 1) {
    			anInt352 = stream.readUnsignedWord();
    			anIntArray353 = new int[anInt352];
    			anIntArray354 = new int[anInt352];
    			anIntArray355 = new int[anInt352];
    			
    			for (int j = 0; j < anInt352; j++) {
    				anIntArray355[j] = stream.readUnsignedWord();
    				}
    			
    			for (int j = 0; j < anInt352; j++) {
    					anIntArray353[j] = stream.readUnsignedWord();
    					anIntArray354[j] = -1;
    				}
    			
    			for (int j = 0; j < anInt352; j++) {
    				anIntArray353[j] += stream.readUnsignedWord() << 16;
    			}			
    		} else if (i == 2) {
    			anInt356 = stream.readUnsignedWord();
    		} else if (i == 3) {		
    			int k = stream.readUnsignedByte();
    			anIntArray357 = new int[k + 1];
    			for (int l = 0; l < k; l++) {
    				anIntArray357[l] = stream.readUnsignedByte();
    			}
    			anIntArray357[k] = 9999999;
    		} 	   if (i == 4) {
    			aBoolean358 = true;
    		} else if (i == 5) {
    			anInt359 = stream.readUnsignedByte();
    		} else if (i == 6) {
    			anInt360 = stream.readUnsignedWord();
    		} else if (i == 7) {
    			anInt361 = stream.readUnsignedWord();
    		} else if (i == 8) {
    			anInt362 = stream.readUnsignedByte();
    		} else if (i == 9) {
    			anInt363 = stream.readUnsignedByte();
    		} else if (i == 10) {
    			anInt364 = stream.readUnsignedByte();
    		} else if (i == 11) {
    			anInt365 = stream.readUnsignedByte();
    		
    		}  else if (i == 12) {
    	          int count = stream.readUnsignedByte();
    	          this.anIntArray2118 = new int[count];
    
    	          for (int index = 0; index < count; ++index) {
    	          this.anIntArray2118[index] = stream.readUnsignedWord();
    	               }
    
    	          for (int index = 0; index < count; ++index) {
    	          this.anIntArray2118[index] += (stream.readUnsignedWord()) << 16;
    	           }
    
    	     } else if (i == 13) {
    	         int count = stream.readUnsignedByte();
    	         this.anIntArray2126 = new int[count];
    
    	         for (int index = 0; index < count; ++index) {
    	         this.anIntArray2126[index] = stream.read3Bytes();
    	        } 			
    		}	
        }
    AnimationDefinition.java Unpackconfig: (red line is line 17 from the error)
    Code:
    	public static void unpackConfig(StreamLoader streamLoader) {
    		Stream stream = new Stream(streamLoader.getDataForName("seq.dat"));
    		int length = stream.readUnsignedWord();
    		if (anims == null)
    			anims = new AnimationDefinition[length];
    		for (int j = 0; j < length; j++) {
    			if (anims[j] == null)
    				anims[j] = new AnimationDefinition();
    				anims[j].readValues(stream);
    			if (j == 719) {
    				anims[j].anInt361 = 28232;
    				anims[j].anInt359 = 6;
    				anims[j].anInt360 = 0;
    				anims[j].anInt365 = 1;
    				anims[j].anInt356 = -1;
    				anims[j].aBoolean358 = false;
    				anims[j].anInt359 = 5;
    				anims[j].anInt362 = 99;
    				anims[j].anInt363 = -1;
    				anims[j].anInt364 = -1;
    			}
    			switch (j) {
    Reply With Quote  
     

  2. #2  
    Renown Programmer
    Bartvh's Avatar
    Join Date
    May 2017
    Posts
    370
    Thanks given
    89
    Thanks received
    208
    Rep Power
    497
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Aug 2008
    Posts
    29
    Thanks given
    7
    Thanks received
    9
    Rep Power
    0
    Quote Originally Posted by Bartvh View Post
    Thanks. Will try them right now!
    Reply With Quote  
     

  5. #4  
    Donator

    Join Date
    Apr 2016
    Posts
    45
    Thanks given
    4
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by SDGDIRKSDG View Post
    Thanks. Will try them right now!
    Did these work?
    Attached image
    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. [PI]525 anim/graphics error
    By Lord Stark in forum Help
    Replies: 1
    Last Post: 11-09-2010, 02:20 PM
  2. 525 Animation loading error
    By ZeroPulse in forum Help
    Replies: 1
    Last Post: 08-19-2010, 08:33 PM
  3. Animations.Java [Error Refactored]
    By Xuzk in forum Help
    Replies: 5
    Last Post: 07-26-2010, 01:07 PM
  4. Requesting animations 65 error
    By Jattio in forum Requests
    Replies: 0
    Last Post: 05-28-2010, 04:28 AM
  5. Requesting animations 65 error
    By Purple in forum Help
    Replies: 0
    Last Post: 04-08-2010, 02:49 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
  •