Make spawn coordinates always the same?

Post Reply
cypher-neo
Member
Posts: 46
Joined: Wed Oct 17, 2012 12:15

Make spawn coordinates always the same?

by cypher-neo » Post

Here's the issue: Everytime i play, I eventually get the Update Listener: Invalid Value bug.
The only way to play then is to close and reopen the game and teleport back to the map. I like 0, 0, 0 because it's easy to remember.

The problem is: whenever I start a new game, I spawn into the new map randomly.
Is there a way to set the spawn location to 0, (surface), 0 so that I don't have to teleport to 0, 0, 0 at the beginning of every game?

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

Yeah. I think there's a static_spawn setting in minetest.conf you can set- see minetest.conf.example. The alternative is this thread's tweak to /builtin/chatcommands.lua. Take your pick- and remember to open lua files with Wordpad!
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

cypher-neo
Member
Posts: 46
Joined: Wed Oct 17, 2012 12:15

by cypher-neo » Post

tinoesroho wrote:Yeah. I think there's a static_spawn setting in minetest.conf you can set- see minetest.conf.example. The alternative is this thread's tweak to /builtin/chatcommands.lua. Take your pick- and remember to open lua files with Wordpad!
I found a static_spawn.lua in /usr/share/minetest/builtin but there doesn't seem to be an option to enable it in the game. All that minetest.conf seems to have is the settings already available in the game.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Create a folder called worldmods inside the world you want to set spawn, then create a folder called "spawn" inside the worldmods folder. Go into the folder you just created, and make a file called "init.lua" and put this code in the file. Code:

Code: Select all

minetest.register_on_respawnplayer(function(player)
    player:setpos({x=0.0, y=(surface coordinate), z=0.0})
    return true
end)
Hope it helped.
Last edited by Evergreen on Fri May 31, 2013 17:45, edited 1 time in total.
Back from the dead!

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

Okay but now I want the player to appear in coordinated when you start the game in such a world.
How would that be?
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

Code: Select all

minetest.register_on_respawnplayer(function(player)
    player:setpos({x=0.0, y=(surface coordinate), z=0.0})
    return true
end)

minetest.register_on_newplayer(function(player)
    player:setpos({x=0.0, y=(surface coordinate), z=0.0})
    return true
end)
Last edited by tinoesroho on Sun Jun 02, 2013 04:11, edited 1 time in total.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 30 guests