Create an account


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

#1
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.
Reply

#2
Need to put it into the mapinfo:
Code:
settemp_for_type all <cvar>
[Image: 21.png]
IRC (QuakeNet): #bot.xonotic | #xonotic.pickup | #xonotic | #xonotic.cup
Steam | Twitch.tv | YouTube
Movies: Mirification #1 | #2 | Mirificaption #1 | #3 | #4 | [BOT] Clan #3 | #5 | #6 | #7 | [BOT] Clan #4 | #8 | #9

Reply

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

#4
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.

Code:
#!/usr/bin/perl

# 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
END

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;
        close($fh);
        `/usr/bin/7za a -y \"$filename{'pk3'}\" "$fname"`;
        unlink("$fname");
    }
}

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

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



Possibly Related Threads...
Thread Author Replies Views Last Post
  [NEED HELP] How to do newlines within a setting? Antares* 6 2,059 07-05-2017, 02:37 PM
Last Post: BuddyFriendGuy
  Setting up infinite ammo in instagib? DECtape 4 4,870 11-03-2015, 09:44 PM
Last Post: lister
  [SOLVED] Question about Treasure Island setting BuddyFriendGuy 9 5,274 07-08-2015, 08:50 AM
Last Post: sev
  Server setting => g_antilag ? evit 6 6,033 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-