Don't Starve Together

Don't Starve Together

[API] Time Control
11 Comments
芬迪 17 Sep, 2024 @ 9:46pm 
Hello, whenever I enable this mods, it always shows that there is something wrong with the server, etc. If I turn it off, it will be fine. I have tried it for a while and it is really a problem with Hat kid. I'm sorry:steamsad: @skylarr
Wonderlarr  [author] 26 Nov, 2021 @ 4:38pm 
After some light experimentation, your attack period code just needs some slight adjustment to work, and it appears to work without errors in my uses. Here's what I've used.

https://pastebin.com/W8RNh2Gy
󰀏Niko  [author] 12 Nov, 2021 @ 1:20am 
Oh, silly me, I didn't apply my changes to anything other than the debug function, my bad.
Wonderlarr  [author] 11 Nov, 2021 @ 11:16pm 
I hate to bother you more, but I'm not sure if the update fixed the problem, still getting the same crash.

I think it may be best to check if it's the server sending the command inside IsAdmin(), something like this https://pastebin.com/xUXnmH1U
󰀏Niko  [author] 11 Nov, 2021 @ 3:43pm 
I think either it didn't work well and/or it had side-effects that I wasn't happy with.
Wonderlarr  [author] 11 Nov, 2021 @ 10:51am 
Awesome! While I was snooping around in the mod, I noticed commented out code that adjusts attack period, is that code broken? For my use, having the attack period adjustment would make a lot of sense.
󰀏Niko  [author] 11 Nov, 2021 @ 9:20am 
I think that I have fixed the issue, seems that I forgot to have it not check if the sender was an admin when it's the server that sent it.
Wonderlarr  [author] 10 Nov, 2021 @ 10:43pm 
It was a locally hosted server with caves enabled, not dedicated. World settings and such were completely set to default and I was the only player on the server. I was calling SetLocalTimeScale() from a prefab in my mod.

Now that I think it, does IsAdmin() check if there actually IS a player or not?
󰀏Niko  [author] 10 Nov, 2021 @ 9:51pm 
Hm... interesting, Ill have to look into that tomorrow. In the meantime If you could tell me a bit more information of the server settings such as was it a hosted world or a dedicated server, and were caves enabled?
Wonderlarr  [author] 10 Nov, 2021 @ 1:30pm 
I'm getting a crash when calling SetLocalTimeScale, though it seems to not be related to the actual time manipulation, rather the IsAdmin check is failing, though I'm not experienced enough to fix it myself. I bypassed the crash by just making IsAdmin always return true, but of course that's temporary.

Crash Log: https://pastebin.com/Sw6EMYj0

This tool is great so far, when bypassing the crash it works (as far as I can tell) pretty well! I didn't even know you could manipulate stategraphs like you did, but I guess I have a lot to learn then.
Wonderlarr  [author] 11 Aug, 2021 @ 10:06pm 
Woah.... this is freaking impressive, I'm gonna have to look into how this works!