JejmanGTA Posted November 29, 2015 Share Posted November 29, 2015 Like the title says, I'm looking for someone who can help me code a trait for a custom character.A friend of mine asked me to make a character who deals more damage when said character has 40% or less HP.I thought I could adapt Wolfgang's trait, but replace hunger with health, bto my surprise it's more complicated than that.The trait is:-Damage Multiplier = 1.5 when health is below or equal to 40%-Damage Multiplier = 1 when health is above 40%.Health is 200. Any help is appreciated. Link to comment Share on other sites More sharing options...
Arkathorn Posted November 30, 2015 Share Posted November 30, 2015 Do you need to have an animation to indicate this, or just passively deal more damage? Link to comment Share on other sites More sharing options...
pickleplayer Posted November 30, 2015 Share Posted November 30, 2015 theoretically, it shouldn't be more complicated than just adapting Wolfgang's trait coding. Change the onhungerchange function to listen for health change instead. inst:ListenForEvent("hungerdelta", onhungerchange) would become inst:ListenForEvent("healthdelta", onhealthchange) (and you'd need to change all other instances of onhungerhange to onhealthchange as well) All instances of inst.components.hunger.current would be changed to inst.components.health.current (I THINK) TUNING.WOLFGANG_START_MIGHTY_THRESH is just a number declared in tuning.lua. you can just replace it with any number you want, like "55" and that would make his "mighty" level start when he has 55 hunger. (of course you'd change it to work with health instead and stuff) You'd just have to cut out all the extra stuff like the animations and size stuff that changes when his mightyness levels change, since you don't have any of those extra animations and builds/banks and stuff. Link to comment Share on other sites More sharing options...
Recommended Posts
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.