Thread: [Matrix Any] Hair Clipping Begone!

Results 1 to 3 of 3
  1. #1 [Matrix Any] Hair Clipping Begone! 
    🌸 Game Designer | Unity | C# 🌸
    Natalynn's Avatar
    Join Date
    Dec 2015
    Posts
    105
    Thanks given
    47
    Thanks received
    12
    Rep Power
    15
    I haven't seen this released yet, but probably has, though I haven't seen many RSPS with this. I've been running through enum params list for Matrix 592, and added this into my server. Thought I'd share with you guys, if anyone is interested.

    Appearence.java

    Add the following:

    Code:
    	public static final int HAIR_WITH_HAT_PARAM = 790;
    	public static final int HAIR_WITH_FACE_MASK_PARAM = 791;
    	public static final int MALE_HAIR_STRUCT_LOOKUP = 2338;
    	public static final int MALE_HAIR_SLOT_LOOKUP = 2339;
    	public static final int FEMALE_HAIR_STRUCT_LOOKUP = 2341;
    	public static final int FEMALE_HAIR_SLOT_LOOKUP = 2342;
    Code:
    	public int getHairParam(int baseStyle) {
    		int hairLookup = ClientScriptMap.getMap(male ? MALE_HAIR_SLOT_LOOKUP : FEMALE_HAIR_SLOT_LOOKUP).getIntValue(baseStyle);
    		return GeneralRequirementMap.getMap(ClientScriptMap.getMap(male ? MALE_HAIR_STRUCT_LOOKUP : FEMALE_HAIR_STRUCT_LOOKUP).getIntValue(hairLookup)).getIntValue(HAIR_WITH_HAT_PARAM);
    	}
    Under generateAppearenceData() {

    You need to replace the entire code for item = player.getEquipment().getItems().get(Equipment.SLO T_HAT);

    Code:
    			item = player.getEquipment().getItems().get(Equipment.SLOT_HAT);
    			if (styles[0] != -1 && (item == null || !Equipment.hideHair(item))) {
    				if(item == null) {
    					stream.writeShort(0x100 + styles[0]);
    				} else {
    					int hatHairStyle = getHairParam(styles[0]);
    					if(hatHairStyle != -1) {
    						stream.writeShort(0x100 + hatHairStyle);
    					} else {
    						stream.writeByte(0);
    					}
    				}
    			} else {
    				stream.writeByte(0);
    			}



    Last edited by Natalynn; Yesterday at 08:35 PM.
    Reply With Quote  
     


  2. #2  
    Mug Club


    Join Date
    Jul 2011
    Age
    26
    Posts
    1,875
    Thanks given
    510
    Thanks received
    890
    Discord
    View profile
    Rep Power
    332
    At least use all the variables you're creating properly if you're going to copy paste them from somewhere (Yes I know they are copy pasted from somewhere since I have identical variable names in my project):

    Code:
    	private int getHatHairStyle(int baseStyle, boolean isFaceMask) {
    		EnumDefinitions lookup = EnumDefinitions.getEnum(male ? MALE_HAIR_SLOT_LOOKUP : FEMALE_HAIR_SLOT_LOOKUP);
    		int slot = lookup.getIntValue(baseStyle);
    		EnumDefinitions structLookup = EnumDefinitions.getEnum(male ? MALE_HAIR_STRUCT_LOOKUP : FEMALE_HAIR_STRUCT_LOOKUP);
    		int structID = structLookup.getIntValue(slot);
    		return StructDefinitions.getStruct(structID).getIntValue(isFaceMask ? HAIR_WITH_FACE_MASK_PARAM : HAIR_WITH_HAT_PARAM, -1);
    	}
    Code:
    			item = player.getEquipment().get(Equipment.HEAD);
    			if (lookI[0] != -1 && (item == null || !Equipment.hideHair(item))) {
    				if (item == null)
    					stream.writeShort(0x100 + lookI[0]);
    				else {
    					int hatHairStyle = getHatHairStyle(lookI[0], item.getDefinitions().faceMask());
    					if (hatHairStyle != -1)
    						stream.writeShort(0x100 + hatHairStyle);
    					else
    						stream.writeByte(0);
    				}
    			} else
    				stream.writeByte(0);
    Code:
    	public boolean faceMask() {
    		return getParamVal(625) == 1;
    	}


    My Open Source Projects
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    touched like seafood
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    23
    Posts
    4,838
    Thanks given
    1,676
    Thanks received
    1,567
    Discord
    View profile
    Rep Power
    1390
    Good stuff! I'll try to post before pics.
    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] (official dog of rune-server)
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    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. Replies: 22
    Last Post: 03-01-2018, 04:14 PM
  2. Matrix 718 - Object Clipping
    By dlo3 in forum Help
    Replies: 0
    Last Post: 08-10-2017, 11:55 AM
  3. Clipped follow, any size npc.
    By killamess in forum Show-off
    Replies: 11
    Last Post: 01-23-2012, 02:17 PM
  4. Replies: 20
    Last Post: 09-10-2011, 10:44 AM
  5. hair clipping through hat..will rep
    By Lord Stark in forum Help
    Replies: 9
    Last Post: 02-19-2011, 10:34 AM
Tags for this Thread

View Tag Cloud

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