mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-09 04:16:30 +00:00
Dehardcode map
* Dehardcode maps (currently not working) maps need work and proper configs * Fix bugs i'm terrible at lua * Add proper maps and configs * Fix some bugs the game at least loads now, though it crashes when you run /start <a map> * Fix more bugs The map starts now though you don't get teleported to it. * Teleport the player to the map spawn on start * Fix lots of bugs It mostly works now * Add butterflies mod * Another bugfix * Add fireflies mod * Add vessels mod (dependency for fireflies) * Add a sprint mod * Add a spawnpoint no more falling into the void * Update TODO.txt * Fix the barriers being offset by 2 Also add more dependency mods
This commit is contained in:
parent
319422974a
commit
2259be43a2
306 changed files with 9142 additions and 31 deletions
25
mods/maps/init.lua
Normal file
25
mods/maps/init.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
function place_map(map)
|
||||
local map_path = core.get_modpath("maps") .. "/maps/"
|
||||
local map_data = dofile(map_path .. map .. "/map.lua")
|
||||
local barrier_nodes = {}
|
||||
|
||||
|
||||
core.place_schematic({x=0, y=0, z=0}, map_path .. map .. "/map.mts", 0, nil, true)
|
||||
|
||||
if map_data.spawn_x == nil or map_data.spawn_y == nil or map_data.spawn_z == nil then -- set a default spawnpoint if not set
|
||||
map_data.spawn_x = map_data.size_x / 2
|
||||
map_data.spawn_y = map_data.barrier_level + 1
|
||||
map_data.spawn_z = map_data.size_z / 2
|
||||
end
|
||||
|
||||
return map_data
|
||||
end
|
||||
|
||||
function remove_barrier(x, y, z)
|
||||
for node_x = 1, x - 2 do
|
||||
for node_z = 1, z - 2 do
|
||||
core.set_node({x = node_x, y = y - 1, z = node_z}, {name = "air"}) -- account for the fact that lua counts starting at 1... i think.... whatever, it works \_('_')_/
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue