From 8dfd5578fd52e8db71361e6595098c14dd5fbcfa Mon Sep 17 00:00:00 2001 From: div0 Date: Sun, 11 Jun 2006 11:02:44 +0000 Subject: [PATCH] campaign is now CSV please recompile menu and progs git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1558 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/maps/campaign.txt | 41 ++++++++++++------------- data/qcsrc/server/gamec/campaign_file.c | 32 ++++++++++++------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/data/maps/campaign.txt b/data/maps/campaign.txt index a4e80ccba..0f9038596 100644 --- a/data/maps/campaign.txt +++ b/data/maps/campaign.txt @@ -1,21 +1,20 @@ -// vim: expandtab -// game mapname bots skill frag mutator-sets description long description -dm downer 2 1 15 "" "Downer" "Welcome to your first taste of campaign deathmatch! The first phrase of 5 maps will be skill 2, which should be good practice for the later maps. Two bots with fraglimit of 15" -dm basement 3 1 10 "" "Basement" "Three bots, fraglimit of 10." -dm skyway 3 2 15 "g_rocketarena 1" "Rocket Arena on Skyway" "Rocket Arena DM mode! 3 bots, everyone will start with rockets with unlimited ammo. Remember, you can detonate your rockets in midair with the secondary fire, this is useful for getting the most damage. Fraglimit of 15." -tdm toxic 3 2 20 "" "Team DM on Toxic" "Team deathmatch. You will have one bot team mate on your team now against a team of 2. Fraglimit of 20." -dom bleach 3 2 200 "" "Domination on Bleach" "Take and hold the control points. The more your team holds, the better you score. One bot on your team against 2, with a scorelimit of 200." -dm silvercity 4 2 15 "g_minstagib 1; sv_gravity 200" "Silver City" "Low gravity minstagib! Face 4 bots to a fraglimit of 20 in this huge arena map. With the low gravity you should be able to navigate through it fairly easily." -dm slimepit 3 2 15 "g_vampire 1" "The Slime Pit" "Fight in this slimey arena with Vampire mode, where you collect all the damage you do. 3 bots, and a fraglimit of 15." -dm aggressor 3 5 15 "" "Aggressor" "Congratulations! You have passed the first part of the Nexuiz campaign. Now on to the harder levels with skills of 5, in this map you will face 3 bots in basic DM. Fraglimit of 15" -ctf basementctf 3 5 60 "" "CTF on Basement" "2on2 Capture the flag. Point limit of 60." -dm evilspace 3 5 10 "" "Evil Space" "Space map deathmatch, 3 bots. Fraglimit of 10." -dm aneurysm 3 5 15 "" "Aneurysm" "3 bots with 15 fraglimit." -dm soylent 3 5 10 "" "Soylent Space" "3 bots and a fraglimit of 10." -dm runningman_1on1remix 1 7 10 "g_footsteps 1" "1on1 on Running Man" "Congratulations! You passed the second part of the Nexuiz campaign. Now to skill 7." -dm darkzone 4 7 15 "" "Q1Dm6 remake" "There are 4 bots in this Quake1 deathmatch map remake, with a fraglimit of 15." -dm stormkeep 5 7 15 "g_laserguided_missile 1; g_rocketarena 1" "LG missiles on StormKeep" "Laser guided missiles - toggle laser using altfire. 4 bots with a fraglimit of 15." -dm farewell 3 7 20 "g_rocketarena 1" "Farewell" "Rocket Arena! 3 bots, 20 fraglimit" -dm warfare 3 7 15 "" "Warefare" "3 bots, 15 fraglimit" -lms bloodprison 3 10 9 "" "LMS on Blood Prison" "Last Man Standing: you have nine lives. +++ Make something out of it!" -dm starship 3 10 15 "" "Starship" "4 bots with a 15 frag limit in this starship battle. Final level!" +"//game","mapname","bots","skill","frag","mutator-sets","description","long description" +"dm","downer","2","1","15",,"Downer","Welcome to your first taste of campaign deathmatch! The first phrase of 5 maps will be skill 2, which should be good practice for the later maps. Two bots with fraglimit of 15" +"dm","basement","3","1","10",,"Basement","Three bots, fraglimit of 10." +"dm","skyway","3","2","15","g_rocketarena 1","Rocket Arena on Skyway","Rocket Arena DM mode! 3 bots, everyone will start with rockets with unlimited ammo. Remember, you can detonate your rockets in midair with the secondary fire, this is useful for getting the most damage. Fraglimit of 15." +"tdm","toxic","3","2","20",,"Team DM on Toxic","Team deathmatch. You will have one bot team mate on your team now against a team of 2. Fraglimit of 20." +"dom","bleach","3","2","200",,"Domination on Bleach","Take and hold the control points. The more your team holds, the better you score. One bot on your team against 2, with a scorelimit of 200." +"dm","silvercity","4","2","15","g_minstagib 1; sv_gravity 200","Silver City","Low gravity minstagib! Face 4 bots to a fraglimit of 20 in this huge arena map. With the low gravity you should be able to navigate through it fairly easily." +"dm","slimepit","3","2","15","g_vampire 1","The Slime Pit","Fight in this slimey arena with Vampire mode, where you collect all the damage you do. 3 bots, and a fraglimit of 15." +"dm","aggressor","3","5","15",,"Aggressor","Congratulations! You have passed the first part of the Nexuiz campaign. Now on to the harder levels with skills of 5, in this map you will face 3 bots in basic DM. Fraglimit of 15" +"ctf","basementctf","3","5","60",,"CTF on Basement","2on2 Capture the flag. Point limit of 60." +"dm","evilspace","3","5","10",,"Evil Space","Space map deathmatch, 3 bots. Fraglimit of 10." +"dm","aneurysm","3","5","15",,"Aneurysm","3 bots with 15 fraglimit." +"dm","soylent","3","5","10",,"Soylent Space","3 bots and a fraglimit of 10." +"dm","runningman_1on1remix","1","7","10","g_footsteps 1","1on1 on Running Man","Congratulations! You passed the second part of the Nexuiz campaign. Now to skill 7." +"dm","darkzone","4","7","15",,"Q1Dm6 remake","There are 4 bots in this Quake1 deathmatch map remake, with a fraglimit of 15." +"dm","stormkeep","5","7","15","g_laserguided_missile 1; g_rocketarena 1","LG missiles on StormKeep","Laser guided missiles - toggle laser using altfire. 4 bots with a fraglimit of 15." +"dm","farewell","3","7","20","g_rocketarena 1","Farewell","Rocket Arena! 3 bots, 20 fraglimit" +"dm","warfare","3","7","15",,"Warefare","3 bots, 15 fraglimit" +"lms","bloodprison","3","10","9",,"LMS on Blood Prison","Last Man Standing: you have nine lives. +++ Make something out of it!" +"dm","starship","3","10","15",,"Starship","4 bots with a 15 frag limit in this starship battle. Final level!" diff --git a/data/qcsrc/server/gamec/campaign_file.c b/data/qcsrc/server/gamec/campaign_file.c index d6fa7a818..7896b8724 100644 --- a/data/qcsrc/server/gamec/campaign_file.c +++ b/data/qcsrc/server/gamec/campaign_file.c @@ -8,7 +8,7 @@ float CampaignFile_Load(float offset, float n) float lineno; float entlen; float i; - string l; + string l, a; if(n > CAMPAIGN_MAX_ENTRIES) n = CAMPAIGN_MAX_ENTRIES; @@ -25,21 +25,31 @@ float CampaignFile_Load(float offset, float n) continue; // empty line if(substring(l, 0, 2) == "//") continue; // comment + if(substring(l, 0, 3) == "\"//") + continue; // comment if(lineno >= offset) { entlen = tokenize(l); - if(entlen != 8) - error("syntax error in campaign file"); + +#define CAMPAIGN_GETARG0 if(i >= entlen) +#define CAMPAIGN_GETARG1 CAMPAIGN_GETARG0 error("syntax error in campaign file: line has not enough fields"); +#define CAMPAIGN_GETARG2 CAMPAIGN_GETARG1 a = argv(i++); +#define CAMPAIGN_GETARG3 CAMPAIGN_GETARG2 if(a == ",") +#define CAMPAIGN_GETARG4 CAMPAIGN_GETARG3 a = ""; +#define CAMPAIGN_GETARG5 CAMPAIGN_GETARG4 else +#define CAMPAIGN_GETARG CAMPAIGN_GETARG5 ++i +// What you're seeing here is what people will do when your compiler supports +// C-style macros but no line continuations. i = 0; - campaign_gametype[campaign_entries] = strzone(argv(i++)); - campaign_mapname[campaign_entries] = strzone(argv(i++)); - campaign_bots[campaign_entries] = stof(argv(i++)); - campaign_botskill[campaign_entries] = stof(argv(i++)); - campaign_fraglimit[campaign_entries] = stof(argv(i++)); - campaign_mutators[campaign_entries] = strzone(argv(i++)); - campaign_shortdesc[campaign_entries] = strzone(argv(i++)); - campaign_longdesc[campaign_entries] = strzone(argv(i++)); + CAMPAIGN_GETARG; campaign_gametype[campaign_entries] = strzone(a); + CAMPAIGN_GETARG; campaign_mapname[campaign_entries] = strzone(a); + CAMPAIGN_GETARG; campaign_bots[campaign_entries] = stof(a); + CAMPAIGN_GETARG; campaign_botskill[campaign_entries] = stof(a); + CAMPAIGN_GETARG; campaign_fraglimit[campaign_entries] = stof(a); + CAMPAIGN_GETARG; campaign_mutators[campaign_entries] = strzone(a); + CAMPAIGN_GETARG; campaign_shortdesc[campaign_entries] = strzone(a); + CAMPAIGN_GETARG; campaign_longdesc[campaign_entries] = strzone(a); campaign_entries = campaign_entries + 1; if(campaign_entries >= n) -- 2.39.2