Jump to content

Player Update


tommysticks

Recommended Posts

I don't like bothering people here, I'd rather figure it out myself, but I'm still learning and appreciate the help.

 

I am working on a mod that changes character hair in-game. I've got it so it works, but the hair won't change until the player is updated, by changing either what he has equipped or what he is wearing.

 

Does anyone have any suggestions as to how I could make the player update with the press of a button? Currently, the code looks like this:

  local function checkKey(_key)	  local key = _key;	  if key == 26 then -- [		  getPlayer():getDescriptor():setHair("F_Hair_Bob_White");		  print("key pressed!");	  end  end 

Ideally the player would update after '[' is pressed as if he had just equipped a weapon or changed his shirt.

 

Link to comment
Share on other sites

I suppose having the script quickly un-equip and re-equip (or equip and delete) a clothing item to force update would work. I don't think there's any externalized methods to force the renderer to update on its own.

Link to comment
Share on other sites

Check the javadocs for the IsoGameCharacter class and see if there is something like "setDirty". There should be some kind of function which allows you to update the colors without using a hack.

After all the colors are updated in the Character Creation Menu as well.

(Or directly check the character creation menu and see how TIS updates the hair colors there ;))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...