JunyDeveloper / GamblingModLethalCompany

3 stars 7 forks source link

Added cooldown as a configurable value #28

Closed Adam759 closed 6 months ago

Adam759 commented 6 months ago

I went through and added the cooldown time to the configurable variables, same as a lot of the other variables are. I've tested with myself in a lobby and it works, compiles without error, but haven't tested with another person, or multiple people. I think it will work fine though. I also haven't tested negative or non-whole numbers - not sure if that is necessary to filter out being I don't think I see any protection on the others.

Quite a few friends and I were playing with this mod and it is great! Really saved us a few times when we were short on quota (and burned us a few times with we got greedy!). However, with 5+ people and a few dozen pieces of loot we want to gamble, we end up being at the company building for quite a long time with the long cooldown. We could cut this down dramatically with a cooldown of say 1 second. Or, if we want to play more challenging and discourage gambling, set it to something like 10 seconds.

One of the only other quirky things I can think of is the 4 second drumroll clip is now either played on top of itself and the result clip is played under it if the cooldown is set lower, or there is a delay between the end of the drumroll clip and the result clip if its set higher. The only thing I can think of to fix this is to split the drumroll clip into 3 audio segments, play the first segment on interaction, loop the middle segment as long as needed, and play the 'tss right before the result clip. I'm thinking of looking into this, but for now this adds the basic functionality.

Only other thing is I don't know how a lower cooldown time will affect server / client sync with latency and spamming the machine. If it does, I think having it editable with an understanding that putting low cooldowns may affect stability with spamming it is up to the host possibly. Though I think I saw some logic in there that denies any subsequent requests after one request has been accepted by the server.

Thanks for the great mod and hope this helps!

JunyDeveloper commented 6 months ago

Hello Adam! Glad you like the mod :). I'll take a look at the code fully once I get back home!

The drum-roll audio will definitely be off-time anytime the cooldown is changed from the default. I haven't looked into any audio manipulation yet, but that'd be sick if you could get that working!

For the machine spam, I did have a "lock" that I sort of just hacked in as a backup to hope that it blocks spammed requests. I'll have to revisit that one later just to double check! I agree that adding some sort of disclaimer would be good just in-case spamming does end up causing some stability.

JunyDeveloper commented 6 months ago

Can confirm that it's working so this will be release in 1.1.3. Nice work!