Skip to content

Commit

Permalink
Big(gish) map reorganization.
Browse files Browse the repository at this point in the history
Moved all main .dmm maps to _maps/map_files
Each main map gets a .dm file in _maps, this is what's ticked, -NOT- the .dmm file.
This allows use of a MAP_NAME define for various purposes, and lays the groundwork for map customization in the future.

Also included a hacky dm.sh script which supports swapping maps.
For example, "./dm.sh tgstation.dme -Mmetastation" would compile with metastation.

Signed-off-by: Mloc-Argent <[email protected]>
  • Loading branch information
mloc committed Jan 13, 2014
1 parent 84ee1ca commit 2f931ae
Show file tree
Hide file tree
Showing 27 changed files with 129 additions and 33 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#Do NOT tick the maps during compile -- the game uses this list to decide which map to load. Ticking the maps will result in them ALL being loaded at once.
#DO tick the associated code file for the away mission you are enabling. Otherwise, the map will be trying to reference objects which do not exist, which will cause runtime errors!

#maps/RandomZLevels/example.dmm
#maps/RandomZLevels/blackmarketpackers.dmm
#maps/RandomZLevels/stationCollision.dmm
#maps/RandomZLevels/spacebattle.dmm
#maps/RandomZLevels/beach.dmm
#maps/RandomZLevels/Academy.dmm
#maps/RandomZLevels/wildwest.dmm
#maps/RandomZLevels/challenge.dmm
#maps/RandomZLevels/listeningpost.dmm
#maps/RandomZLevels/spacehotel.dmm
#maps/RandomZLevels/centcomAway.dmm
#_maps/RandomZLevels/example.dmm
#_maps/RandomZLevels/blackmarketpackers.dmm
#_maps/RandomZLevels/stationCollision.dmm
#_maps/RandomZLevels/spacebattle.dmm
#_maps/RandomZLevels/beach.dmm
#_maps/RandomZLevels/Academy.dmm
#_maps/RandomZLevels/wildwest.dmm
#_maps/RandomZLevels/challenge.dmm
#_maps/RandomZLevels/listeningpost.dmm
#_maps/RandomZLevels/spacehotel.dmm
#_maps/RandomZLevels/centcomAway.dmm
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions _maps/metastation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef MAP_FILE

#include "map_files\MetaStation.v39A.III.dmm"

#define MAP_FILE "MetaStation.v39A.III.dmm"
#define MAP_NAME "MetaStation"

#endif
8 changes: 8 additions & 0 deletions _maps/tgstation2.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef MAP_FILE

#include "map_files\tgstation.2.1.2.dmm"

#define MAP_FILE "tgstation.2.1.2.dmm"
#define MAP_NAME "/tg/station 2"

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion code/modules/awaymissions/zlevel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ proc/createRandomZlevel()

var/list/potentialRandomZlevels = list()
world << "\red \b Searching for away missions..."
var/list/Lines = file2list("maps/RandomZLevels/fileList.txt")
var/list/Lines = file2list("_maps/RandomZLevels/fileList.txt")
if(!Lines.len) return
for (var/t in Lines)
if (!t)
Expand Down
18 changes: 5 additions & 13 deletions code/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,11 @@
process_ghost_teleport_locs() //Sets up ghost teleport locations.
sleep_offline = 1

var/list/lines = file2list(file('tgstation.dme'))
for(var/l in lines)
if( dd_hassuffix(l, ".dmm\"") )
var/firstquote = findtext(l, "\"")
var/lastslash = 0
for(var/j = 1; j < length(l); j++)
var/lastslashtest = findtext(l, "\\", -j)
if(lastslashtest > 0)
lastslash = lastslashtest
break
map_name = copytext(l, max(firstquote+1,lastslash+1), length(l)-4)
if(!map_name)
map_name = "Unknown"
#ifdef MAP_NAME
map_name = "[MAP_NAME]"
#else
map_name = "Unknown"
#endif

spawn(3000) //so we aren't adding to the round-start lag
if(config.kick_inactive)
Expand Down
88 changes: 88 additions & 0 deletions dm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash

dmepath=""
retval=1

for var
do
if [[ $var != -* && $var == *.dme ]]
then
dmepath=`echo $var | sed -r 's/.{4}$//'`
break
fi
done

if [[ $dmepath == "" ]]
then
echo "No .dme file specified, aborting."
exit 1
fi

if [[ -a $dmepath.mdme ]]
then
rm $dmepath.mdme
fi

cp $dmepath.dme $dmepath.mdme
if [[ $? != 0 ]]
then
echo "Failed to make modified dme, aborting."
exit 2
fi

for var
do
arg=`echo $var | sed -r 's/^.{2}//'`
if [[ $var == -D* ]]
then
sed -i '1s/^/#define '$arg'\n/' $dmepath.mdme
continue
fi
if [[ $var == -M* ]]
then
sed -i 's!// BEGIN_INCLUDE!// BEGIN_INCLUDE\n#include "_maps\\'$arg'.dm"!' $dmepath.mdme
continue
fi
done

#windows
if [[ `uname` == MINGW* ]]
then
dm=""

if hash dm.exe 2>/dev/null
then
dm='dm.exe'
elif [[ -a '/c/Program Files (x86)/BYOND/bin/dm.exe' ]]
then
dm='/c/Program Files (x86)/BYOND/bin/dm.exe'
elif [[ -a '/c/Program Files/BYOND/bin/dm.exe' ]]
then
dm='/c/Program Files/BYOND/bin/dm.exe'
fi

if [[ $dm == "" ]]
then
echo "Couldn't find the DreamMaker executable, aborting."
exit 3
fi

"$dm" $dmepath.mdme
retval=$?
else
if hash DreamMaker 2>/dev/null
then
DreamMaker $dmepath.mdme
retval=$?
else
echo "Couldn't find the DreamMaker executable, aborting."
exit 3
fi
fi

mv $dmepath.mdme.dmb $dmepath.dmb
mv $dmepath.mdme.rsc $dmepath.rsc

rm $dmepath.mdme

exit $retval
16 changes: 8 additions & 8 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// END_PREFERENCES

// BEGIN_INCLUDE
#include "_maps\tgstation2.dm"
#include "code\_compile_options.dm"
#include "code\hub.dm"
#include "code\world.dm"
Expand Down Expand Up @@ -729,6 +730,13 @@
#include "code\modules\awaymissions\maploader\reader.dm"
#include "code\modules\awaymissions\maploader\swapmaps.dm"
#include "code\modules\awaymissions\maploader\writer.dm"
#include "code\modules\awaymissions\mission_code\Academy.dm"
#include "code\modules\awaymissions\mission_code\blackmarketpackers.dm"
#include "code\modules\awaymissions\mission_code\centcomAway.dm"
#include "code\modules\awaymissions\mission_code\challenge.dm"
#include "code\modules\awaymissions\mission_code\spacebattle.dm"
#include "code\modules\awaymissions\mission_code\stationCollision.dm"
#include "code\modules\awaymissions\mission_code\wildwest.dm"
#include "code\modules\client\client defines.dm"
#include "code\modules\client\client procs.dm"
#include "code\modules\client\preferences.dm"
Expand Down Expand Up @@ -1197,12 +1205,4 @@
#include "interface\interface.dm"
#include "interface\stylesheet.dm"
#include "interface\skin.dmf"
#include "maps\tgstation.2.1.2.dmm"
#include "maps\RandomZLevels\Academy.dm"
#include "maps\RandomZLevels\blackmarketpackers.dm"
#include "maps\RandomZLevels\centcomAway.dm"
#include "maps\RandomZLevels\challenge.dm"
#include "maps\RandomZLevels\spacebattle.dm"
#include "maps\RandomZLevels\stationCollision.dm"
#include "maps\RandomZLevels\wildwest.dm"
// END_INCLUDE

0 comments on commit 2f931ae

Please sign in to comment.