From 8b3ffb1eac11936298368fbd38bb6fd3ba0b86bf Mon Sep 17 00:00:00 2001 From: esteel Date: Sat, 14 Jan 2006 12:29:40 +0000 Subject: [PATCH] instantaction chooses maps randomly now, added nexdm01,03,04,05,08 to instantaction git-svn-id: svn://svn.icculus.org/nexuiz/trunk@820 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- .../{exit.instantaction => exit_instantaction} | 0 data/maps/nexdm01.instantaction | 2 +- data/maps/nexdm03.instantaction | 10 ++++++++++ data/maps/nexdm04.instantaction | 10 ++++++++++ data/maps/nexdm05.instantaction | 10 ++++++++++ data/maps/nexdm08.instantaction | 10 ++++++++++ data/menuqc/custom/creategame.qm | 16 +++++++++++++++- 7 files changed, 56 insertions(+), 2 deletions(-) rename data/maps/{exit.instantaction => exit_instantaction} (100%) create mode 100755 data/maps/nexdm03.instantaction create mode 100755 data/maps/nexdm04.instantaction create mode 100755 data/maps/nexdm05.instantaction create mode 100755 data/maps/nexdm08.instantaction diff --git a/data/maps/exit.instantaction b/data/maps/exit_instantaction similarity index 100% rename from data/maps/exit.instantaction rename to data/maps/exit_instantaction diff --git a/data/maps/nexdm01.instantaction b/data/maps/nexdm01.instantaction index a4ba7f102..a0352d925 100755 --- a/data/maps/nexdm01.instantaction +++ b/data/maps/nexdm01.instantaction @@ -1,4 +1,4 @@ -set exit_cfg "maps/exit.instantaction" +set exit_cfg "maps/exit_instantaction" set BACKUP_bot_number $bot_number set bot_number 3 set BACKUP_skill $skill diff --git a/data/maps/nexdm03.instantaction b/data/maps/nexdm03.instantaction new file mode 100755 index 000000000..6ca677e9d --- /dev/null +++ b/data/maps/nexdm03.instantaction @@ -0,0 +1,10 @@ +set exit_cfg "maps/exit_instantaction" +set BACKUP_bot_number $bot_number +set bot_number 3 +set BACKUP_skill $skill +set skill 3 +set lastlevel 1 + +set fraglimit 10 +set timelimit 5 +changelevel nexdm03 diff --git a/data/maps/nexdm04.instantaction b/data/maps/nexdm04.instantaction new file mode 100755 index 000000000..00207e71b --- /dev/null +++ b/data/maps/nexdm04.instantaction @@ -0,0 +1,10 @@ +set exit_cfg "maps/exit_instantaction" +set BACKUP_bot_number $bot_number +set bot_number 3 +set BACKUP_skill $skill +set skill 3 +set lastlevel 1 + +set fraglimit 10 +set timelimit 5 +changelevel nexdm04 diff --git a/data/maps/nexdm05.instantaction b/data/maps/nexdm05.instantaction new file mode 100755 index 000000000..56e9bc098 --- /dev/null +++ b/data/maps/nexdm05.instantaction @@ -0,0 +1,10 @@ +set exit_cfg "maps/exit_instantaction" +set BACKUP_bot_number $bot_number +set bot_number 3 +set BACKUP_skill $skill +set skill 3 +set lastlevel 1 + +set fraglimit 10 +set timelimit 5 +changelevel nexdm05 diff --git a/data/maps/nexdm08.instantaction b/data/maps/nexdm08.instantaction new file mode 100755 index 000000000..d0689c669 --- /dev/null +++ b/data/maps/nexdm08.instantaction @@ -0,0 +1,10 @@ +set exit_cfg "maps/exit_instantaction" +set BACKUP_bot_number $bot_number +set bot_number 3 +set BACKUP_skill $skill +set skill 3 +set lastlevel 1 + +set fraglimit 10 +set timelimit 5 +changelevel nexdm08 diff --git a/data/menuqc/custom/creategame.qm b/data/menuqc/custom/creategame.qm index ded7f74bf..9c7e85d34 100644 --- a/data/menuqc/custom/creategame.qm +++ b/data/menuqc/custom/creategame.qm @@ -118,6 +118,20 @@ void() Nex_Action_Map_Start = void() Nex_Action_Instant_Action = { local string exit_cfg; + local float randommap; + local float lSearchHandle; + local float lSearchSize; + local string lFilename; + + lSearchHandle = search_begin( "maps/*.instantaction", true, true ); + if( lSearchHandle < 0 ) + return; + + lSearchSize = search_getsize( lSearchHandle ); + randommap = random() * lSearchSize; + lFilename = search_getfilename( lSearchHandle, randommap ); + + search_end( lSearchHandle ); // if an old exit cfg file was set up, exec it // to reset old values before starting the server @@ -127,7 +141,7 @@ void() Nex_Action_Instant_Action = cmd( "exec ", exit_cfg, "\n" ); } // exec the game reset cfg and then the mapcfg - cmd( "exec game_reset.cfg \nwait \nexec \"maps/nexdm01.instantaction\"\n" ); + cmd( strcat( "exec game_reset.cfg \n wait \n exec \"", lFilename, "\"\n") ); // force the menu to hide m_hide(); -- 2.39.2