Individual map configurations (mapcfg)

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Individual map configurations (mapcfg)

Postby Dokujisan » Fri Nov 10, 2006 8:10 pm

Is it possible to setup special server settings per map, such as gravity, starting health, etc?

if yes, would this be within the mapcfg file?

If I set one map to a specific gravity, do I then have to define gravity for the rest of the maps? Or will the rest of the maps just take the settings from the server.cfg?

thanks :-)
Dokujisan
Forum addon
 
Posts: 1199
Joined: Sat Oct 07, 2006 4:31 pm
Location: Louisville, Kentucky

Postby KadaverJack » Fri Nov 10, 2006 8:36 pm

Yes you can, that's what mapcfg files are meant for ;)

example mapcfg:
Code: Select all
set fraglimit 30
set timelimit 20
set sv_gravity_save $sv_gravity
set sv_gravity 200
set exit_cfg <your.exitcfg>
changelevel <mapname>


and to reset gravity you'll need an exitcfg like:
Code: Select all
set sv_gravity $sv_gravity_save


Edit: exit_cfg handling is broken in 2.1, you'll need a newer build of the gamecode. either make on yourself from svn://svn.icculus.org/nexuiz/branches/n ... rc/server/ or get the lastest test-patch from http://141.2.16.3/nex/
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby esteel » Fri Nov 10, 2006 8:49 pm

You can take a look at the files in Nexuiz. The files no longer because all the stuff is commented out but its still intact so you should get the idea:
Nexuiz/data/maps/rune_aneurysm.mapcfg and rune_aneurysm_exit.cfg . This naming scheme is actually good for this kind of thing.
Its also explained in Nexuiz/Docs/mapping.txt:
---------------
-ii. exit cfgs-
---------------

In order to solve our laser jumping problem, we need to call upon another feature of mapcfgs -- map exit scripts or "exit cfgs". These are called when the map is changing, before the next map's mapcfg is run. You can use them to clean up any special changes you've made so they won't affect the next map.

For our laser jumping example, we could do something like this:

// set up the exit cfg so we can reset values to what they were before
set exit_cfg "maps/dom_wazat1_exit.cfg"
// make a backup
set BACKUP_g_balance_laser_force $g_balance_laser_force
// map-customized values here
set g_balance_laser_force 100
// and on with the rest of the config
set g_domination 1 // turn on domination
set fraglimit 100 // 100 points to win
set timelimit 15 // 15 minute max round time
set changelevel wazat1 // now change level
cd loop "8" // play music

Then we would make the exit cfg, named "dom_wazat1_exit.cfg":

// reset laser damage
set g_balance_laser_force $BACKUP_g_balance_laser_force


When my wazat1 map is run in domination, the laser's force will only be 100. However, before the map changes, it gets set back to what it was before. This is because the original value was stored in BACKUP_g_balance_laser_force, then BACKUP_g_balance_laser_force was copied back into g_balance_laser_force when the exit cfg ran.


You can set all kinds of values like this, including fog and gameplay options.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am


Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron