[Mod] Restart Gift [restart_gift]

Post Reply
User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

[Mod] Restart Gift [restart_gift]

by ChimneySwift » Post

Restart Gift

Server restarts and crashes are a necessary but annoying part of the Minetest game, so this mod tries to make them more bearable by giving players who log back in after a restart/crash a little gift.

GitHub
ZIP Download

Code license: MIT

Dependencies: None

Usage

Modify the variables on lines 1 to 7 of init.lua to change gift timeout (amount of time after a restart players who were kicked have to log in bu to receive a gift) in seconds (default: 300 seconds or 5 minutes), gift name (default: "default:mese"), and gift count (default: 1)
A spoon is basically a tiny bowl with a stick on it

User avatar
AccidentallyRhine
Member
Posts: 252
Joined: Sun Aug 02, 2015 05:43

Re: [Mod] Restart Gift [restart_gift]

by AccidentallyRhine » Post

The only problem I foresee is that this could incentivize players to abuse issues known to cause server crashes. Though I guess that would also be motivation to actually address server crashes...

User avatar
KatzEyez
Member
Posts: 50
Joined: Tue Aug 08, 2017 18:24
GitHub: KatzPetz
IRC: LadyK
In-game: LadyK
Location: (IG: Depends) (RL: USA)

Re: [Mod] Restart Gift [restart_gift]

by KatzEyez » Post

It's a neat idea. Probably best used on PvP servers.

You could make the gift something small. Perhaps the gift could be a fruit that isn't available in the game, but admins have access to it, like strawberry, orange or banana.

I have died because of crashes before. It would have been nice to have a small token gift, even if it was just a food item.

The only servers that might not be able to offer gifts would be creative servers, since there's not too much that you can give a player that they're not able to give themselves, unless the owners add some desirable blocks that are hidden from creative.
Why wish upon a star when you can pray to the one who created it.

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: [Mod] Restart Gift [restart_gift]

by ChimneySwift » Post

The issue of players exploiting this feature is real, just by restarting in singleplayer with it enabled while I was debugging I collected a not insignificant quantity of mese blocks, which is why I recommend servers set the item to something like a Cookie, where it doesn't really matter if players have access to lots of them easily.

I may investigate (if enough community interest is shown toward this mod) making it so a gift can be given randomly from a list of items.
A spoon is basically a tiny bowl with a stick on it

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Restart Gift [restart_gift]

by Chem871 » Post

Free cookies are nice :P
What is SCP-055?

User avatar
ThomasMonroe
Member
Posts: 286
Joined: Tue Apr 04, 2017 16:21
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared
Location: Wherever I am at

Re: [Mod] Restart Gift [restart_gift]

by ThomasMonroe » Post

COOOOKKKIIIIEEESSSSS
Everyone like cookies!
I don't make messes, I just, er...disturb the local entropy!

User avatar
AccidentallyRhine
Member
Posts: 252
Joined: Sun Aug 02, 2015 05:43

Re: [Mod] Restart Gift [restart_gift]

by AccidentallyRhine » Post

If you configure your server to use this mod, it would be nice to set

ask_reconnect_on_crash = true

and

kick_msg_crash = There was an issue but you may reconnect to receive a free cookie.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Restart Gift [restart_gift]

by Byakuren » Post

There could be a cooldown time so that players are limited to one restart bonus per X hours or something like that.
Every time a mod API is left undocumented, a koala dies.

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: [Mod] Restart Gift [restart_gift]

by ChimneySwift » Post

Byakuren wrote:There could be a cooldown time so that players are limited to one restart bonus per X hours or something like that.
Yeah I'm going to look into doing that, should be doable with a bit of reworking, I'd have to have a separate database to record who has been rewarded or something like that, I'll look into it, LadyK actually mentioned a similar idea to me via PM so I'm glad to hear others agree.

BTW, your signature is amazing
A spoon is basically a tiny bowl with a stick on it

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: [Mod] Restart Gift [restart_gift]

by ManElevation » Post

ah nice mod, does it send them a message too?
My Public Mods! Discord: Rottweiler Games#3368

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: [Mod] Restart Gift [restart_gift]

by ChimneySwift » Post

ManElevation wrote:does it send them a message too?
yep!

"We're sorry you were kicked, have <gift quantity> <gift description> as a thank you gift for coming back :)"

You can modify it on line 50 of init.lua if you wish.
A spoon is basically a tiny bowl with a stick on it

lonestar
Member
Posts: 54
Joined: Mon Jul 17, 2017 03:25
Location: Texas,USA

Re: [Mod] Restart Gift [restart_gift]

by lonestar » Post

This is the type of mods that I like to see, along with your sendstack and temp_priv mods, as they actually give something unique to the game. Nothing wrong with the other mods here, but there are so many variations of the same type of mod or do basically the same thing. Good job and thank you for your contributions.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: [Mod] Restart Gift [restart_gift]

by ManElevation » Post

ChimneySwift wrote:yep!

"We're sorry you were kicked, have <gift quantity> <gift description> as a thank you gift for coming back :)"

You can modify it on line 50 of init.lua if you wish.
sounds great
My Public Mods! Discord: Rottweiler Games#3368

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests