Thread: #177 Graphic.java readvalues

Results 1 to 5 of 5
  1. #1 #177 Graphic.java readvalues 
    Registered Member
    Join Date
    Jul 2018
    Age
    24
    Posts
    7
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Packed Zac's #177 data into Elvarg, everything works fine except I'm missing the Graphic.java readvalues

    My readvalues:

    Code:
        private void readValues(Buffer stream) {
            while(true) {
                int opcode = stream.readUnsignedByte();
                if (opcode == 0)
                    return;
                if (opcode == 1)
                    modelId = stream.readUShort();
                else if (opcode == 2) {
                    animationId = stream.readUShort();
                    if (Animation.animations != null)
                        animationSequence = Animation.animations[animationId];
                } else if (opcode == 4)
                    resizeXY = stream.readUShort();
                else if (opcode == 5)
                    resizeZ = stream.readUShort();
                else if (opcode == 6)
                    rotation = stream.readUShort();
                else if (opcode == 7)
                    modelBrightness = stream.readUShort();
                else if (opcode == 8)
                    modelShadow = stream.readUShort();
                else if (opcode == 40) {
                    int j = stream.readUnsignedByte();
                    originalModelColours = new int[j];
                    modifiedModelColours = new int[j];
                    for (int k = 0; k < j; k++) {
                        originalModelColours[k] = stream.readUShort();
                        modifiedModelColours[k] = stream.readUShort();
                    }
                } else if (opcode == 41) {
                	final int len = stream.readUnsignedByte();
                	textureToFind = new int[len];
                	textureToReplace = new int[len];
                	for(int i = 0; i < len; i++ ) {
                		textureToFind[i] = stream.readUShort();
                		textureToReplace[i] =  stream.readUShort();
                	}
                	
                } else
                    System.out.println("Error unrecognised spotanim config code: " + opcode);
            }
        }
    Getting unrecognised spotanim codes such as:
    Spoiler for Errors:
    Code:
    Error unrecognised spotanim config code: 142
    Error unrecognised spotanim config code: 23
    Error unrecognised spotanim config code: 167
    Error unrecognised spotanim config code: 55
    Error unrecognised spotanim config code: 18
    Error unrecognised spotanim config code: 23
    Error unrecognised spotanim config code: 43
    Error unrecognised spotanim config code: 54
    Error unrecognised spotanim config code: 150


    Doesn't appear that he provides the readvalues I require. I got all others he provided to work without issue. If someone could help me out with this I'd greatly appreciate it.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2008
    Posts
    29
    Thanks given
    7
    Thanks received
    8
    Rep Power
    0
    Got the exact same problem but with sequences readvalues. Been trying to fix mine by looking at the runelite sequence loader maybe you can check the Spotanim loader on runelite? Im new to this readvalues thing so no idea if it helps

    Code:
    	private void decodeValues(int opcode, SpotAnimDefinition def, InputStream stream)
    	{
    		if (opcode == 1)
    		{
    			def.modelId = stream.readUnsignedShort();
    		}
    		else if (opcode == 2)
    		{
    			def.animationId = stream.readUnsignedShort();
    		}
    		else if (opcode == 4)
    		{
    			def.resizeX = stream.readUnsignedShort();
    		}
    		else if (opcode == 5)
    		{
    			def.resizeY = stream.readUnsignedShort();
    		}
    		else if (opcode == 6)
    		{
    			def.rotaton = stream.readUnsignedShort();
    		}
    		else if (opcode == 7)
    		{
    			def.ambient = stream.readUnsignedByte();
    		}
    		else if (opcode == 8)
    		{
    			def.contrast = stream.readUnsignedByte();
    		}
    		else if (opcode == 40)
    		{
    			int var3 = stream.readUnsignedByte();
    			def.recolorToFind = new short[var3];
    			def.recolorToReplace = new short[var3];
    
    			for (int var4 = 0; var4 < var3; ++var4)
    			{
    				def.recolorToFind[var4] = (short) stream.readUnsignedShort();
    				def.recolorToReplace[var4] = (short) stream.readUnsignedShort();
    			}
    		}
    		else if (opcode == 41)
    		{
    			int var3 = stream.readUnsignedByte();
    			def.textureToFind = new short[var3];
    			def.textureToReplace = new short[var3];
    
    			for (int var4 = 0; var4 < var3; ++var4)
    			{
    				def.textureToFind[var4] = (short) stream.readUnsignedShort();
    				def.textureToReplace[var4] = (short) stream.readUnsignedShort();
    			}
    		}
    	}
    }
    Edit: Fixed my sequences. Now I'm also looking for Spotanim readvalues.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2018
    Age
    24
    Posts
    7
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Farmer Wick View Post
    Packed Zac's #177 data into Elvarg, everything works fine except I'm missing the Graphic.java readvalues

    My readvalues:

    Code:
        private void readValues(Buffer stream) {
            while(true) {
                int opcode = stream.readUnsignedByte();
                if (opcode == 0)
                    return;
                if (opcode == 1)
                    modelId = stream.readUShort();
                else if (opcode == 2) {
                    animationId = stream.readUShort();
                    if (Animation.animations != null)
                        animationSequence = Animation.animations[animationId];
                } else if (opcode == 4)
                    resizeXY = stream.readUShort();
                else if (opcode == 5)
                    resizeZ = stream.readUShort();
                else if (opcode == 6)
                    rotation = stream.readUShort();
                else if (opcode == 7)
                    modelBrightness = stream.readUShort();
                else if (opcode == 8)
                    modelShadow = stream.readUShort();
                else if (opcode == 40) {
                    int j = stream.readUnsignedByte();
                    originalModelColours = new int[j];
                    modifiedModelColours = new int[j];
                    for (int k = 0; k < j; k++) {
                        originalModelColours[k] = stream.readUShort();
                        modifiedModelColours[k] = stream.readUShort();
                    }
                } else if (opcode == 41) {
                	final int len = stream.readUnsignedByte();
                	textureToFind = new int[len];
                	textureToReplace = new int[len];
                	for(int i = 0; i < len; i++ ) {
                		textureToFind[i] = stream.readUShort();
                		textureToReplace[i] =  stream.readUShort();
                	}
                	
                } else
                    System.out.println("Error unrecognised spotanim config code: " + opcode);
            }
        }
    Getting unrecognised spotanim codes such as:
    Spoiler for Errors:
    Code:
    Error unrecognised spotanim config code: 142
    Error unrecognised spotanim config code: 23
    Error unrecognised spotanim config code: 167
    Error unrecognised spotanim config code: 55
    Error unrecognised spotanim config code: 18
    Error unrecognised spotanim config code: 23
    Error unrecognised spotanim config code: 43
    Error unrecognised spotanim config code: 54
    Error unrecognised spotanim config code: 150


    Doesn't appear that he provides the readvalues I require. I got all others he provided to work without issue. If someone could help me out with this I'd greatly appreciate it.
    Quote Originally Posted by SDGDIRKSDG View Post
    Got the exact same problem but with sequences readvalues. Been trying to fix mine by looking at the runelite sequence loader maybe you can check the Spotanim loader on runelite? Im new to this readvalues thing so no idea if it helps

    Code:
    	private void decodeValues(int opcode, SpotAnimDefinition def, InputStream stream)
    	{
    		if (opcode == 1)
    		{
    			def.modelId = stream.readUnsignedShort();
    		}
    		else if (opcode == 2)
    		{
    			def.animationId = stream.readUnsignedShort();
    		}
    		else if (opcode == 4)
    		{
    			def.resizeX = stream.readUnsignedShort();
    		}
    		else if (opcode == 5)
    		{
    			def.resizeY = stream.readUnsignedShort();
    		}
    		else if (opcode == 6)
    		{
    			def.rotaton = stream.readUnsignedShort();
    		}
    		else if (opcode == 7)
    		{
    			def.ambient = stream.readUnsignedByte();
    		}
    		else if (opcode == 8)
    		{
    			def.contrast = stream.readUnsignedByte();
    		}
    		else if (opcode == 40)
    		{
    			int var3 = stream.readUnsignedByte();
    			def.recolorToFind = new short[var3];
    			def.recolorToReplace = new short[var3];
    
    			for (int var4 = 0; var4 < var3; ++var4)
    			{
    				def.recolorToFind[var4] = (short) stream.readUnsignedShort();
    				def.recolorToReplace[var4] = (short) stream.readUnsignedShort();
    			}
    		}
    		else if (opcode == 41)
    		{
    			int var3 = stream.readUnsignedByte();
    			def.textureToFind = new short[var3];
    			def.textureToReplace = new short[var3];
    
    			for (int var4 = 0; var4 < var3; ++var4)
    			{
    				def.textureToFind[var4] = (short) stream.readUnsignedShort();
    				def.textureToReplace[var4] = (short) stream.readUnsignedShort();
    			}
    		}
    	}
    }
    Edit: Fixed my sequences. Now I'm also looking for Spotanim readvalues.
    I looked into Runelite and it appears my opcodes are the same, but I could be wrong. I settled on just using a #171 Rev spotanim and it works well atm, when I have time I'll look back into this, uni is taking priority atm though. Thanks for the reply it was helpful

    Okay nevermind I just resolved the issue, within opcode 7 and opcode 8 I needed to change it from stream.readUShort(); to stream.readUnsignedByte(); . I feel silly for missing something so simple. Thanks for the help
    Reply With Quote  
     

  4. #4  
    ( ͡° ͜ʖ ͡°)


    Join Date
    Sep 2014
    Age
    21
    Posts
    2,396
    Thanks given
    1,318
    Thanks received
    1,101
    Rep Power
    5000
    Rename to suit.

    Code:
    	private void readValues(Stream buffer) {
    		while (true) {
    			final int opcode = buffer.readUnsignedByte();
    			if (opcode == 0) {
    				return;
    			}
    			else if (opcode == 1) {
    				model = buffer.readShort();
    			}
    			else if (opcode == 2) {
    				animationId = buffer.readShort();
    				if (Sequences.anims != null) {
    					animationSequence = Sequences.anims[animationId];
    				}
    			}
    			else if (opcode == 4) {
    				scale = buffer.readShort();
    			}
    			else if (opcode == 5) {
    				height = buffer.readShort();
    			}
    			else if (opcode == 6) {
    				rotation = buffer.readShort();
    			}
    			else if (opcode == 7) {
    				ambient = buffer.readUnsignedByte();
    			}
    			else if (opcode == 8) {
    				contrast = buffer.readUnsignedByte();
    			}
    			else if (opcode == 40) {
    				final int len = buffer.readUnsignedByte();
    				srcColors = new short[len];
    				dstColors = new short[len];
    				for (int i = 0; i < len; i++) {
    					srcColors[i] = (short) buffer.readShort();
    					dstColors[i] = (short) buffer.readShort();
    				}
    			}
    			else if (opcode == 41) {
    				final int len = buffer.readUnsignedByte();
    				retextureToFind = new short[len];
    				retextureToReplace = new short[len];
    				for (int i = 0; i < len; i++) {
    					retextureToFind[i] = (short) buffer.readShort();
    					retextureToReplace[i] = (short) buffer.readShort();
    				}
    			}
    			else {
    				Utility.print("gfx invalid opcode: " + opcode);
    			}
    		}
    	}


    "There's no such thing as a PI client " - Albert Einstein

    Quote Originally Posted by soccerchamp149 View Post
    whats eclipse lol
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Apr 2016
    Posts
    33
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by A Mage View Post
    Rename to suit.

    Code:
    	private void readValues(Stream buffer) {
    		while (true) {
    			final int opcode = buffer.readUnsignedByte();
    			if (opcode == 0) {
    				return;
    			}
    			else if (opcode == 1) {
    				model = buffer.readShort();
    			}
    			else if (opcode == 2) {
    				animationId = buffer.readShort();
    				if (Sequences.anims != null) {
    					animationSequence = Sequences.anims[animationId];
    				}
    			}
    			else if (opcode == 4) {
    				scale = buffer.readShort();
    			}
    			else if (opcode == 5) {
    				height = buffer.readShort();
    			}
    			else if (opcode == 6) {
    				rotation = buffer.readShort();
    			}
    			else if (opcode == 7) {
    				ambient = buffer.readUnsignedByte();
    			}
    			else if (opcode == 8) {
    				contrast = buffer.readUnsignedByte();
    			}
    			else if (opcode == 40) {
    				final int len = buffer.readUnsignedByte();
    				srcColors = new short[len];
    				dstColors = new short[len];
    				for (int i = 0; i < len; i++) {
    					srcColors[i] = (short) buffer.readShort();
    					dstColors[i] = (short) buffer.readShort();
    				}
    			}
    			else if (opcode == 41) {
    				final int len = buffer.readUnsignedByte();
    				retextureToFind = new short[len];
    				retextureToReplace = new short[len];
    				for (int i = 0; i < len; i++) {
    					retextureToFind[i] = (short) buffer.readShort();
    					retextureToReplace[i] = (short) buffer.readShort();
    				}
    			}
    			else {
    				Utility.print("gfx invalid opcode: " + opcode);
    			}
    		}
    	}
    Rename what to suit?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. [Tutorial] Draw GIFS with Java graphics
    By harley_rae_ann in forum Tutorials
    Replies: 0
    Last Post: 04-29-2018, 10:20 AM
  2. Reamhosting - Webhosting, Domains, Graphics, Java software
    By julianflamingsites in forum Selling
    Replies: 2
    Last Post: 07-28-2013, 03:01 PM
  3. Replies: 4
    Last Post: 06-02-2010, 10:31 PM
  4. Replies: 6
    Last Post: 03-30-2009, 11:24 PM
  5. New Version of my old ¨Java Coder Sig¨
    By Ndugu in forum Showcase
    Replies: 2
    Last Post: 04-26-2007, 08:59 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
  •