饥荒联机版

饥荒联机版

[API] Time Control
11 条留言
芬迪 2024 年 9 月 17 日 下午 9:46 
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  [作者] 2021 年 11 月 26 日 下午 4:38 
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  [作者] 2021 年 11 月 12 日 上午 1:20 
Oh, silly me, I didn't apply my changes to anything other than the debug function, my bad.
Wonderlarr  [作者] 2021 年 11 月 11 日 下午 11:16 
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  [作者] 2021 年 11 月 11 日 下午 3:43 
I think either it didn't work well and/or it had side-effects that I wasn't happy with.
Wonderlarr  [作者] 2021 年 11 月 11 日 上午 10:51 
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  [作者] 2021 年 11 月 11 日 上午 9:20 
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  [作者] 2021 年 11 月 10 日 下午 10:43 
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  [作者] 2021 年 11 月 10 日 下午 9:51 
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  [作者] 2021 年 11 月 10 日 下午 1:30 
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  [作者] 2021 年 8 月 11 日 下午 10:06 
Woah.... this is freaking impressive, I'm gonna have to look into how this works!