Thread: [503] Weapon Animations (Stand/Walk/Run/Turn Handling)

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38
  1. #1 [503] Weapon Animations (Stand/Walk/Run/Turn Handling) 
    Community Veteran


    Join Date
    Oct 2006
    Posts
    451
    Thanks given
    5
    Thanks received
    1
    Rep Power
    137
    Add this class in the Players directory:

    All godswords handled.

    Code:
    package RS2E.Players;
    
    import RS2E.Players.Player;
    import RS2E.Main;
    
    public class WeaponAnim
    {
    
        public WeaponAnim(Player p)
        {
            if(p == null)
            {
                return;
            }
            int weaponID = p.equipment[3];
            switch(weaponID) {
    			case 11696: //Bandos Godsword Handled
    			case 11694: //Armadyl Godsword Handled
    			case 11698: //Saradomin Godsword Handled
    			case 11700: //Zamorak Godsword Handled
    				p.standEmote = 7047;
    				p.walkEmote = 7046;
    				p.runEmote = 7039;
    				p.turnAnimation = 7040; //Regular turn
    				p.turnAnimation180 = 7045; //180 degree turn
    				p.turnAnimationC90 = 7044; //1st 90 degree turn
    				p.turnAnimationCC90 = 7043; //2nd 90 degree turn
    			break;
    			default: //All unhandled weapons
    				p.standEmote = 0x328;
    				p.walkEmote = 0x333;
    				p.runEmote = 0x338;
    			break;
    		}
        }
    }
    In PlayerUpdateBlock.java, add this above "playerProps.writeWord(p.standEmote);":
    Code:
    WeaponAnim wep = new WeaponAnim(p);
    In PlayerUpdateBlock, delete this line:

    Code:
    public int[] otherEmotes = {0x337, 0x334, 0x335, 0x336};
    Now go to PlayerInstances and declare these integers:

    Code:
        public int turnAnimation = 0x337;
        public int turnAnimation180 = 0x334;
        public int turnAnimationC90 = 0x335;
        public int turnAnimationCC90 = 0x336;
    Now go back to PlayerUpdateBlock and change the following lines:
    Code:
            playerProps.writeWord(otherEmotes[0]);
    To:
    Code:
    playerProps.writeWord(p.turnAnimation);
    Then:
    Code:
    playerProps.writeWord(otherEmotes[1]);
    To:
    Code:
    playerProps.writeWord(p.turnAnimation180);
    Then:
    Code:
    playerProps.writeWord(otherEmotes[2]);
    To:
    Code:
    playerProps.writeWord(p.turnAnimationC90);
    Then:
    Code:
    playerProps.writeWord(otherEmotes[3]);
    To:
    Code:
    playerProps.writeWord(p.turnAnimationCC90);

    This will make the correct animation, if handled, to appear and this is just a way to organize it

    Note: I already have the zamorak godsword handled for people. Thanks to Zamorak Zxt for the IDs
    Est. 2006
    Reply With Quote  
     

  2. #2  
    Long-Term Community Veteran
    Zamorak Zxt's Avatar
    Join Date
    Nov 2006
    Age
    32
    Posts
    256
    Thanks given
    0
    Thanks received
    0
    Rep Power
    62
    Thank you Guthan, for my Request.
    Thanks, Codykins
    _____________________
    ~Zamorak Zxt~
    Reply With Quote  
     

  3. #3  
    Draeda
    Guest
    Thanks guthan, ownz ftw.
    Reply With Quote  
     

  4. #4  
    Ian...
    Guest
    Nice work mate, i see you edited the title too?

    Well i will add this and ill release my emote looping system in a minute or 5.

    - Ian...
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Sep 2006
    Posts
    375
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    Hmm, how about the turn90degrees one? Otherwise it looks daft when walking around
    Reply With Quote  
     

  6. #6  
    Registered Member Swaid's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    48
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Sweet job Guthan, People posting loads of tuts and people progressing loads of 503 now :woot:
    Reply With Quote  
     

  7. #7  
    Draeda
    Guest
    Just got the random client error again
    Reply With Quote  
     

  8. #8  
    Community Veteran


    Join Date
    Oct 2006
    Posts
    451
    Thanks given
    5
    Thanks received
    1
    Rep Power
    137
    Quote Originally Posted by madman00901 View Post
    Hmm, how about the turn90degrees one? Otherwise it looks daft when walking around
    Yeah, I'm going to edit the way it's done now and post the updated version in a bit.

    Edit: Added turning animations.
    Est. 2006
    Reply With Quote  
     

  9. #9  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    Nice, can u make this with loading the IDs from a cfg???
    Reply With Quote  
     

  10. #10  
    Ian...
    Guest
    Nice updates

    I Cleaned it up a bit, i dont know if you want to use or not;
    Code:
    	public WeaponAnim(Player p) {
            if(p == null) {
                return;
            }
    		int weaponID = p.equipment[3];
    		int stand = p.standEmote,			// Stand Emote
    			walk = p.walkEmote, 			// Walking Emote
    			run = p.runEmote,				// Running Emote
    			turn = p.turnAnimation,			// Turning Emote
    			turn180 = p.turnAnimation180,	// Turning 180 Degreese
    			turnC90 = p.turnAnimationC90,	// Turning 90 Degreese Clockwise
    			turnCC90 = p.turnAnimationCC90; // Turning 90 Degreese Counter Clockwise
            switch(weaponID) {
    		
    			//Zamorak Godsword
    			case 11700: 
    				stand = 7047;
    				walk = 7046;
    				run = 7039;
    				turn = 7040;
    				turn180 = 7045;
    				turnC90 = 7044;
    				turnCC90 = 7043;
    				break;
    			
    			//Any unhandled weapons return default emotes.
    			default: 
    				stand = 0x328;
    				walk = 0x333;
    				run = 0x338;
    				turn = 0x337;
    				turn180 = 0x334;
    				turnC90 = 0x335;
    				turnCC90 = 0x336;
    				break;
    		}
        }
    Reply With Quote  
     

Page 1 of 4 123 ... LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •