mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-08 20:12:11 +00:00
Lots of updates
- Map-specific pre-match times - Remove /load and change /start syntax to /start <map> - Scripts for each map that are run at start time, barrier removal time, and end time - New map forest-3 - A few minor bugfixes
This commit is contained in:
parent
acfeef6d01
commit
2be8eea781
10 changed files with 87 additions and 27 deletions
|
|
@ -40,7 +40,15 @@ local map_data = {
|
|||
|
||||
spawn_x = nil,
|
||||
spawn_y = nil,
|
||||
spawn_z = nil
|
||||
spawn_z = nil,
|
||||
|
||||
start_time = (Amount of time in seconds before the barrier is removed)
|
||||
|
||||
scripts = {
|
||||
on_start = "(Lua script to be run after /start is run, leave blank unless you know what you are doing!)",
|
||||
on_barrier_remove = "(Lua script to be run after the barrier is removed, leave blank unless you know what you are doing!)",
|
||||
on_end = "(Lua script to be run after the match has ended, leave blank unless you know what you are doing!)"
|
||||
}
|
||||
}
|
||||
|
||||
return map_data
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ function place_map(map)
|
|||
map_data.spawn_z = map_data.size_z / 2
|
||||
end
|
||||
|
||||
if map_data.start_time == nil or map_data.start_time <= 0 then
|
||||
map_data.start_time = 30
|
||||
end
|
||||
|
||||
return map_data
|
||||
end
|
||||
|
||||
|
|
@ -21,6 +25,7 @@ function remove_barrier(x, y, z)
|
|||
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
|
||||
end
|
||||
assert(loadstring(map_data.scripts.on_barrier_remove or ""))()
|
||||
return ""
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,15 @@ local map_data = {
|
|||
|
||||
spawn_x = nil,
|
||||
spawn_y = nil,
|
||||
spawn_z = nil
|
||||
spawn_z = nil,
|
||||
|
||||
start_time = 45,
|
||||
|
||||
scripts = {
|
||||
on_start = "",
|
||||
on_barrier_remove = "",
|
||||
on_end = ""
|
||||
}
|
||||
}
|
||||
|
||||
return map_data
|
||||
|
|
|
|||
22
mods/game/maps/maps/forest-3/map.lua
Normal file
22
mods/game/maps/maps/forest-3/map.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local map_data = {
|
||||
name = "forest-3",
|
||||
size_x = 537,
|
||||
size_y = 142,
|
||||
size_z = 244,
|
||||
|
||||
barrier_level = 138, -- <- Y level of the barrier
|
||||
|
||||
spawn_x = nil,
|
||||
spawn_y = nil,
|
||||
spawn_z = nil,
|
||||
|
||||
start_time = 60,
|
||||
|
||||
scripts = {
|
||||
on_start = "",
|
||||
on_barrier_remove = "",
|
||||
on_end = ""
|
||||
}
|
||||
}
|
||||
|
||||
return map_data
|
||||
BIN
mods/game/maps/maps/forest-3/map.mts
Normal file
BIN
mods/game/maps/maps/forest-3/map.mts
Normal file
Binary file not shown.
|
|
@ -8,7 +8,15 @@ local map_data = {
|
|||
|
||||
spawn_x = nil,
|
||||
spawn_y = nil,
|
||||
spawn_z = nil
|
||||
spawn_z = nil,
|
||||
|
||||
start_time = 30,
|
||||
|
||||
scripts = {
|
||||
on_start = "",
|
||||
on_barrier_remove = "",
|
||||
on_end = ""
|
||||
}
|
||||
}
|
||||
|
||||
return map_data
|
||||
|
|
|
|||
|
|
@ -8,7 +8,15 @@ local map_data = {
|
|||
|
||||
spawn_x = nil,
|
||||
spawn_y = nil,
|
||||
spawn_z = nil
|
||||
spawn_z = nil,
|
||||
|
||||
start_time = 30,
|
||||
|
||||
scripts = {
|
||||
on_start = "",
|
||||
on_barrier_remove = "",
|
||||
on_end = ""
|
||||
}
|
||||
}
|
||||
|
||||
return map_data
|
||||
|
|
|
|||
|
|
@ -8,7 +8,15 @@ local map_data = {
|
|||
|
||||
spawn_x = nil,
|
||||
spawn_y = nil,
|
||||
spawn_z = nil
|
||||
spawn_z = nil,
|
||||
|
||||
start_time = 45,
|
||||
|
||||
scripts = {
|
||||
on_start = "",
|
||||
on_barrier_remove = "",
|
||||
on_end = ""
|
||||
}
|
||||
}
|
||||
|
||||
return map_data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue