[Ready] Asteroid Dungeons (#4884)

Adds Asteroid Dungeons framework to the game. Mappers can make their own asteroid dungeons to the game. Currently there are no asteroid dungeons that can be loaded.

Anyone can make a dungeon like anyone could make a change to a map. A readme file is included inside the maps directory for information regarding how to add your own dungeon to the map.

There's an added config function in the example config that determines whether or not asteroid dungeons spawn. I also included 2 bat files in mapmerge and mapmerge2 that backup the asteroid dungeons spawns so that they can be used in mapmerge.
This commit is contained in:
BurgerLUA
2018-07-20 13:10:35 -07:00
committed by Werner
parent 15b42a92aa
commit 1bd59b6532
14 changed files with 134 additions and 51 deletions
+6
View File
@@ -137,6 +137,9 @@ var/list/gamemode_cache = list()
var/welder_vision = 1
var/generate_asteroid = 0
var/dungeon_chance = 0
var/no_click_cooldown = 0
//Used for modifying movement speed for mobs.
@@ -396,6 +399,9 @@ var/list/gamemode_cache = list()
if ("log_runtime")
config.log_runtime = text2num(value)
if ("dungeon_chance")
config.dungeon_chance = text2num(value)
if ("generate_asteroid")
config.generate_asteroid = 1
@@ -13,6 +13,9 @@
current_map.finalize_load()
log_ss("map_finalization", "Finalized map in [(world.time - time)/10] seconds.")
if(config.dungeon_chance > 0)
place_dungeon_spawns()
if(config.generate_asteroid)
time = world.time
current_map.generate_asteroid()
@@ -32,3 +35,45 @@
all_areas += A
sortTim(all_areas, /proc/cmp_name_asc)
/proc/place_dungeon_spawns()
var/map_directory = "maps/dungeon_spawns/"
var/list/files = flist(map_directory)
var/start_time = world.time
var/dungeons_placed = 0
var/static/dmm_suite/maploader = new
var/dungeon_chance = config.dungeon_chance
log_ss("map_finalization","Attempting to create asteroid dungeons for [length(asteroid_spawn)] different areas, with [length(files) - 1] possible dungeons, with a [dungeon_chance]% chance to spawn a dungeon per area.")
for(var/turf/spawn_location in asteroid_spawn)
if(length(files) <= 0) //Sanity
log_ss("map_finalization","There aren't enough dungeon map files to fill the entire dungeon map. There may be less dungeons than expected.")
break
if(prob(dungeon_chance))
var/chosen_dungeon = pick(files)
if(!dd_hassuffix(chosen_dungeon,".dmm")) //Don't read anything that isn't a map file
files -= chosen_dungeon
log_ss("map_finalization","ALERT: [chosen_dungeon] is not a .dmm file! Skipping!")
continue
var/map_file = file("[map_directory][chosen_dungeon]")
if(isfile(map_file)) //Sanity
log_ss("map_finalization","Loading dungeon '[chosen_dungeon]' at coordinates [spawn_location.x], [spawn_location.y], [spawn_location.z].")
maploader.load_map(map_file,spawn_location.x,spawn_location.y,spawn_location.z)
dungeons_placed += 1
else
log_ss("map_finalization","ERROR: Something weird happened with the file: [chosen_dungeon].")
if(dd_hassuffix(chosen_dungeon,"_unique.dmm")) //Unique dungeons should only spawn once.
files -= chosen_dungeon
log_ss("map_finalization","Loaded [dungeons_placed] asteroid dungeons in [(world.time - start_time)/10] seconds.")
qdel(maploader)
+9
View File
@@ -75,6 +75,10 @@
endgame_exits += loc
delete_me = 1
return
if("asteroid spawn")
asteroid_spawn += loc
delete_me = 1
return
landmarks_list += src
return 1
@@ -246,3 +250,8 @@
new /obj/item/clothing/mask/gas/sexymime(src.loc)
new /obj/item/clothing/under/sexymime(src.loc)
delete_me = 1
/obj/effect/landmark/dungeon_spawn
name = "asteroid spawn"
icon = 'icons/1024x1024.dmi'
icon_state = "yellow"
+1 -3
View File
@@ -1034,6 +1034,4 @@
spawned_frame.update_icon()
spawned_frame.update_stats()
qdel(thing)
qdel(thing)
+1
View File
@@ -60,6 +60,7 @@ var/list/kickoffsloc = list()
var/list/prisonwarp = list() // Prisoners go to these
var/list/holdingfacility = list() // Captured people go here
var/list/xeno_spawn = list() // Aliens spawn at at these.
var/list/asteroid_spawn = list() // Asteroid "Dungeons" spawn at these.
var/list/tdome1 = list()
var/list/tdome2 = list()
var/list/tdomeobserve = list()
+3
View File
@@ -407,6 +407,9 @@ MERCHANT_CHANCE 20
## Enable asteroid tunnel/cave generation. Will behave strangely if turned off with a map that expects it on.
# GENERATE_ASTEROID
## Enable asteroid dungeon generation. The value preceding is the chance for a dungeon slot to be occupied.
# DUNGEON_CHANCE 25
## Uncomment to enable organ decay outside of a body or storage item.
#ORGANS_CAN_DECAY
@@ -0,0 +1,6 @@
author: BurgerBB
delete-after: True
changes:
- maptweak: "Added a random dungeon framework. Mappers can make their own dungeons and submit them to Github."
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

-1
View File
@@ -73,4 +73,3 @@
/area/turret_protected/NewAIMain
name = "\improper AI Main New"
icon_state = "storage"
+8 -42
View File
@@ -4462,20 +4462,9 @@
},
/area/outpost/engineering/storage)
"jr" = (
/obj/structure/particle_accelerator/end_cap{
icon_state = "end_cap";
dir = 8
},
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
dir = 4
},
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
dir = 4
},
/turf/simulated/floor{
icon_state = "plating"
},
/area/outpost/engineering/storage)
/obj/effect/landmark/dungeon_spawn,
/turf/unsimulated/chasm_mask,
/area/mine/unexplored)
"js" = (
/obj/machinery/power/grounding_rod,
/obj/machinery/atmospherics/pipe/manifold/hidden/supply{
@@ -9468,12 +9457,6 @@
"qO" = (
/turf/simulated/floor/reinforced,
/area/security/nuke_storage)
"qP" = (
/obj/effect/floor_decal/industrial/warning{
dir = 8
},
/turf/simulated/floor/tiled/dark,
/area/security/nuke_storage)
"qQ" = (
/obj/machinery/hologram/holopad,
/turf/simulated/floor/tiled/dark,
@@ -26419,23 +26402,6 @@
},
/turf/simulated/floor/asteroid/ash/rocky,
/area/mine/unexplored)
"Ux" = (
/obj/machinery/access_button{
command = "cycle_exterior";
frequency = 1379;
master_tag = "toxinsairlock_airlock";
name = "exterior access button";
pixel_x = 25;
pixel_y = -25;
req_one_access = list(13,65)
},
/obj/structure/cable/green{
d1 = 4;
d2 = 8;
icon_state = "4-8"
},
/turf/simulated/floor/asteroid/ash/rocky,
/area/mine/unexplored)
"Uy" = (
/obj/structure/cable/green{
d1 = 4;
@@ -28459,7 +28425,7 @@ aa
aa
aa
aa
aa
jr
aa
aa
aa
@@ -39156,7 +39122,7 @@ aa
aa
aa
aa
aa
jr
aa
aa
aa
@@ -54233,7 +54199,7 @@ aa
aa
aa
aa
aa
jr
aa
aa
aa
@@ -63043,7 +63009,7 @@ aa
aa
aa
aa
aa
jr
aa
aa
aa
@@ -77073,7 +77039,7 @@ aa
aa
aa
aa
aa
jr
aa
aa
aa
+9 -5
View File
@@ -2763,6 +2763,10 @@
},
/turf/simulated/floor/carpet,
/area/security/detectives_office)
"ff" = (
/obj/effect/landmark/dungeon_spawn,
/turf/unsimulated/chasm_mask,
/area/mine/unexplored)
"fh" = (
/obj/effect/floor_decal/corner/green{
icon_state = "corner_white";
@@ -17220,7 +17224,7 @@ aa
aa
aa
aa
aa
ff
aa
aa
aa
@@ -18164,7 +18168,7 @@ aa
aa
aa
aa
aa
ff
aa
aa
aa
@@ -40849,7 +40853,7 @@ aa
aa
aa
aa
aa
ff
aa
aa
aa
@@ -54265,7 +54269,7 @@ aa
aa
aa
aa
aa
ff
aa
aa
aa
@@ -54920,7 +54924,7 @@ aa
aa
aa
aa
aa
ff
aa
aa
aa
+22
View File
@@ -0,0 +1,22 @@
This is the readme file for asteroid dungeons. Create all new dungeons in this directory here so that they may be loaded in the game.
Step by step:
0. Learn how to actually map, including how to use mapmerge and how to use git.
1. Open DreamMaker
2. Create a new .tgm file at the directory maps/dungeon_spawns
3. Make sure that the settings are x: 32, y: 32, z:1. Anything else may be wonky.
4. Ensure that you have the correct area set (/area/mine/unexplored), unless your dungeon uses its own special area (for power, and whatnot).
5. Ensure that you have the correct non-dungeon tile set (/turf/unsimulated/chasm_mask).
6. Apply map changes.
7. ENSURE THAT THE MAP FILE IS UNCHECKED IN THE FILE PANE WINDOW ON THE LEFT HAND SIDE AND THAT IT'S NOT INCLUDED IN AURORASTATION.DME.
8. ENSURE THAT THE MAP FILE IS UNCHECKED IN THE FILE PANE WINDOW ON THE LEFT HAND SIDE AND THAT IT'S NOT INCLUDED IN AURORASTATION.DME.
9. Go to tools, and run Prepare Maps - Random Dungeons in one of the mapmerge directories.
10. Run Map Merge - TGM
11. Merge the dungeons you made.
12. Ensure that you're not a fuckup and did everything right.
13. Do git magic here.
Final Notes:
If the dungeon is meant to be unique, append "_unique" at the end of the filename (like "snowflake_unique") so it can only spawn once. Otherwise, your dungeon may occur multiple times.
Ensure that your dungeon actually works if you've added anything complex like a powernet or some other complex thing. You can do this by temporarily deleting all the rest of the dungeon files so your unique dungeon will always spawn.
@@ -0,0 +1,12 @@
@echo off
cd ../../maps/dungeon_spawns
for /R %%f in (*.dmm) do copy "%%f" "%%f.backup"
cls
echo All dmm files in the maps/dungeon_spawns directory have been backed up.
echo Now you can make your changes...
echo ---
echo Remember to run Run Map Merge - TGM.bat just before you commit your changes!
echo ---
pause
@@ -0,0 +1,12 @@
@echo off
cd ../../maps/dungeon_spawns
for /R %%f in (*.dmm) do copy "%%f" "%%f.backup"
cls
echo All dmm files in the maps/dungeon_spawns directory have been backed up.
echo Now you can make your changes...
echo ---
echo Remember to run mapmerge.bat just before you commit your changes!
echo ---
pause