Jump to content

[Gameplay] No Gobbler spawns in normal/RoG mode [+solution]


TonyV
  • Fixed

Please choose a category

[Gameplay]

Platform

  • Steam

Do you use mods?
         yes

Version Number

2016-02-26_14-15-59 Rev. 168028

Issue title

[Gameplay] No Gobbler spawns in normal/RoG mode

Steps to reproduce

Play the game for some unreasonable amount of time and pick lots of berries to verify.

Describe your issue

I have picked hundreds of berries and I've noticed that gobblers (prefab: "perd") no longer seem to spawn.  I also reported this issue in the Don't Starve bug forum, but the bug was introduced with Shipwrecked content, so I'm cross-posting here for reference.  Feel free to lock or delete my other post.


Steps to Reproduce
Play the game for some unreasonable amount of time and pick lots of berries to verify.



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

The code to spawn perds has been commented out.  The function that spawns perds has also been changed to spawn a (currently) non-existent prefab called "peacock" instead.  Hypothesis o' Tony is that someone was working to create a Shipwrecked-specific peacock that replaces the perd, and for whatever reason, they didn't put in the conditional to check for it (maybe the IsModeShipwrecked function wasn't implemented yet or something).  So they made the change from perd to peacock, and since the prefab wasn't defined, it caused the game to crash.  To avoid this, they commented out the lines that spawn perds altogether.

But regardless of the rationale behind it, you can restore perd spawning by uncommenting out the code to spawn a perd in onpickedfn and modifying spawnperd to spawn a peacock or perd depending on the game mode.  You will also need to validate that the object exists, since peacocks aren't implemented yet in Shipwrecked.

dont_starve\data\DLC0002\scripts\prefabs\berrybush.lua

Lines 143-145 Original:

-- if picker and not picker:HasTag("berrythief") and math.random() < TUNING.PERD_SPAWNCHANCE then
--     inst:DoTaskInTime(3+math.random()*3, spawnperd)
-- end

Change to: (remove comment delimiters)

if picker and not picker:HasTag("berrythief") and math.random() < TUNING.PERD_SPAWNCHANCE then
    inst:DoTaskInTime(3+math.random()*3, spawnperd)
end

Lines 110-116 Original:

local perd = SpawnPrefab("peacock")
local spawnpos = Vector3(inst.Transform:GetWorldPosition() )
spawnpos = spawnpos + TheCamera:GetDownVec()
perd.Transform:SetPosition(spawnpos:Get() )
perd.sg:GoToState("appear")
perd.components.homeseeker:SetHome(inst)
shake(inst)

Change to:

local perd

if SaveGameIndex:IsModeShipwrecked() then
    perd = SpawnPrefab("peacock")
else
    perd = SpawnPrefab("perd")
end

if perd then
    local spawnpos = Vector3(inst.Transform:GetWorldPosition() )
    spawnpos = spawnpos + TheCamera:GetDownVec()
    perd.Transform:SetPosition(spawnpos:Get() )
    perd.sg:GoToState("appear")
    perd.components.homeseeker:SetHome(inst)
    shake(inst)
end

I've also attached a complete copy of my berrybush.lua that corrects the issue.

berrybush.lua

Edited by TonyV

Share this comment


Link to comment
Share on other sites

I think "peacock" is not implemented yet. (might be that's an alternative version of gobbler. But there's no data about it.)

So I think just simply change

local perd = SpawnPrefab("peacock")
local spawnpos = Vector3(inst.Transform:GetWorldPosition() )
spawnpos = spawnpos + TheCamera:GetDownVec()
perd.Transform:SetPosition(spawnpos:Get() )
perd.sg:GoToState("appear")
perd.components.homeseeker:SetHome(inst)
shake(inst)

to 

local perd = SpawnPrefab("perd") --  is the only tweak.
local spawnpos = Vector3(inst.Transform:GetWorldPosition() )
spawnpos = spawnpos + TheCamera:GetDownVec()
perd.Transform:SetPosition(spawnpos:Get() )
perd.sg:GoToState("appear")
perd.components.homeseeker:SetHome(inst)
shake(inst)

is better for SW playing.

Edited by YakumoYukari

Share this comment


Link to comment
Share on other sites

I left the peacock spawn in shipwrecked so that if it ever is implemented, the code will still work right.

Share this comment


Link to comment
Share on other sites


×
  • Create New...