[Mod] Static Spawnpoint [spawnpoint]

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
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 (and other settings) within the world directory itself. This allows each and every world to have a different spawnpoint and configuration.

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. You can also enable a setting which causes the teleportation to be interrupted if the player moves within the original time.

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). This command displays the spawnpoint if no parameters are provided, but when a setting name is provided, 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
pos: Position in the format (<x>,<y>,<z>) - can only be set via /setspawn or manually in configuration files

This per-world configuration (including the spawn position itself) is stored in the world directory. If Minetest 0.4.16's new modstorage is available, SpawnPoint will use that to store configuration. Otherwise, configuration will be handled by the Minetest Settings API and placed in a spawnpoint.conf file. If you would like to configure SpawnPoint manually, create a spawnpoint.conf file in the world directory and assign values to the applicable settings as documented above, each setting on a new line in the format setting_name = setting_value.

Initially, SpawnPoint stored all settings in a multi-line spawnpoint.conf file, however, this made very little sense as setting weren't named. With the new configuration scheme as documented above, compatibility code has been implemented causing all the old settings to be imported into the newest format possible. When the formatted settings method is used with spawnpoint.conf, all configuration is automatically imported to Minetest modstorage as well when it becomes available. After importing takes place from spawnpoint.conf, the file is removed.

Screenshot was taken at spawn on the awesome HOMETOWN server!
Last edited by octacian on Sun Jul 02, 2017 19:17, edited 4 times in total.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

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

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
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.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
muhdnurhidayat
Member
 
Posts: 292
Joined: Wed Nov 16, 2016 22:55
Location: Shah Alam, Selangor, Malaysia
GitHub: MuhdNurHidayat
IRC: muhdnurhidayat
In-game: muhdnurhidayat

Re: [Mod] Static Spawnpoint [spawnpoint]

by muhdnurhidayat » Tue Jun 06, 2017 13:00

That header image... seems familiar... :3
[ Full signature ] - UTC+8 here, contributing to Minetest Wiki. I'm muhdnurhidayat in IFS (mod), HOMETOWN & others. / Twitter / MT Offtopic ✂️- - - - - -

You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD
 

User avatar
harmony
Member
 
Posts: 410
Joined: Tue Jun 20, 2017 22:16
Location: 고향 ^-^
IRC: ynomrah
In-game: ynomrah

Re: [Mod] Static Spawnpoint [spawnpoint]

by harmony » Thu Jun 22, 2017 17:58

muhdnurhidayat wrote:That header image... seems familiar... :3

It's for Hometown :D
저는 방탄소년단 를 사랑해요!!! 아미!! 김남준,김석진,민윤기,정호석,박지민,김태형,전정국,방탄소년단!
저는 블랙핑크 를 사랑해요!!! 블링크!! 김지수,김제니,박채영,리사(ปราณ ปริ ยา มโน บาล)
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Sun Jul 02, 2017 19:20

Update!

  • New save formats now supported (Key-value settings and Minetest 0.4.16's modstorage)
  • Compatibility to import old settings formats to new formats as they become available
  • General cleanup of code style
  • Use built-in vector functions to process positions

See the original post for in-depth information.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
Wuzzy
Member
 
Posts: 3242
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Static Spawnpoint [spawnpoint]

by Wuzzy » Sun Jul 02, 2017 20:41

Why not fixing this right in the engine? This seems like an engine bug to me.
I think many more settings need to become mapgen settings and saved with the map. static_spawn_point is one of them.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Sun Jul 02, 2017 20:57

Wuzzy wrote:Why not fixing this right in the engine? This seems like an engine bug to me.
I think many more settings need to become mapgen settings and saved with the map. static_spawn_point is one of them.


I hadn't considered that. Definitely not a bug, could be a good feature request though. I'll open an issue or PR soon. Maybe a static_spawn_point setting in world.mt. Could even expand to allow easily setting a per-player spawnpoint with something like "player:set_spawn". This would eliminate the need to check for mods such as beds on_respawnplayer, etc...

Whatever happens, some features of this mod like time and do_not_move would have to stay in a mod most likely. I expect that /spawn and /setspawn would be implemented in the engine at the same time if static spawnpoints were improves.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
Lone_Wolf
Member
 
Posts: 1980
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

User avatar
Stix
Member
 
Posts: 1295
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

Re: [Mod] Static Spawnpoint [spawnpoint]

by Stix » Sun Aug 06, 2017 15:03

Lone_Wolf wrote:Great mod!

agreed, +1
Hey, what can i say? I'm the bad guy.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

R-One
Member
 
Posts: 73
Joined: Wed Dec 20, 2017 23:06

Re: [Mod] Static Spawnpoint [spawnpoint]

by R-One » Thu Jul 05, 2018 10:33

hi, the setspawn command makes an error under minetest 0.4.17.1

+ Log of error here


- EDIT :

ok i managed to run the mod under 0.4.17.1, for that i created the spawnpoint.conf file in the world folder.

I restarted the game, and obviously the mod has created the mod_storage folder and deleted the spawnpoint.conf file since everything works.

A possible issue to investigate for new installations.
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Thu Jul 05, 2018 15:03

Thanks for bringing my attention to this!

I won't be able to take a look for a few weeks - I'm really busy with some things. As soon as I have time though, I'll try to take a look. In the meantime, it's good to hear you were able to get it working.

Just FYI, the fix should actually be quite simple. A few lines at most. I may even be able to do it right away, with that in mind.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
Lone_Wolf
Member
 
Posts: 1980
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 


Return to WIP Mods



Who is online

Users browsing this forum: Bing [Bot] and 3 guests