Thread: Weird cape animation, shaking

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Weird cape animation, shaking 
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    Attached image
    Any ideas what can be? Why start shaking?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Brainpower's Avatar
    Join Date
    Jan 2019
    Posts
    130
    Thanks given
    13
    Thanks received
    13
    Rep Power
    101
    Could be that the animation is not compatible with higher revision cape, since I feel like the cape
    comes from a different revision than your other models & animations.
    You could try the released cheaphax for readShort2 and see if that makes a difference.
    I believe it's this but I can't find the topic.
    (Use in FrameReader)

    Code:
       public int readShort2() {
           currentOffset += 2;
           int i = ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
           if(i > 32767)
               i -= 65537;
           return i;
       }
    Reply With Quote  
     

  3. #3  
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    Quote Originally Posted by Brainpower View Post
    Could be that the animation is not compatible with higher revision cape, since I feel like the cape
    comes from a different revision than your other models & animations.
    You could try the released cheaphax for readShort2 and see if that makes a difference.
    I believe it's this but I can't find the topic.
    (Use in FrameReader)

    Code:
       public int readShort2() {
           currentOffset += 2;
           int i = ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
           if(i > 32767)
               i -= 65537;
           return i;
       }
    readshort method is same like you, and new model capes also shaking.
    Attached image
    Reply With Quote  
     

  4. #4  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Can you post your frame decoder and your buffer/stream class?
    Reply With Quote  
     

  5. #5  
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    Quote Originally Posted by StanDev View Post
    Can you post your frame decoder and your buffer/stream class?
    Code:
    public final class Class36 {
    	
       	public static void load(int file, byte[] fileData, int index){
        		try {
    	    		Stream stream = new Stream(fileData);
                		Class18 class18 = new Class18(stream);
            		int k1 = stream.readUnsignedWord();
    			animationlist[index][file] = new Class36[(int) (k1 * 3.0)];
    	    		int ai[] = new int[500];
            		int ai1[] = new int[500];
            		int ai2[] = new int[500];
            		int ai3[] = new int[500];
            	for(int l1 = 0; l1 < k1; l1++) {
                		int i2 = stream.readUnsignedWord();
                		Class36 class36 = animationlist[index][file][i2] = new Class36();
                		class36.aClass18_637 = class18;
                		int j2 = stream.readUnsignedByte();
                		int l2 = 0;
    			int k2 = -1;
                for(int i3 = 0; i3 < j2; i3++) {
                    	int j3 = stream.readUnsignedByte();
                    if(j3 > 0) {
                        if(class18.anIntArray342[i3] != 0) {
                            for(int l3 = i3 - 1; l3 > k2; l3--) {
                                if(class18.anIntArray342[l3] != 0)
                                    continue;
                                		ai[l2] = l3;
                                		ai1[l2] = 0;
                                		ai2[l2] = 0;
                                		ai3[l2] = 0;
                                		l2++;
                                	break;
                            	}
                        	}
                        		ai[l2] = i3;
                        		short c = 0;
                        	if(class18.anIntArray342[i3] == 3)
                            	c = (short)128;
                        	if((j3 & 1) != 0)
                            	ai1[l2] = (short)stream.readShort2();
                       	else
                            	ai1[l2] = c;
                        	if((j3 & 2) != 0)
                            	ai2[l2] = stream.readShort2();
                        	else
                            	ai2[l2] = c;
                        	if((j3 & 4) != 0)
                            	ai3[l2] = stream.readShort2();
                        	else
                            	ai3[l2] = c;
                        		k2 = i3;
                        		l2++;
                			}
    			}
                			class36.anInt638 = l2;
                			class36.anIntArray639 = new int[l2];
                			class36.anIntArray640 = new int[l2];
                			class36.anIntArray641 = new int[l2];
                			class36.anIntArray642 = new int[l2];
                		for(int k3 = 0; k3 < l2; k3++) {
                    		class36.anIntArray639[k3] = ai[k3];
                   		 	class36.anIntArray640[k3] = ai1[k3];
                    		class36.anIntArray641[k3] = ai2[k3];
                    		class36.anIntArray642[k3] = ai3[k3];
                			}
            		}
          		}catch(Exception exception) { }
        	}
    
    	public static void nullLoader() {
    		animationlist = null;
    	}
    
    	public static Class36 getOSRSHeader(int int1) {
    		try {
    			int int2 = int1 >> 16;
    			int1 = int1 & 0xffff;
    			if (animationlist[1][int2].length == 0) {
    				Client.instance.onDemandFetcher.method558(5, int2);
    				return null;
    			}
    			return animationlist[1][int2][int1];
    		} catch (Exception ex) {
    			ex.printStackTrace();
    			return null;
    		}
    	}
    
    	public static Class36 getHeader(int int1) {
    		try {
    			int int2 = int1 >> 16;
    			int1 = int1 & 0xffff;
    			if (animationlist[0][int2].length == 0) {
    				Client.instance.onDemandFetcher.method558(1, int2);
    				return null;
    			}
    			return animationlist[0][int2][int1];
    		} catch (Exception ex) {
    			ex.printStackTrace();
    			return null;
    		}
    	}
        
        
    	public static boolean method532(int i) {
    		return i == -1;
    	}
    
    	private Class36() {
    	}
        public static Class36 animationlist[][][] = new Class36[2][15_000][0];
    	public int anInt636;
    	public Class18 aClass18_637;
    	public int anInt638;
    	public static byte[][] frameData = null;
    	public static byte[][] skinData = null;
    	public int anIntArray639[];
    	public int anIntArray640[];
    	public int anIntArray641[];
    	public int anIntArray642[];
    	public static boolean[] aBooleanArray643;
    
    }
    Code:
    import java.math.BigInteger;
    
    public final class Stream extends NodeSub {
    
    	public static Stream create() {
    		synchronized (nodeList) {
    			Stream stream = null;
    			if (anInt1412 > 0) {
    				anInt1412--;
    				stream = (Stream) nodeList.popHead();
    			}
    			if (stream != null) {
    				stream.currentOffset = 0;
    				return stream;
    			}
    		}
    		Stream stream_1 = new Stream();
    		stream_1.currentOffset = 0;
    		stream_1.buffer = new byte[5000];
    		return stream_1;
    	}
    	
    	public int readTriByte() {
    		currentOffset += 3;
    		return ((buffer[currentOffset - 3] & 0xff) << 16)
    				+ ((buffer[currentOffset - 2] & 0xff) << 8)
    		
    				+ (buffer[currentOffset - 1] & 0xff);
    	}
    	
    	public int readShort2() {
    		currentOffset += 2;
    		int i = ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
            if(i > 32767)
                i -= 65537;
    		return i;
    
    	}
    
    	final int v(int i) {
    		currentOffset += 3;
    		return (0xff & buffer[currentOffset - 3] << 16) + (0xff & buffer[currentOffset - 2] << 8) + (0xff & buffer[currentOffset - 1]);
    	}
    
    	private Stream() {
    	}
    
    	public Stream(byte abyte0[]) {
    		buffer = abyte0;
    		currentOffset = 0;
    	}
    	
    	public int readUSmart2() {
    		int baseVal = 0;
    		int lastVal = 0;
    		while ((lastVal = method422()) == 32767) {
    			baseVal += 32767;
    		}
    		return baseVal + lastVal;
    	}
    	
    	public String readNewString() {
    		int i = currentOffset;
    		while (buffer[currentOffset++] != 0)
    			;
    		return new String(buffer, i, currentOffset - i - 1);
    	}
    
    	public void createFrame(int i) {
    		// System.out.println("Frame: " + i);
    		buffer[currentOffset++] = (byte) (i + encryption.getNextKey());
    	}
    
    	public void writeWordBigEndian(int i) {
    		buffer[currentOffset++] = (byte) i;
    	}
    
    	public void writeWord(int i) {
    		buffer[currentOffset++] = (byte) (i >> 8);
    		buffer[currentOffset++] = (byte) i;
    	}
    
    	public void method400(int i) {
    		buffer[currentOffset++] = (byte) i;
    		buffer[currentOffset++] = (byte) (i >> 8);
    	}
    
    	public void writeDWordBigEndian(int i) {
    		buffer[currentOffset++] = (byte) (i >> 16);
    		buffer[currentOffset++] = (byte) (i >> 8);
    		buffer[currentOffset++] = (byte) i;
    	}
    
    	public void writeDWord(int i) {
    		buffer[currentOffset++] = (byte) (i >> 24);
    		buffer[currentOffset++] = (byte) (i >> 16);
    		buffer[currentOffset++] = (byte) (i >> 8);
    		buffer[currentOffset++] = (byte) i;
    	}
    
    	public void method403(int j) {
    		buffer[currentOffset++] = (byte) j;
    		buffer[currentOffset++] = (byte) (j >> 8);
    		buffer[currentOffset++] = (byte) (j >> 16);
    		buffer[currentOffset++] = (byte) (j >> 24);
    	}
    
    	public void writeQWord(long l) {
    		try {
    			buffer[currentOffset++] = (byte) (int) (l >> 56);
    			buffer[currentOffset++] = (byte) (int) (l >> 48);
    			buffer[currentOffset++] = (byte) (int) (l >> 40);
    			buffer[currentOffset++] = (byte) (int) (l >> 32);
    			buffer[currentOffset++] = (byte) (int) (l >> 24);
    			buffer[currentOffset++] = (byte) (int) (l >> 16);
    			buffer[currentOffset++] = (byte) (int) (l >> 8);
    			buffer[currentOffset++] = (byte) (int) l;
    		} catch (RuntimeException runtimeexception) {
    			Signlink.reporterror("14395, " + 5 + ", " + l + ", " + runtimeexception.toString());
    			throw new RuntimeException();
    		}
    	}
    
    	public void writeString(String s) {
    		// s.getBytes(0, s.length(), buffer, currentOffset); //deprecated
    		System.arraycopy(s.getBytes(), 0, buffer, currentOffset, s.length());
    		currentOffset += s.length();
    		buffer[currentOffset++] = 10;
    	}
    
    	public void writeBytes(byte abyte0[], int i, int j) {
    		for (int k = j; k < j + i; k++)
    			buffer[currentOffset++] = abyte0[k];
    	}
    
    	public void writeBytes(int i) {
    		buffer[currentOffset - i - 1] = (byte) i;
    	}
    
    	public int readUnsignedByte() {
    		return buffer[currentOffset++] & 0xff;
    	}
    	
    	public int readInt() {
    		currentOffset += 4;
    		return ((buffer[currentOffset - 4] & 0xff) << 24) + ((buffer[currentOffset - 3] & 0xff) << 16) + ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
    	}
    	
    	public int readRuseShortA() {
    		currentOffset += 2;
    		return ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] - 128 & 0xff);
    	}
    	
    	public byte readSignedByte() {
    		return buffer[currentOffset++];
    	}
    
    	public int readUnsignedWord() {
    		currentOffset += 2;
    		return ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
    	}
    
    	public int readSignedWord() {
    		currentOffset += 2;
    		int i = ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
    		if (i > 32767)
    			i -= 0x10000;
    		return i;
    	}
    
    	public int read3Bytes() {
    		currentOffset += 3;
    		return ((buffer[currentOffset - 3] & 0xff) << 16) + ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
    	}
    
    	public int readDWord() {
    		currentOffset += 4;
    		return ((buffer[currentOffset - 4] & 0xff) << 24) + ((buffer[currentOffset - 3] & 0xff) << 16) + ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
    	}
    
    	public long readQWord() {
    		long l = (long) readDWord() & 0xffffffffL;
    		long l1 = (long) readDWord() & 0xffffffffL;
    		return (l << 32) + l1;
    	}
    
    	public String readString() {
    		int i = currentOffset;
    		while (buffer[currentOffset++] != 10)
    			;
    		return new String(buffer, i, currentOffset - i - 1);
    	}
    	
    	public int readByteS() {
    		return 128 - buffer[currentOffset++] & 0xff;
    	}
    	public int nglb() {
    		return -buffer[currentOffset++] & 0xff;
    	}
    	public byte[] readBytes() {
    		int i = currentOffset;
    		while (buffer[currentOffset++] != 10)
    			;
    		byte abyte0[] = new byte[currentOffset - i - 1];
    		System.arraycopy(buffer, i, abyte0, i - i, currentOffset - 1 - i);
    		return abyte0;
    	}
    
    	public void readBytes(int i, int j, byte abyte0[]) {
    		for (int l = j; l < j + i; l++)
    			abyte0[l] = buffer[currentOffset++];
    	}
    
    	public void initBitAccess() {
    		bitPosition = currentOffset * 8;
    	}
    
    	public int readBits(int i) {
    		int k = bitPosition >> 3;
    		int l = 8 - (bitPosition & 7);
    		int i1 = 0;
    		bitPosition += i;
    		for (; i > l; l = 8) {
    			i1 += (buffer[k++] & anIntArray1409[l]) << i - l;
    			i -= l;
    		}
    		if (i == l)
    			i1 += buffer[k] & anIntArray1409[l];
    		else
    			i1 += buffer[k] >> l - i & anIntArray1409[i];
    		return i1;
    	}
    
    	public void finishBitAccess() {
    		currentOffset = (bitPosition + 7) / 8;
    	}
    	
    	public int method421() {
    		int i = buffer[currentOffset] & 0xff;
    		if (i < 128)
    			return readUnsignedByte() - 64;
    		else
    			return readUnsignedWord() - 49152;
    	}
    
    	public int method422() {
    		int i = buffer[currentOffset] & 0xff;
    		if (i < 128)
    			return readUnsignedByte();
    		else
    			return readUnsignedWord() - 32768;
    	}
    
    	public void doKeys() {
    		int i = currentOffset;
    		currentOffset = 0;
    		byte abyte0[] = new byte[i];
    		readBytes(i, 0, abyte0);
    		BigInteger biginteger2 = new BigInteger(abyte0);
    		BigInteger biginteger3 = biginteger2/* .modPow(biginteger, biginteger1) */;
    		byte abyte1[] = biginteger3.toByteArray();
    		currentOffset = 0;
    		writeWordBigEndian(abyte1.length);
    		writeBytes(abyte1, abyte1.length, 0);
    	}
    
    	public void method424(int i) {
    		buffer[currentOffset++] = (byte) (-i);
    	}
    
    	public void method425(int j) {
    		buffer[currentOffset++] = (byte) (128 - j);
    	}
    
    	public int method426() {
    		return buffer[currentOffset++] - 128 & 0xff;
    	}
    
    	public int method427() {
    		return -buffer[currentOffset++] & 0xff;
    	}
    
    	public int method428() {
    		return 128 - buffer[currentOffset++] & 0xff;
    	}
    
    	public byte method429() {
    		return (byte) (-buffer[currentOffset++]);
    	}
    
    	public byte method430() {
    		return (byte) (128 - buffer[currentOffset++]);
    	}
    
    	public void method431(int i) {
    		buffer[currentOffset++] = (byte) i;
    		buffer[currentOffset++] = (byte) (i >> 8);
    	}
    
    	public void method432(int j) {
    		buffer[currentOffset++] = (byte) (j >> 8);
    		buffer[currentOffset++] = (byte) (j + 128);
    	}
    
    	public void method433(int j) {
    		buffer[currentOffset++] = (byte) (j + 128);
    		buffer[currentOffset++] = (byte) (j >> 8);
    	}
    
    	public int method434() {
    		currentOffset += 2;
    		return ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff);
    	}
    
    	public int method435() {
    		currentOffset += 2;
    		return ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] - 128 & 0xff);
    	}
    
    	public int method436() {
    		currentOffset += 2;
    		return ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] - 128 & 0xff);
    	}
    
    	public int method437() {
    		currentOffset += 2;
    		int j = ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff);
    		if (j > 32767)
    			j -= 0x10000;
    		return j;
    	}
    
    	public int method438() {
    		currentOffset += 2;
    		int j = ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] - 128 & 0xff);
    		if (j > 32767)
    			j -= 0x10000;
    		return j;
    	}
    
    	public int method439() {
    		currentOffset += 4;
    		return ((buffer[currentOffset - 2] & 0xff) << 24) + ((buffer[currentOffset - 1] & 0xff) << 16) + ((buffer[currentOffset - 4] & 0xff) << 8) + (buffer[currentOffset - 3] & 0xff);
    	}
    
    	public int method440() {
    		currentOffset += 4;
    		return ((buffer[currentOffset - 3] & 0xff) << 24) + ((buffer[currentOffset - 4] & 0xff) << 16) + ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff);
    	}
    
    	
        public int readShort() {
        	currentOffset += 2;
            int value = ((buffer[currentOffset - 2] & 0xff) << 8)
                    + (buffer[currentOffset - 1] & 0xff);
    
            if (value > 32767) {
                value -= 0x10000;
            }
            return value;
        }
        
    	public void method441(int i, byte abyte0[], int j) {
    		for (int k = (i + j) - 1; k >= i; k--)
    			buffer[currentOffset++] = (byte) (abyte0[k] + 128);
    
    	}
    
    	public void method442(int i, int j, byte abyte0[]) {
    		for (int k = (j + i) - 1; k >= j; k--)
    			abyte0[k] = buffer[currentOffset++];
    
    	}
    
    	public byte buffer[];
    	public int currentOffset;
    	public int bitPosition;
    	private static final int[] anIntArray1409 = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1 };
    	public ISAACRandomGen encryption;
    	private static int anInt1412;
    	private static final NodeList nodeList = new NodeList();
    
    }
    Reply With Quote  
     

  6. #6  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Quote Originally Posted by Mechanikas View Post
    ...
    That seems all fine glancing over it, have u tried disabling tweening?
    Reply With Quote  
     

  7. #7  
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    Quote Originally Posted by StanDev View Post
    That seems all fine glancing over it, have u tried disabling tweening?
    Not have tweening at all, i compared all animation methods with another client without this bug everything looks same
    Reply With Quote  
     

  8. #8  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Quote Originally Posted by Mechanikas View Post
    Not have tweening at all, i compared all animation methods with another client without this bug everything looks same
    Does it happen to NPCs wearing capes?
    Reply With Quote  
     

  9. #9  
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    Quote Originally Posted by StanDev View Post
    Does it happen to NPCs wearing capes?
    Yes same
    Reply With Quote  
     

  10. #10  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Quote Originally Posted by Mechanikas View Post
    Yes same
    Hmm it's maybe the vertex weights are not decoded right for this type of model (which doesn't make much sense to me),
    or the framemaps/frames linked to the cape are corrupted? Have u tried repacking the animation data?
    The only other thing I can think of is that the way these transformations are applied to the model are wrong.
    Can u post the methods in ur Model class that applies the transformations (or just ur Model class)?
    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. Has dat maker got a cape anim
    By Milk Shake in forum Models
    Replies: 16
    Last Post: 11-23-2010, 11:03 PM
  2. [PI] Skill cape Animation :s
    By patyboy in forum Help
    Replies: 1
    Last Post: 11-18-2010, 02:00 AM
  3. Cape animation
    By Guitar Hero in forum Help
    Replies: 3
    Last Post: 04-22-2009, 10:01 PM
  4. Cape Animation
    By cocoa in forum Models
    Replies: 6
    Last Post: 01-10-2009, 12:28 AM
  5. cape animation
    By ichigo1994 in forum Help
    Replies: 2
    Last Post: 12-03-2008, 07:30 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
  •