New animal tracks will not spawn unless these two actions occurs:
- The animal at the end of the track is murdered.
- The server shutdowns, "restarting" the hunter component, which may not be possible on dedicated servers OR you just don't do this cause you never knew.
This is an issue for people who like to make pens/zoos (like Koalefant, Ewecus, Vargs, and now Volt Goat pens/zoos), where unless you knew this information, you might wonder why new tracks weren't spawning for you.
The cause of this is I believe is the SpawnHuntedBest function in hunter.lua [located at lines 367-402], where the respawn timer for the tracks (aka StartCooldown) will not occur unless the animal is murdered (the OnBeastDeath function).
if hunt.huntedbeast ~= nil then --print("Kill the Beast!") hunt.huntedbeast.Physics:Teleport(spawn_x, spawn_y, spawn_z) local function OnBeastDeath() <------------- THIS FUNCTION RIGHT HERE? --print("Hunter:OnBeastDeath") inst:RemoveEventCallback("onremove", OnBeastDeath, hunt.huntedbeast) hunt.huntedbeast = nil StartCooldown(inst, hunt) <-------------- COOLDOWN ONLY STARTS AFTER MURDERING THE ANIMAL end inst:ListenForEvent("death", OnBeastDeath, hunt.huntedbeast) inst:ListenForEvent("onremove", OnBeastDeath, hunt.huntedbeast) hunt.huntedbeast:PushEvent("spawnedforhunt") return true end
One concern is that a potential fix may make it so that its only one animal tied to each unique player & that no more tracks would spawn for that player, which would not be so great because of zoos/pens, as mentioned above.
My suggestion, if possible, is to instead just check if the animal was successfully spawned & then start the dirtpile cooldown rather than having to murder the animal to initiate said cooldown. That way the server doesn't have to be shutdown for new tracks to spawn & animals can be saved for zoos/pens (if possible of course).
I never knew this until a few days ago & it made total sense why I was struggling with getting new tracks to spawn, so much thanks to @splorange, @HobNob, & @Sunset Skye for making me aware of this issue.
LongUpdate(480*2) --This is to ensure the animal tracks spawn, timer-wise. LongUpdates do properly spawn new tracks, so that's not a concern.
Walk around a little bit until new tracks spawn. c_gonext("dirtpile") till you get the animal, and then pen it.
Do another LongUpdate(480*2) and see that no matter how long you wait or walk around, a new track won't spawn.
Shutdown the server, do another LongUpdate(480*2) to ensure the track spawn, see that you've got a new track.