Jump to content

Making a specific character's sanity badge look different.


NikMik

Recommended Posts

Ho-ho-ho, yet another thread by me! Anyways.

For my custom character, I want the sanity badge to be a claw instead of a brain. While I could do a reskin, I want it to still be the brain for the rest of the characters. The Always on Status mod only changes it's position, and the RPG Hud didn't seem to quite have what I was looking for.

 

Any help?

Link to comment
Share on other sites

did you try something like this,

 

"

 

AddClassPostConstruct("widgets/statusdisplays",fn) then set inst.brain.anim to point somewhere else

 

AddClassPostContruct sets code to execute after 'original' costructor is set

 

so in its function you'd have to check for GetPlayer()=="charname" or GetPlayer().prefab=="charname" or something like that, then

 

 

something like inst.brain.anim:GetAnimState():SetBank("claw") inst.brain.anim:GetAnimState():SetBuild("claw)

 

 

"

 

and make sure that claw is defined in some anim zip in an appropriate way and declared within the scope

 

That might work

 

or you could do what we are doing in the "Hero in the Dark" mod and dont code it into main but do what we do, define postconstruct on the level of a char.lua and just check if it exists/call it from there

Link to comment
Share on other sites

did you try something like this,

 

"

 

AddClassPostConstruct("widgets/statusdisplays",fn) then set inst.brain.anim to point somewhere else

 

AddClassPostContruct sets code to execute after 'original' costructor is set

 

so in its function you'd have to check for GetPlayer()=="charname" or GetPlayer().prefab=="charname" or something like that, then

 

 

something like inst.brain.anim:GetAnimState():SetBank("claw") inst.brain.anim:GetAnimState():SetBuild("claw)

 

 

 

"

 

and make sure that claw is defined in some anim zip in an appropriate way and declared within the scope

 

 

 

 

That might work

 

or you could do what we are doing in the "Hero in the Dark" mod and dont code it into main but do what we do, define postconstruct on the level of a char.lua and just check if it exists/call it from there

 

You can run a bit of code that would otherwise affect all characters on only one with this:

 

AddSimPostInit(function(inst)        if inst.prefab == "MYCHARACTER" then                ClawPostInit(inst)        endend)

 

if you then used the prefab post-init ClawPostInit, to change the build (just the build) as mentioned above to your reskinned and buildname-altered new art... I think that might work! (And possibly be a little simpler.)

Link to comment
Share on other sites

This would be very fiddly... but if neither of those work... you may have to try making a whole new badge, hiding the original sanity badge, and then hooking it up so it displays the sanity value.

 

My Link mod has a hidden sanity badge, and a made-from-scratch badge. Unfortunately, that was all done by CJB, who seems to have disappeared, so I don't have the greatest grasp of how it works.

For reasons he didn't understand, there were difficulties in making a reskin-based meter work... so we had to do one from scratch in Spriter.

I uploaded the Spriter Project for this, but as I said in the post... I'm not sure if this was the one that worked perfectly, or if the animation had to be altered to make it function correctly.

http://forums.kleientertainment.com/topic/28828-asset-template-request/#entry345498

Link to comment
Share on other sites

This would be very fiddly... but if neither of those work... you may have to try making a whole new badge, hiding the original sanity badge, and then hooking it up so it displays the sanity value.

 

My Link mod has a hidden sanity badge, and a made-from-scratch badge. Unfortunately, that was all done by CJB, who seems to have disappeared, so I don't have the greatest grasp of how it works.

For reasons he didn't understand, there were difficulties in making a reskin-based meter work... so we had to do one from scratch in Spriter.

I uploaded the Spriter Project for this, but as I said in the post... I'm not sure if this was the one that worked perfectly, or if the animation had to be altered to make it function correctly.

http://forums.kleientertainment.com/topic/28828-asset-template-request/#entry345498

I'll take a look at that. Thank you very much! I have the claw done, just need to put it on. I'll put up a screenshot shortly.

 

EDIT: There we are. It shrivels up as the sanity lowers.

post-286034-0-05614800-1392610601.png

 

Link to comment
Share on other sites

OK, I've got.

 

AddSimPostInit(function(inst)if GetPlayer().prefab == "grag" theninst.HUD.controls.status.heart:SetPosition( inst.HUD.controls.status.stomach:GetPosition() )inst.HUD.controls.status.brain:SetPosition( inst.HUD.controls.status.brain:GetPosition() )inst.HUD.controls.status.stomach:Hide()endend)

I may be getting close to finding a way of making it a different build. inst.HUD.controls.status.brain:SetBuild("saneclaw") didn't work, just as I expected. But I'll come up with somethin'!

 

EDIT: Adding inst.HUD.controls.status.brain.anim:GetAnimState():SetBuild("saneclaw") worked! Thank you, Kraken!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...