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:
a-bad-dev 2025-12-09 03:17:00 -04:00 committed by GitHub
commit 2259be43a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
306 changed files with 9142 additions and 31 deletions

View file

@ -124,9 +124,9 @@ core.register_on_mods_loaded(function()
end
end)
core.register_on_joinplayer(function(player)
core.place_schematic({x = 0, y = 0, z = 0}, core.get_modpath("main") .. "/schematics/map1.mts", 0, nil, false)
player:set_pos({x = 20, y = 26.5, z = 17})
core.register_on_joinplayer(function(player)
core.place_schematic({x=0, y=-10, z=0}, core.get_modpath("main") .. "/schems/spawn.mts", 0, nil, true)
player:set_pos({x=5, y=-9.6, z=8})
player:get_inventory():set_list("main", {})
local player_name = player:get_player_name()
@ -157,7 +157,7 @@ core.register_on_respawnplayer(function(player)
local player_name = player:get_player_name()
player:set_pos({x = 20, y = 26.5, z = 17})
player:set_pos({x = map_data.spawn_x, y = map_data.spawn_y, z = map_data.spawn_z})
player:get_inventory():set_list("main", {})
@ -168,33 +168,40 @@ end)
core.register_privilege("match_manager", {description = "Can manage the match", give_to_singleplayer = true})
core.register_chatcommand("load", {
params = "<map>",
privs = {match_manager = true},
description = "Load a map",
func = function(_, param)
map_data = place_map(param)
for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name()
set_player_mode(player, "normal")
player:set_nametag_attributes({color = {a = 0}})
player:set_hp(20)
player:set_pos({x=map_data.spawn_x, y=map_data.spawn_y, z=map_data.spawn_z})
end
end
})
core.register_chatcommand("start", {
params = "",
privs = {match_manager = true},
description = "Start the match",
func = function()
for x = 1, 39 do
for z = 1, 36 do
core.set_node({x = x, y = 25, z = z}, {name = "air"})
end
end
remove_barrier(map_data.size_x, map_data.barrier_level, map_data.size_z)
core.chat_send_all(core.colorize("green", "Match started!"))
alive_players = {}
for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name()
set_player_mode(player, "normal")
player:set_nametag_attributes({color = {a = 0}})
player:set_hp(20)
player:set_properties({
pointable = true, -- allow players to be killable after the match starts
})
inv = player:get_inventory()
inv:add_item("main", "ctf_ranged:ak47_loaded")
inv:add_item("main", "ctf_ranged:ammo 3")
player:set_properties({
pointable = true, -- allow players to be killable after the match starts
})
alive_players[player_name] = "alive"
end
return ""
@ -206,12 +213,10 @@ core.register_chatcommand("reset", {
privs = {match_manager = true},
description = "Reset map",
func = function()
core.place_schematic({x = 0, y = 0, z = 0}, core.get_modpath("main") .. "/schematics/map1.mts", 0, nil, false)
for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name()
player:set_nametag_attributes({color = {a = 255, r = 255, g = 255, b = 255}})
player:set_pos({x = 20, y = 26.5, z = 17})
player:set_pos({x = map_data.spawn_x, y = map_data.spawn_y, z = map_data.spawn_z})
set_player_mode(player, "normal")
player:get_inventory():set_list("main", {})
player:set_properties({