ComfyFactory / ComfyFactorio

A compilation of factorio scenarios, featuring many different maps.
GNU General Public License v3.0
51 stars 54 forks source link

add suicide command (for Towny) #337

Closed fuchsnj closed 2 years ago

fuchsnj commented 2 years ago

This adds a /suicide command to Towny. This is useful since it's possible to trap players to the point where it's virtually impossible to play the game, such as the following example:

image

Gerkiz commented 2 years ago

Hi and thank you for your PR.

I would like to see some cooldown or max allowance. Since as of now - this is abusable.

Example: Player runs the command. A cooldown is set for the given player so they cannot run it for say a couple of hours?

blubFisch commented 2 years ago

Good feature, but yes some sort of anti-abuse will be needed. I was thinking, once someone runs the command, we put a 10min timer together with a game.print before the .die() is called.

Trapping outlanders in Towny is quite fun and acts as a "prison" mechanic for "naked" outlanders that run around sabotaging your installations. So I want to leave it possible for the other side too.

fuchsnj commented 2 years ago

Trapping outlanders in Towny is quite fun and acts as a "prison" mechanic for "naked" outlanders that run around sabotaging your installations.

I agree it's fun for a few minutes, until you realize you can't play the game at all. A 10 minute timer seems reasonable, I'll look into adding that soon.

fuchsnj commented 2 years ago

@blubFisch A 10 minute (+- 30 secs) timer was added between when you call the /suicide command, and when you actually die. The player gets a countdown every minute.

blubFisch commented 2 years ago

Yeah generally looks good to me, thanks!

A cleaner and more lightweight variant would be to use a tick scheduler (which is only active when needed, unlike the main schedules in main.lua), there are some examples in the rest of the code (search for schedule, tick, timer, event or something).

blubFisch commented 2 years ago

Awesome, looks good to merge to me!

blubFisch commented 2 years ago

Ah, please add a line in info.lua about this.

blubFisch commented 2 years ago

@Gerkiz I'm happy for this to be merged as is