1 -- Check specific map generation, useful for testing portal vault
2 -- generation (SUBSTs, NSBUSTs, SHUFFLEs, etc).
6 -- Which des file is the map in?
8 -- Change to true if the des file isn't specificed in dat/clua/loadmaps.lua
9 local need_to_load_des
= false
10 -- How many times should we generate?
12 -- Output to this file, will append iteration to the end, ie,
13 -- output_to.map.1, output_to.map.2, etc.
16 -- Should we run these tests?
17 local run_test
= map_to_test
~= ""
19 local function generate_map()
20 output_to
= output_to
== "" and map_to_test
or output_to
21 if map_to_test
== "" or
22 (des_file
== "" and need_to_load_des
) or
24 assert(false, "Need a map, a des file (if not already loaded), and an output.")
27 if need_to_load_des
then
28 dgn
.load_des_file(des_file
)
31 local map
= dgn
.map_by_name(map_to_test
)
34 assert(false, "Couldn't find the map named " .. map_to_test
)
37 for iter_i
= 1, checks
do
38 debug
.flush_map_memory()
40 dgn
.tags(map
, "no_rotate no_vmirror no_hmirror no_pool_fixup")
41 dgn
.place_map(map
, true, true)
42 crawl
.message("Placed " .. map_to_test
.. ":" .. iter_i
.. ", dumping to " .. output_to
.. "." .. iter_i
)
43 debug
.dump_map(output_to
.. "." .. iter_i
)
50 crawl
.message("Not running vault generation test.")