home *** CD-ROM | disk | FTP | other *** search
- /*
- **
- ** _levsel.qc (LevelSelect Code, 1.0)
- **
- ** Copyright (C) 1996 Johannes Plass
- **
- ** This program is free software; you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation; either version 2 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program; if not, write to the Free Software
- ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **
- ** Author: Johannes Plass (plass@dipmza.physik.uni-mainz.de)
- **
- */
-
-
- void(entity player) LevelSelectInit =
- {
- if (!USE_MODULE_LEVELSELECT) return;
- // nothing to do
- };
-
- void(entity player) LevelSelectInfo =
- {
- if (!USE_MODULE_LEVELSELECT) return;
- // nothing to do
- };
-
- void() LevelSelectSelectLevel =
- {
- if (!USE_MODULE_LEVELSELECT) return;
-
- // 'mapname' is the name of the level which just ended
- // 'nextmap' is the name of the map quake proposes to be the next one
-
- if ( nextmap == "end" ) nextmap = "dm1" ;
- else if (mapname == "dm6" ) nextmap = "end" ;
- else if (mapname == "end" ) nextmap = "start" ;
-
- return;
- };
-
- /*
- ========================================================================
- EXAMPLE
- ========================================================================
-
- if ( nextmap == "end" ) nextmap = "dm1" ;
- else if (mapname == "dm6" ) nextmap = "end" ;
- else if (mapname == "end" ) nextmap = "start" ;
- else if ( nextmap == "e1m1" ) nextmap = "e1m2" ;
- else if (mapname == "e1m3" ) nextmap = "e1m5" ;
- else if (mapname == "e1m7" ) nextmap = "e1m8" ;
- else if (mapname == "e1m8" ) nextmap = "start" ;
-
- What does the example above ?
-
- Line 1: When Quake wants to play the level "end", we will go to level
- "dm1" instead.
- Line 2: When map "dm6" has ended, Quake usually wants to go to level
- "dm1". But no, we prefer to branch to level "end".
- Line 3: Quake proposes level "e1m1". No, it's ugly, we skip that one
- and go to "e1m2" immediately.
- Line 4: The map "e1m3" just ended. This level has two exits, branching
- to "e1m8" and "e1m4".
- No, we don't like "e1m4" in deathmatch and "e1m8" will be played
- later, so we go to "e1m5" now.
- Line 5: Level "e1m7" just ended and Quake wants to go back to the "start"
- now. We override this and play the secret level "e1m8".
- Line 6: After playing the secret level "e1m8", Quake wants us to play
- "e1m5". However, we already visited this one earlier, so let's
- go the the "start" level.
-
- ===========================================================================
- */
-
-