[Mod] Static Spawnpoint [spawnpoint]

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

[Mod] Static Spawnpoint [spawnpoint]

by octacian » Wed Mar 08, 2017 22:50

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!
Last edited by octacian on Fri Mar 24, 2017 00:29, edited 3 times in total.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Static Spawnpoint [spawnpoint]

by azekill_DIABLO » Thu Mar 09, 2017 17:18

Just perfect
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Fri Mar 24, 2017 00:29

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 45 guests

cron