Jump to content

Recommended Posts

I guess you can find the code in wx78's prefab. So for shipwrecked:

steamapps\common\dont_starve\data\DLC0002\scripts\prefabs\wx78.lua

I'm a noob but it looks like they use DoPeriodicTask to run the function "dorainsparks" on regular intervals(1/10). This function then checks for moisture.

The lines in question:

inst:DoPeriodicTask(1/10, function() dorainsparks(inst, 1/10) end)

Then in dorainsparks function they use: 

  if (inst.components.moisture and inst.components.moisture:GetMoisture() > 0) then

If you want damage even when a character isn't getting wet you'd maybe need to use DoPeriodicTask and check for GetSeasonManager():IsRaining()?

 

Not tried it myself but might point you in the right direction.

Link to comment
https://forums.kleientertainment.com/forums/topic/73877-hey/#findComment-864890
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...