Page 1 of 2

How do i change the spawnpoint?

PostPosted: Sun Feb 17, 2013 14:33
by KingSmarty
Hi there,
I'm trying to make a Hungry Games Map to play with my friends and all time you spawn at 0,0,0 what's un the ground. How do i change the spawnpoint?

PostPosted: Sun Feb 17, 2013 14:40
by PilzAdam
Simple mod for that:
Code: Select all
minetest.register_on_respawnplayer(function(player)
    player:setpos({x=0, y=0, z=0})
    return true
end)

Put this in [your_world_name]/worldmods/respawn/init.lua (you can use a different modname if you want to).

PostPosted: Sun Feb 17, 2013 15:05
by KingSmarty
PilzAdam wrote:Simple mod for that:
Code: Select all
minetest.register_on_respawnplayer(function(player)
    player:setpos({x=0, y=0, z=0})
    return true
end)

Put this in [your_world_name]/worldmods/respawn/init.lua (you can use a different modname if you want to).

Does this only Works on respawn or on spawn to? Or Must i use:
minetest.register_on_spawnplayer....

PostPosted: Sun Feb 17, 2013 15:17
by PilzAdam
KingSmarty wrote:
PilzAdam wrote:Simple mod for that:
Code: Select all
minetest.register_on_respawnplayer(function(player)
    player:setpos({x=0, y=0, z=0})
    return true
end)

Put this in [your_world_name]/worldmods/respawn/init.lua (you can use a different modname if you want to).

Does this only Works on respawn or on spawn to? Or Must i use:
minetest.register_on_spawnplayer....

It should work for new players too.

PostPosted: Sun Feb 17, 2013 15:20
by Traxie21
You could use my ServerExtended mod and enable the admin tools module, which contains /setspawn.

PostPosted: Sun Feb 17, 2013 20:10
by jordan4ibanez

PostPosted: Sun Feb 17, 2013 21:11
by KingSmarty
Thx to ALL of u !
I'm currently using Traxies Mod and that is awsome.
@jordan i will try urs too ;)
@PilzAdam what worldmods Folder do you mean?

PostPosted: Mon Feb 18, 2013 07:09
by PilzAdam
KingSmarty wrote:Thx to ALL of u !
I'm currently using Traxies Mod and that is awsome.
@jordan i will try urs too ;)
@PilzAdam what worldmods Folder do you mean?

If a worldmods/ folder is in your world mods from there are loaded too. So you can create worlds wich use some special mods (for adventure maps etc.).

PostPosted: Mon Feb 18, 2013 12:04
by 0gb.us
There's no particular reason to write extra code for this. The built-in scripts have it covered. Just add a setting to your conf file.

static_spawnpoint = 7.5,7.5,7.5

PostPosted: Mon Feb 18, 2013 16:17
by PilzAdam
0gb.us wrote:There's no particular reason to write extra code for this. The built-in scripts have it covered. Just add a setting to your conf file.

static_spawnpoint = 7.5,7.5,7.5

The problem with this is that its in minetest.conf, so not in a per world setting.
My simple script (see above) in worldmods/ would be only for the hungry games map.

PostPosted: Mon Feb 18, 2013 17:25
by KingSmarty
PilzAdam wrote:
0gb.us wrote:There's no particular reason to write extra code for this. The built-in scripts have it covered. Just add a setting to your conf file.

static_spawnpoint = 7.5,7.5,7.5

The problem with this is that its in minetest.conf, so not in a per world setting.
My simple script (see above) in worldmods/ would be only for the hungry games map.

I tired to set the static spawnpoint setting into the config but it didn't work.

PostPosted: Tue Feb 19, 2013 22:39
by 0gb.us
PilzAdam wrote:
0gb.us wrote:There's no particular reason to write extra code for this. The built-in scripts have it covered. Just add a setting to your conf file.

static_spawnpoint = 7.5,7.5,7.5

The problem with this is that its in minetest.conf, so not in a per world setting.
My simple script (see above) in worldmods/ would be only for the hungry games map.


Different worlds have different setups. Why would you not use a separate conf file for each world?

Like conf files, that code could be used in only one world, or in all of them, depending on how you set things up.

KingSmarty wrote:I tired to set the static spawnpoint setting into the config but it didn't work.


Maybe other code is interfering with it (such as the code above). By default though, it should work.

PostPosted: Sun May 26, 2013 03:44
by keyxmakerx
What if we want people to be able to choose a spawn position, but have a static spawn on account creation?

PostPosted: Sun May 26, 2013 06:42
by sfan5
Why doesn't anybody look in minetest.conf.example
Code: Select all
# If this is set, players will always (re)spawn at the given position
#static_spawnpoint = 0, 10, 0

https://github.com/minetest/minetest/blob/master/minetest.conf.example#L233,L234

PostPosted: Sun May 26, 2013 11:09
by Evergreen
sfan5 wrote:Why doesn't anybody look in minetest.conf.example
Code: Select all
# If this is set, players will always (re)spawn at the given position
#static_spawnpoint = 0, 10, 0

https://github.com/minetest/minetest/blob/master/minetest.conf.example#L233,L234

I do. I wouldn't know how to do half the stuff with it that I do now if there wasn't the conf example. :P

PostPosted: Mon May 27, 2013 17:39
by keyxmakerx
sfan5 wrote:Why doesn't anybody look in minetest.conf.example
Code: Select all
# If this is set, players will always (re)spawn at the given position
#static_spawnpoint = 0, 10, 0

https://github.com/minetest/minetest/blob/master/minetest.conf.example#L233,L234

No, I want people to choose their own location.

PostPosted: Mon May 27, 2013 21:36
by shaneroach
sfan5 wrote:Why doesn't anybody look in minetest.conf.example
Code: Select all
# If this is set, players will always (re)spawn at the given position
#static_spawnpoint = 0, 10, 0

https://github.com/minetest/minetest/blob/master/minetest.conf.example#L233,L234


Depending on someone's technical experience, conf files can be fairly difficult to decipher. Even just getting past the wall of spam they present can be intimidating for new users who are not experienced with such things.

PostPosted: Wed May 29, 2013 11:19
by keyxmakerx
sfan5 wrote:Why doesn't anybody look in minetest.conf.example
Code: Select all
# If this is set, players will always (re)spawn at the given position
#static_spawnpoint = 0, 10, 0

https://github.com/minetest/minetest/blob/master/minetest.conf.example#L233,L234


Also I can not find this mine test.conf.example I'm using Linux. Where is it present?

PostPosted: Wed May 29, 2013 11:42
by Jordach
In the base dir of a run in place build, like the windows builds.

If you used apt-get, or similar, then it doesnt exist.

PostPosted: Wed May 29, 2013 11:56
by Evergreen
keyxmakerx wrote:
sfan5 wrote:Why doesn't anybody look in minetest.conf.example
Code: Select all
# If this is set, players will always (re)spawn at the given position
#static_spawnpoint = 0, 10, 0

https://github.com/minetest/minetest/blob/master/minetest.conf.example#L233,L234


Also I can not find this mine test.conf.example I'm using Linux. Where is it present?

You won't be able to find it unless you compiled it from github.

PostPosted: Wed May 29, 2013 14:51
by Topywo
Link to the Github minetest.conf.example. You can use copy/paste (to minetest.conf). To get a line working remove the #.

https://github.com/minetest/minetest/blob/master/minetest.conf.example

PostPosted: Wed Jun 05, 2013 23:05
by keyxmakerx
Ok that's kewl, but what about if I want people to be able to set their own locations?

PostPosted: Thu Jun 06, 2013 04:52
by tinoesroho
... Install the beds, and then they can set it by sleeping in one. Or the bookmarks mod- just use that search function up at the top.

PostPosted: Thu Jun 06, 2013 08:32
by Topywo
This is a link to the sethome mod:

http://forum.minetest.net/viewtopic.php?id=741

When the search function generates too much results, you can use the advanced search and limit the search to only released mods and general modding.

PostPosted: Mon Jun 10, 2013 07:20
by keyxmakerx
Topywo wrote:This is a link to the sethome mod:

http://forum.minetest.net/viewtopic.php?id=741

When the search function generates too much results, you can use the advanced search and limit the search to only released mods and general modding.


I know, but this mod isn't a spawn point, and the beds mod didn't work for me.