Jump to content

Recommended Posts

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 by skapmet
Link to comment
https://forums.kleientertainment.com/forums/topic/69950-list-of-components/
Share on other sites

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 by Aquaterion
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                                         

 

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?

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.

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...