skapmet Posted September 3, 2016 Share Posted September 3, 2016 (edited) Is there any list of all components in DST? i cant find any, please help especially i need smth like inst.component.current.health or .hunger wanna make if current health < 100 then do smth end Edited September 3, 2016 by skapmet Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/ Share on other sites More sharing options...
Aquaterion Posted September 3, 2016 Share Posted September 3, 2016 you can find all the components in the components folder under data/scripts/components for current health its inst.components.health.currenthealth and for hunger inst.components.hunger.current Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810061 Share on other sites More sharing options...
skapmet Posted September 3, 2016 Author Share Posted September 3, 2016 if inst.components.health.currenthealth < 140 then inst.components.combat.damagemultiplier = 10 end is not working :/ Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810072 Share on other sites More sharing options...
Aquaterion Posted September 3, 2016 Share Posted September 3, 2016 35 minutes ago, skapmet said: if inst.components.health.currenthealth < 140 then inst.components.combat.damagemultiplier = 10 end is not working :/ well where are you putting it? Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810078 Share on other sites More sharing options...
skapmet Posted September 3, 2016 Author Share Posted September 3, 2016 in my character script Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810079 Share on other sites More sharing options...
Aquaterion Posted September 3, 2016 Share Posted September 3, 2016 (edited) 43 minutes ago, skapmet said: in my character script try doing inst:ListenForEvent("healthdelta", function(inst, data) if inst.components.health.currenthealth < 140 then inst.components.combat.damagemultiplier = 10 else inst.components.combat.damagemultiplier = 1 --normal damage when it goes back up end end) Edited September 3, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810082 Share on other sites More sharing options...
Serpens Posted September 3, 2016 Share Posted September 3, 2016 and please also read this post, never change damagemultiplier or another simular value during the game to a set value!: Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810084 Share on other sites More sharing options...
skapmet Posted September 3, 2016 Author Share Posted September 3, 2016 1 hour ago, Aquaterion said: try doing inst:ListenForEvent("healthdelta", function(inst, data) if inst.components.health.currenthealth < 140 then inst.components.combat.damagemultiplier = 10 else inst.components.combat.damagemultiplier = 1 --normal damage when it goes back up end end) Nice! its working thanks! and same for hunger or sanity? inst:ListenForEvent("hungerdelta", function(inst, data) if inst.components.hunger.current < 140 then blabla end inst:ListenForEvent("sanitydelta", function(inst, data) if inst.components.sanity.current < 140 then blabla end Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810088 Share on other sites More sharing options...
Aquaterion Posted September 3, 2016 Share Posted September 3, 2016 yep that should work just fine Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810092 Share on other sites More sharing options...
Serpens Posted September 3, 2016 Share Posted September 3, 2016 @skapmet dont forget to do what I wrote in my post. If you don't do this, your character will be toally messed up if someone plays it with a mod that also changes damagemultiplier during game. Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810108 Share on other sites More sharing options...
skapmet Posted September 4, 2016 Author Share Posted September 4, 2016 19 hours ago, Serpens said: @skapmet dont forget to do what I wrote in my post. If you don't do this, your character will be toally messed up if someone plays it with a mod that also changes damagemultiplier during game. by your post i understand i should use TUNING.WILSON_HUNGER_RATE * 1 and same for dmg and other values? Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810433 Share on other sites More sharing options...
Serpens Posted September 4, 2016 Share Posted September 4, 2016 make it that way, that you can revert it back to the previous value. And you don't know the previous value, since every other mod can change it too. That's why you have to use multiplication (and division to revert it back) in case of damagemultiplier. I think hungerrate is also a multiplier, so here you also have to use mutiplication. Link to comment https://forums.kleientertainment.com/forums/topic/69950-list-of-components/#findComment-810460 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now