summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-23 02:31:26 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-23 02:31:26 -0300
commitbfc68f0644e2a21fbe12cf1513f577fc82052956 (patch)
treeee05ee7428313d8c3f71b00ff65c8ce487392148
parent98cbcce89a815cd1a284cfde2e678cf43a7ec696 (diff)
downloadserverdata-bfc68f0644e2a21fbe12cf1513f577fc82052956.tar.gz
serverdata-bfc68f0644e2a21fbe12cf1513f577fc82052956.tar.bz2
serverdata-bfc68f0644e2a21fbe12cf1513f577fc82052956.tar.xz
serverdata-bfc68f0644e2a21fbe12cf1513f577fc82052956.zip
Prepare maze0/config to create a random maze memory
-rw-r--r--npc/maze0/config.txt33
1 files changed, 28 insertions, 5 deletions
diff --git a/npc/maze0/config.txt b/npc/maze0/config.txt
index d3f44cf9a..3f59d30fe 100644
--- a/npc/maze0/config.txt
+++ b/npc/maze0/config.txt
@@ -533,8 +533,11 @@ function script GenerateMaze {
.@l$=.@l$+","+getd(MazeVar(.@x, .@y, "_ID"));
.@lb$=.@lb$+" "+.@symbol$;
}
- debugmes "[REPORT] %s", .@l$;
- debugmes "[REPORT] %s", .@lb$;
+ // Debug human readable format + a easy to grep-replace RNG
+ // Pseudo-rng example: $@MAZES_12_4 = Random Maze 12, Row 4
+ // On the example, replace VAR with "MAZES_12"
+ debugmes "[REPORT-SA] setarray $@VAR_%d, %s", .@y, .@l$; // SetArray
+ debugmes "[REPORT-HR] %s", .@lb$; // HumanReadable
}
@@ -708,9 +711,29 @@ maze0,30,30,0 script #MazeMaster NPC_MONA,{
function parseConnections;
*/
//GenerateMaze(7, 7, 0);
- GenerateMaze(5, 5);
- CreateMaze();
- InitMaze(0, 0);
+ select
+ l("Playtesting"),
+ l("RMG"),
+ l("RMG+Playtest");
+ mes "";
+ .@x=5;.@y=5;
+ if (@menu >= 2) {
+ // Width
+ mesf "Width (%d-25): ", max(1, @xvar);
+ input .@x, max(1, @xvar), 25;
+
+ // Height
+ mesf "Height (%d-25): ", max(1, @yvar);
+ input .@y, max(1, @yvar), 25;
+
+ // Prevent bugs
+ @xvar=.@x; @yvar=.@y;
+ }
+ GenerateMaze(.@x, .@y);
+ if (@menu != 2) {
+ CreateMaze();
+ InitMaze(0, 0);
+ }
end;
}