Closed BetterToAutomateTheWorld closed 9 years ago
I could not manage to find the way refill worked, nor how to modify the time of the first refill after the game started, it's hardcoded in hungry_games/engine.
Thank you @crabman77
Can you confirm me in this way chests are deleted and after refilled ?
yes the chest are deleted, and refilled instantly. but during the game, they are refilled without being deleted before, it may be a problem now delete them? https://github.com/MinetestForFun/server-minetestforfun-hungry_games/blob/master/mods/hungry_games/engine.lua#L83
Yes, it may be a problem, during the game, it's better to delete -> refill the chests
For the "instantly delete/refill" at the start of the game it's not good, we need to wait at least 5 or 10sec for a refill, before it was 30sec, so it was a really to big amount of time
This refill delay is for avoid an usebug, players can't take items from chests before the start of the game with it (you know, after the trompets)
There was no way for us to know how much time had to elapse between the moment the grace period started and the moment chests refilled. Random_chest was litterally doing 20 calls every 0.5 seconds, spending a random amount of time refilling. I can now add a minetest.after
before calling the chest refill to put 7 seconds to wait for after grace period started.
I will also try to find a way to use the same functions when first filling and refilling, so that chests' content is deleted before refilling.
EDIT: Just a quick clarification here,
(you know, after the trompets)
Are you talking about the trompets announcing the end of the grace period or the prestart?
Okay, so, after I dug a bit into random_chests' code, I found out that I could simply delay the refill to the end of prestart. So now, chests are filled at the first second of the grace period. https://github.com/MinetestForFun/server-minetestforfun-hungry_games/commit/f2aeb16de5cb259abbe17d59399202e782feac47
If you want to modify that you just need to add +n | -n
after hungry_games.countdown
to reduce/increase the delay.
@LeMagnesium
After the merge of the server which was 10 minutes ago => the chests refill isn't faster, it's the same refill time compared to earlier !