[Mod] Static Spawnpoint [spawnpoint]

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

[Mod] Static Spawnpoint [spawnpoint]

by octacian » Post

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)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by azekill_DIABLO » Post

Just perfect
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Post

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)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Mod] Static Spawnpoint [spawnpoint]

by mnh48 » Post

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

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by harmony » Post

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

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Post

Update!
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Post

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)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by Wuzzy » Post

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.

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Post

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)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Static Spawnpoint [spawnpoint]

by Lone_Wolf » Post

Great mod!
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

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

Re: [Mod] Static Spawnpoint [spawnpoint]

by Stix » Post

Lone_Wolf wrote:Great mod!
agreed, +1
Hey, what can i say? I'm the bad guy.

R-One
Member
Posts: 160
Joined: Wed Dec 20, 2017 23:06
Location: Nice, France

Re: [Mod] Static Spawnpoint [spawnpoint]

by R-One » Post

hi, the setspawn command makes an error under minetest 0.4.17.1
Spoiler
2018-07-05 12:30:09: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'spawnpoint' in callback on_chat_message(): ...\minetest-0.4.17.1-win64\bin\..\mods\spawnpoint\init.lua:120: bad argument #2 to 'set_float' (number expected, got nil)
2018-07-05 12:30:09: ERROR[Main]: stack traceback:
2018-07-05 12:30:09: ERROR[Main]: [C]: in function 'set_float'
2018-07-05 12:30:09: ERROR[Main]: ...\minetest-0.4.17.1-win64\bin\..\mods\spawnpoint\init.lua:120: in function 'save'
2018-07-05 12:30:09: ERROR[Main]: ...\minetest-0.4.17.1-win64\bin\..\mods\spawnpoint\init.lua:149: in function 'set'
2018-07-05 12:30:09: ERROR[Main]: ...\minetest-0.4.17.1-win64\bin\..\mods\spawnpoint\init.lua:270: in function 'func'
2018-07-05 12:30:09: ERROR[Main]: ...test-0.4.17.1-win64\bin\..\builtin\game\chatcommands.lua:30: in function <...test-0.4.17.1-win64\bin\..\builtin\game\chatcommands.lua:9>
2018-07-05 12:30:09: ERROR[Main]: ...minetest-0.4.17.1-win64\bin\..\builtin\game\register.lua:420: in function <...minetest-0.4.17.1-win64\bin\..\builtin\game\register.lua:400>
- 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: 597
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian
Location: Canada

Re: [Mod] Static Spawnpoint [spawnpoint]

by octacian » Post

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)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Static Spawnpoint [spawnpoint]

by Lone_Wolf » Post

I also had this error
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Static Spawnpoint [spawnpoint]

by Miniontoby » Post

I have the solution.
When you replace all "storage" to "mod_storage" the mod should work
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Static Spawnpoint [spawnpoint]

by Lone_Wolf » Post

Miniontoby wrote:I have the solution.
When you replace all "storage" to "mod_storage" the mod should work
Or just update the mod and get the fix that was merged
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Static Spawnpoint [spawnpoint]

by Miniontoby » Post

How to use this mod for a "spawn" spawnpoint (so that it is that when you join the first time (or be killed) you spawn at the spawnpoint that I have set in the "spawnpoint.conf")
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

Baaaz
New member
Posts: 5
Joined: Thu Oct 29, 2020 13:50
In-game: Baaaz

Re: [Mod] Static Spawnpoint [spawnpoint]

by Baaaz » Post

Hello here what happened when launching a map with that mod :
"
ModError : Error loading mod "spawnpoint-master". Mod name does not follow naming conventions. Only characters [a-z0-9_] are allowed. Check debug.txt for details.
"

Seems like the name of the mode is ok... And I can't find any "debug.txt"

Thanks

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Static Spawnpoint [spawnpoint]

by Lone_Wolf » Post

@Baaaz rename the mod folder to `spawnpoint`. This mod was made for an older Minetest version so it may not work anyway though, not sure
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests