Page 1 of 1

[Mod] Server Start Location [1.2] [startlocation]

PostPosted: Tue Jan 13, 2015 07:34
by YoukaiCountry
This is a simple mod to add a server-wide start location. When a new player enters, or when a player dies they respawn at the start location.
Furthermore, there are commands to teleport all online and/or offline players to the start location.

Code License: GPLv2
No textures.
Mod dependencies: none

From the readme:
Code: Select all
Server Start Location
--------------

This simple mod adds a start position that all new players start at
automatically, and players warp to on death.

Use
---

It adds a new privilege, startlocation. With this privilege, you have access
to the following new commands:

/setstart - sets the start location to wherever the invoking user is standing.

/gotostart - teleport to the start location.

/allongotostart - teleport all players online to the start location.

/alloffgotostart - teleport all players offline to the start location.

/allgotostart - teleport all players offline or online to the start location.

In addition, if there is a valid start location then all NEW players will
begin life at the start location.
Also, players will begin at the start location upon respawning.

By: Nathaniel Caldwell
www.youkaicountry.com


Download:
https://github.com/nbcwell/startlocation/zipball/master

Github:
https://github.com/nbcwell/startlocation

Re: [Mod] Server Start Location [1.1] [startlocation]

PostPosted: Tue Jan 13, 2015 18:38
by Krock
There are already some spawn mods but it's a simple thing to start with - Well done :)
I hope my pull request is welcome, I rewrote some parts of the codes.

Re: [Mod] Server Start Location [1.1] [startlocation]

PostPosted: Tue Jan 13, 2015 18:52
by TG-MyinaWD
Hmm. Maybe make this stand out form all the others is to do a, force all players goto the Start location. That is if Minetest Lua API has a such demand. that if wasn't thought of and add to other mods.
But I think spawn mods somewhat a good start to show some skills. Hope some cool mods.

Re: [Mod] Server Start Location [1.1] [startlocation]

PostPosted: Tue Jan 13, 2015 19:22
by YoukaiCountry
Krock wrote:There are already some spawn mods but it's a simple thing to start with - Well done :)
I hope my pull request is welcome, I rewrote some parts of the codes.


Thanks, I'm still learning the ropes. I have coding experience, but Lua is a new language to me, and so is the Minetest API!
Pull requests are absolutely welcome. I'll check it out later tonight!

Alt. Tester wrote:Hmm. Maybe make this stand out form all the others is to do a, force all players goto the Start location. That is if Minetest Lua API has a such demand. that if wasn't thought of and add to other mods.
But I think spawn mods somewhat a good start to show some skills. Hope some cool mods.


That's a good idea. I'm pretty sure it can be done. Do you mean for all logged in players, or even logged out ones? The second is trickier, but I think I know how I could do it.

Re: [Mod] Server Start Location [1.1] [startlocation]

PostPosted: Tue Jan 13, 2015 19:27
by TG-MyinaWD
Well I was thinking the first since be useful on a Hunger Games map. But if think can do both I would like see it in action.
But it should be maybe the command "/allongotostart" and "/alloffgotostart".

Off for Offline Players and On foe Online.
And keep the modding going.

Re: [Mod] Server Start Location [1.1] [startlocation]

PostPosted: Tue Jan 13, 2015 20:48
by YoukaiCountry
Just browsed the pull, looks good to me. I'm not always the cleanest coder, so I very much appreciate the help! I'll merge it when I get to my dev machine.
Also thanks for getting the initialized field out of the position table. I'm having my Minecraft -> Minetest converter parse the serialized lua table, and that makes it much simpler!

Alt. Tester wrote:Well I was thinking the first since be useful on a Hunger Games map. But if think can do both I would like see it in action.
But it should be maybe the command "/allongotostart" and "/alloffgotostart".

Off for Offline Players and On foe Online.
And keep the modding going.


And /allgotostart for everyone offline and online.

It is a server-wide spawn point, so it will be pandemonium when everyone online ends up in the same exact space, but I could definitely see how it would be helpful to get everyone wrangled together for a Hunger games server!

Re: [Mod] Server Start Location [1.2] [startlocation]

PostPosted: Wed Jan 14, 2015 07:46
by YoukaiCountry
I added /allongotostart, /alloffgotostart, and /allgotostart. Tested them a bit, and they seem to work just fine.
To teleport offline characters, I just keep a list of players that do NOT need teleported (the online players), and reference it / teleport as needed when players join the server.

Re: [Mod] Server Start Location [1.2] [startlocation]

PostPosted: Thu Jan 22, 2015 07:02
by YoukaiCountry
Fixed an issue with the latest version that prevented setting the start location.

Re: [Mod] Server Start Location [1.2] [startlocation]

PostPosted: Fri Jan 23, 2015 14:15
by superschizo
I just tried it out on my Candlestick Park world. It is quick and easy, just what I wanted. Thank you.

Re: [Mod] Server Start Location [1.2] [startlocation]

PostPosted: Fri Jan 23, 2015 21:56
by YoukaiCountry
Simplicity was the goal :)
Glad it was of use!

Re: [Mod] Server Start Location [1.2] [startlocation]

PostPosted: Fri Jan 23, 2015 23:43
by clymancer
Awesome! Good job!