Thread: Cosmetic overrides

Results 1 to 7 of 7
  1. #1 Cosmetic overrides 
    Registered Member
    Join Date
    Oct 2014
    Posts
    32
    Thanks given
    7
    Thanks received
    1
    Rep Power
    11
    I want to make it so only one equipment slot is an override,


    Itemconstant.java
    Code:
     public static int get200milHerb(int slot, boolean male) {
    		switch (slot) {
    			case Equipment.SLOT_CAPE:
    				return male ? 90121 : 90121;
    		}
    		return -1;
    	}
    When I try this code the rest of the player's body is invisible ...
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    return -1;

    makes all the other slots except the declared ones -1
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    For the rest, you're returning -1. So make it return the slot. Example:
    Code:
     public static int get200milHerb(int slot, boolean male) {
    		switch (slot) {
    			case Equipment.SLOT_CAPE:
    				return male ? 90121 : 90121;
    		}
    		return get(slot);
    	}
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Oct 2014
    Posts
    32
    Thanks given
    7
    Thanks received
    1
    Rep Power
    11
    Thanks both of you!
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Oct 2014
    Posts
    32
    Thanks given
    7
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Kaleem View Post
    For the rest, you're returning -1. So make it return the slot. Example:
    Code:
     public static int get200milHerb(int slot, boolean male) {
    		switch (slot) {
    			case Equipment.SLOT_CAPE:
    				return male ? 90121 : 90121;
    		}
    		return get(slot);
    	}
    Can you give me your
    Code:
     private static int get(int slot) {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    methode maybe ?
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    Quote Originally Posted by Strontje60 View Post
    Can you give me your
    Code:
     private static int get(int slot) {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    methode maybe ?
    That was just an example, 'get' is just getting the Item that the player has equipped in that slot
    Attached image
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2008
    Posts
    286
    Thanks given
    17
    Thanks received
    4
    Rep Power
    2
    you can also rebuild your switch statement to an if statement which will not result in a default return value that removes everything else (you can also make more cases in your switch for other slots - might take a lot of work / all slots should be assigned values).
    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. [718] Cosmetic Overrides ~ Basic
    By OG KingFox in forum Tutorials
    Replies: 30
    Last Post: 04-03-2016, 11:11 AM
  2. Cosmetics Override
    By Lorex in forum Show-off
    Replies: 30
    Last Post: 11-23-2014, 01:09 AM
  3. Replies: 7
    Last Post: 08-16-2013, 09:26 PM
  4. Replies: 9
    Last Post: 08-06-2008, 10:20 PM
  5. Replies: 22
    Last Post: 06-11-2008, 02:27 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
  •