Create an account

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Per map setting?

Game admins,

I wonder whether it's possible to have a per-map balance setting. Many maps are ported from other games, and some of them requires a bit of modification to make sense. For example, I would like to turn off fall damages for maps with high surfaces.

Is this possible? For example, perhaps there's a way to get the name of the next map, and use that to trigger some alias to set a bunch of variables.

Thanks a lot.

Need to put it into the mapinfo:
settemp_for_type all <cvar>

Thanks, @Mirio. I'll test it out and mark this as solved after I figure it out.

Thanks, @Mirio. Worked like a charm.

For anybody who wants to do the same thing, here's a small script to batch add necessary settings to a bunch of pk3 files.


# this script extracts mapinfo files from the given pk3,
# then add custom settings to the end of the mapinfo file,
# and then repack it back to the pk3 and delete the temp file

my $custom_settings = <<'END';
// prevent any kind of motion damage (bump into a wall, falling, etc.)
settemp_for_type all g_balance_falldamage_maxdamage 0

my %filename;
$filename{'pk3'} = $ARGV[0];
if (!$filename{'pk3'}) {
    die "$0 mapfile.pk3\n";
} elsif (!-e $filename{'pk3'}) {
    die("file not found\n");
my $cmd = "/usr/bin/7z x -y \"$filename{'pk3'}\" maps/\\*.mapinfo";
my @cmd_output = split("\n", `$cmd`);
foreach my $fname (@cmd_output) {
    if ($fname =~ s|^Extracting\s+||) {
        open(my $fh, ">>$fname");
        print $fh $custom_settings;
        `/usr/bin/7za a -y \"$filename{'pk3'}\" "$fname"`;

Here's an example of how I used it to add no-fall-damage setting to all World of Padman maps.

$ mkdir temp
$ cd temp
$ for i in ~/.xonotic/custom_maps/wop/*wop*.pk3; do ~/bin/ "$i"; done
$ cd ..
$ rm -rf temp

Possibly Related Threads…
Thread Author Replies Views Last Post
  [NEED HELP] How to do newlines within a setting? Antares* 6 3,591 07-05-2017, 02:37 PM
Last Post: BuddyFriendGuy
  Setting up infinite ammo in instagib? DECtape 4 6,660 11-03-2015, 09:44 PM
Last Post: lister
  [SOLVED] Question about Treasure Island setting BuddyFriendGuy 9 7,733 07-08-2015, 08:50 AM
Last Post: sev
  Server setting => g_antilag ? evit 6 7,669 02-06-2012, 03:58 PM
Last Post: evit

Forum Jump:

Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-