Page 1 of 1

[Mod] Static Spawnpoint [spawnpoint]

PostPosted: Wed Mar 08, 2017 22:50
by octacian
Image

Static Spawnpoint [spawnpoint]

This is a rather simple mod introducing two commands to set a static spawnpoint and to teleport to it. Yes, I know you can set this in minetest.conf, however, doing so causes the spawnpoint to be the same across all of your worlds (very inconvenient). Instead of using minetest.conf, this mod stores the spawnpoint as a string in a file called spawnpoint.conf in the world directory. This allows each and every world to have a different spawnpoint.

The most unique thing about this spawn mod, is that it includes a feature allowing you to set the time between executing the command until the player is actually teleported. By default, the teleportation will be interrupted if the player moves within that time. The time can be configured in minetest.conf with spawnpoint.time (if 0, players will be immediately teleported), and you can disable the feature requiring players to stand still by setting spawnpoint.do_not_move to false (default: true).

Commands

/spawnpoint: Display spawnpoint position if set
/spawn <player>: Teleports you or the player specified to the spawnpoint (requires spawn privilege, and bring privilege to teleport another player)
/setspawn <position>: Sets the spawn to the position specified (in format x, y, z) or to your current location (requires server privilege)

Note: If no spawnpoint is specified and a player attempts to execute /spawn, he/she will be told "No spawnpoint set!"

Configuration

The different "variables" of SpawnPoint can be configured per-world using the /spawnpoint command (requires server privilege). By default, this command displays the spawnpoint, but when providing a setting name as well, the value of the setting is returned (assuming such a setting exists). If a setting name and value is provided, the setting is changed. Valid setting names are listed below.

time: Time before teleportation is completed (if 0 teleportation is immediate)
do_not_move: Whether a player should be required to not move to allow teleportation to be successful

Screenshot was taken at spawn on the awesome HOMETOWN server!

Re: [Mod] Static Spawnpoint [spawnpoint]

PostPosted: Thu Mar 09, 2017 17:18
by azekill_DIABLO
Just perfect

Re: [Mod] Static Spawnpoint [spawnpoint]

PostPosted: Fri Mar 24, 2017 00:29
by octacian
Update!

SpawnPoint has now undergone heavy testing and is stable for use anywhere. You can now configure the mod per-world using the /spawnpoint chatcommand if you have the server privilege (see OP). The do not move function has been improved so that the position is not just checked every second but instead using a global step to update immediately.

Note: The ability to configure SpawnPoint in minetest.conf has been removed for simplicity of code. However, if enough people find this feature important, I will consider adding it back.