Add spawner to Dungeons

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Add spawner to Dungeons

by burli » Mon Apr 11, 2016 12:10

I want to add spawner to dungeons. How can I get the dungeon type (mossy cobble, desert sandstone...) and place a spawner into a room?
 

User avatar
cd2
Member
 
Posts: 552
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
IRC: freenode - cd2 InchraNet - cd
In-game: cd cd2

Re: Add spawner to Dungeons

by cd2 » Mon Apr 11, 2016 14:52

Something like this should work (replace function name with the function that places a spawner):

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.set_gen_notify("dungeon")

minetest.register_on_generated(function(minp, maxp, blockseed)
   local g = minetest.get_mapgen_object("gennotify")
   if g and g.dungeon and #g.dungeon > 2 then
      minetest.after(3, <function name>, table.copy(g.dungeon))
   end
end)


I would use minetest.get_node to check the dungeon type
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

Re: Add spawner to Dungeons

by BrandonReese » Tue Apr 12, 2016 02:05

Dungeons are mossy cobble, temples are dessert stone

minetest.set_gen_notify("dungeon","temple")
 

User avatar
xeranas
Member
 
Posts: 99
Joined: Fri Feb 05, 2016 11:06
GitHub: xeranas

Re: Add spawner to Dungeons

by xeranas » Wed May 18, 2016 09:27

Try spawners mod (auto-spawning needs to be enabled through mod settings.txt).
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron