MOD : spawncorrection (Avoid spawning under earth)

rate spawncorrection mod:

★★★★★
0
No votes
★★★★
0
No votes
★★★
0
No votes
★★
0
No votes
0
No votes
 
Total votes : 0

User avatar
KGM
Member
 
Posts: 45
Joined: Mon Nov 14, 2016 19:57

MOD : spawncorrection (Avoid spawning under earth)

by KGM » Wed Nov 16, 2016 18:31

It is nasty to spawn into stone when accessing a new world
so I made this mod to avoid the player
spawning and respawning under earth.
To install the mod, just unzip it and
paste it into the /mods directory of
the concerning subgame.
PS: If you have downloaded it before the 25.12.2016, you shall replace it by the newest version,because the last releases all had some bugs for example porting up 3D ladders at spawn point(oldest one) or porting up when jumping in a 2 blocks heigh room at spawn point(one of the newer ones) and,very important:
IF YOU FIND A BUG IN THE ACTUAL RELEASE,PLEASE TELL ME
Attachments
spawncorrection.zip
(1.42 KiB) Downloaded 65 times
Last edited by KGM on Tue Jan 31, 2017 16:46, edited 6 times in total.
my Mods:https://forum.minetest.net/viewtopic.php?f=17&t=16705

Note: I try to avoid dependencies in my Mods:
To install a mod, just unzip it and
paste it into the /mods directory of
the concerning subgame.
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: MOD : spawncorrection (Avoid spawning under earth)

by DS-minetest » Thu Nov 17, 2016 15:48

i never spawned in stone
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
KGM
Member
 
Posts: 45
Joined: Mon Nov 14, 2016 19:57

Re: MOD : spawncorrection (Avoid spawning under earth)

by KGM » Thu Nov 17, 2016 17:40

Spiel doch mal z.b. den Lord Of The Test Master mit 1 als seed.
my Mods:https://forum.minetest.net/viewtopic.php?f=17&t=16705

Note: I try to avoid dependencies in my Mods:
To install a mod, just unzip it and
paste it into the /mods directory of
the concerning subgame.
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: MOD : spawncorrection (Avoid spawning under earth)

by DS-minetest » Thu Nov 17, 2016 17:49

ah, i think i know now, what you mean
some mods generate above the normal generation level to get a nice mapgen
but the players spawn on normal hight
ok, then this mod could be useful
ps.: das -master kommt von github, weil es vom master branch stammt, das gehört jedoch nicht zum namen => es heißt einfach nur lord of the test, oder kurz lott
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
KGM
Member
 
Posts: 45
Joined: Mon Nov 14, 2016 19:57

Re: MOD : spawncorrection (Avoid spawning under earth)

by KGM » Thu Nov 17, 2016 18:14

Danke für diese Informationen.
Es ist immer nett, etwas neues zu lernen.
my Mods:https://forum.minetest.net/viewtopic.php?f=17&t=16705

Note: I try to avoid dependencies in my Mods:
To install a mod, just unzip it and
paste it into the /mods directory of
the concerning subgame.
 

User avatar
cx384
Member
 
Posts: 249
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: MOD : spawncorrection (Avoid spawning under earth)

by cx384 » Thu Nov 17, 2016 18:39

Why do you talk German on an international topic?
Can your read this?
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: MOD : spawncorrection (Avoid spawning under earth)

by DS-minetest » Thu Nov 17, 2016 18:39

KGM started, i did only the ps german
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
KGM
Member
 
Posts: 45
Joined: Mon Nov 14, 2016 19:57

Re: MOD : spawncorrection (Avoid spawning under earth)

by KGM » Mon Dec 19, 2016 19:23

I found out that my mod bugs when trying to go down ladders at the spawn point so I fixed the zip
my Mods:https://forum.minetest.net/viewtopic.php?f=17&t=16705

Note: I try to avoid dependencies in my Mods:
To install a mod, just unzip it and
paste it into the /mods directory of
the concerning subgame.
 

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

Re: MOD : spawncorrection (Avoid spawning under earth)

by Wuzzy » Mon Dec 19, 2016 21:19

Can you please post an issue on the Minetest issue tracker on GitHub?
Spawning in stone/dirt is one of the oldest problems in Minetest, and if you could suggest a bugfix, it will help a lot.

Doing this in a mod is the wrong way IMO. A good spawning algorithm is very essential, so it should be available in the engine.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
KGM
Member
 
Posts: 45
Joined: Mon Nov 14, 2016 19:57

Re: MOD : spawncorrection (Avoid spawning under earth)

by KGM » Wed Dec 21, 2016 16:38

sorry,but I don't have an github account
by the way,here is how it works
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Minetest mod: spawncorrection
-- See README.txt for licensing and other information.
function spawn_over(player)
   pos = player:getpos()
   walkable = true
   while walkable do
--node the player stands in
      node0 = minetest.get_node(pos)
      pos.y = pos.y+0.8
--"headnode"
      node1 = minetest.get_node(pos)
      pos.y = pos.y-0.8
--this part checks if the nodes the player is in are solid
      if (minetest.registered_nodes[node1.name].walkable or
      minetest.registered_nodes[node0.name].walkable) and
--this part checks if the node is not some little solid node like a ladder that can be passed by checking if light
--passes them (such nodes are usually passable by sunlight)
      (minetest.registered_nodes[node1.name].sunlight_propagates == false or
      minetest.registered_nodes[node0.name].sunlight_propagates == false or
      minetest.registered_nodes[node1.name].sunlight_propagates == nil or
      minetest.registered_nodes[node0.name].sunlight_propagates == nil) then
--the player couldn't move freely at this location,the location checked next is one higher
         pos.y = pos.y+1
      else
--if the player could move freely at this location,the location is good to port the player to it,so the while-loop gets stopped
         walkable = false
      end
--port the player to it
   player:setpos(pos)
   end
end
function spawn_over_after(player,time)
   minetest.after(time,spawn_over,player)
end
minetest.register_globalstep(function(dtime)
   for _,player in ipairs(minetest.get_connected_players()) do
      pos = player:getpos()
      node0 = minetest.get_node(pos)
      pos.y = pos.y+0.8
      node1 = minetest.get_node(pos)
      pos.y = pos.y-0.8
--this part checks if the nodes the player is in are solid
      if (minetest.registered_nodes[node1.name].walkable or
      minetest.registered_nodes[node0.name].walkable) and
--this part checks if the player is at spawn location(if any unfixed problems are there,they just occur at spawn location)
      pos.x > 59.2 and
      pos.x < 60.8 and
      pos.z > -0.8 and
      pos.z < 0.8 then 
         spawn_over(player)
      end
   end
end)
my Mods:https://forum.minetest.net/viewtopic.php?f=17&t=16705

Note: I try to avoid dependencies in my Mods:
To install a mod, just unzip it and
paste it into the /mods directory of
the concerning subgame.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 8 guests

cron