Jump to content

hey


beaenkes

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