The Mystery of the Runaway Tree


Recommended Posts

During the wet season, I was trying to find a way to pass the time during a storm and decided to cut some trees for firewood. While I was replanting some, one of them decided to get up and run off. I think it's related to the gusts of wind, but it kept going at a constant speed and headed off into the white waves, never to be seen again.

post-331005-0-91205400-1449079284_thumb.

post-331005-0-39810900-1449079294_thumb.

Link to comment
Share on other sites

D'aw, I saved and quitted after the second screenshot to post this bug, and reloading the game triggers an error:

...t_starve/data/scripts/prefabs/tree_creak_emitter.lua:13: attempt to perform arithmetic on field 'timer' (a nil value)LUA ERROR stack traceback:    C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/prefabs/tree_creak_emitter.lua(13,1) in function 'onupdate'    C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/spotemitter.lua(29,1) in function 'OnUpdate'    C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/update.lua(104,1)

The line in question is the first line in this function:

local function OnUpdate(inst, dt)	inst.timer = inst.timer - dt	if inst.timer <= 0.0 then		inst.timer = 0.5 * math.random()		inst.SoundEmitter:PlaySound("dontstarve_DLC002/common/wind_tree_creak")	endend

Not sure why the entity didn't get a timer value; maybe it wasn't saved/loaded? That may be the bug to fix. Otherwise, adding the following line to the top of the function circumvents the issue:

	if not inst.timer then inst.timer = 0 end

Upon logging back in, that myserious wayward tree has settled down and taken roots over the deep blue. I'll have to row out there and chop it down when it grows up.

post-331005-0-44354100-1449080059_thumb.

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.