Author Topic: Race Restrictions per Map  (Read 4721 times)

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Race Restrictions per Map
« on: August 10, 2011, 12:12:55 PM »
Race Map Restrictions
- Restricts races on a specific map

New Server Command:
war3_reloadmapcfg - will reload the current map config file

If this W3S Addon is loaded it will create a war3source/maps folder(in gamemodfolder/cfg/war3source/<mapname>.cfg) + a .cfg file for each map
If you want to restrict for example Corrupted Disciple for scoutknives cause it has strong AoE damage, just open up the map (ex. cfg/war3source/maps/scoutknivez.cfg)
make a new line and enter the shortname of Corrupted Disciple (cd)
IMPORTANT: Only one race shortname is allowed per line

Example:
Code: [Select]
// www.war3source.com - Race Map Restrictions :: config for: scoutknivez.cfg
undead
cd
human
idk
ownz
« Last Edit: August 10, 2011, 03:34:14 PM by Ownz »
#war3source on gamesurge

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Race Restrictions per Map
« Reply #1 on: August 10, 2011, 03:34:24 PM »
edited post, see if its correct

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Race Restrictions per Map
« Reply #2 on: August 10, 2011, 03:46:46 PM »
just use MAXRACES instead of getting the count from W3 get race list or racesloaded


i just made a new system of denying races

http://ownageclan.com/websvn/comp.php?repname=war3source&compare[]=%2F%40451&compare[]=%2F%40449

basically you hook the "deny event" like NoSpySuicide addon and call W3Deny() if you want to deny it
« Last Edit: August 10, 2011, 04:04:45 PM by Ownz »

iceman

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Race Restrictions per Map
« Reply #3 on: December 02, 2012, 12:13:54 PM »
This working still? Should be added to svn since apparently war3_teamlimit fires after map.config

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Re: Race Restrictions per Map
« Reply #4 on: December 15, 2012, 01:25:46 PM »
When is war3config.cfg loaded?  Is it reloaded each map?

Wouldn't it be possible to simply edit where war3source.cfg is loaded, and check whether a map specific .cfg exists, in which case you load it INSTEAD?  I realise you'd have to copy a few settings into all the files, however that would give you a much more powerful way of restricting races, since you could re-order, change item restrictions, etc (and you could restrict races using flags)

Something like (I don't actually know the code to get the mapname...)


Code: [Select]
DelayedWar3SourceCfgExecute()
{
if(W3())
{
                if(FileExists("cfg/war3source/"<MAPNAME>".cfg")
{
ServerCommand("exec <MAPNAME>.cfg");
PrintToServer("[War3Source] Executing <MAPNAME> cfg");
}
else if(FileExists("cfg/war3source.cfg"))
{
ServerCommand("exec war3source.cfg");
PrintToServer("[War3Source] Executing war3source.cfg");
}
else
{
PrintToServer("[War3Source] Could not find war3source.cfg, we recommend all servers have this file");
}
}
« Last Edit: December 15, 2012, 01:30:01 PM by Remy Lebeau »

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Race Restrictions per Map
« Reply #5 on: December 15, 2012, 05:36:33 PM »
war3source.cfg is reloaded each mapchange.
------
Yes of course, I just made it like this to simplify map based restrictions.
SourceMod API - GetCurrentMap();
« Last Edit: December 15, 2012, 05:38:05 PM by Revan »
#war3source on gamesurge

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Race Restrictions per Map
« Reply #6 on: December 15, 2012, 05:41:57 PM »
war3source is reloaded each mapchange as it should be. is the map specific configs not executed 'after' war3source.cfg?

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Re: Race Restrictions per Map
« Reply #7 on: October 13, 2013, 06:31:00 PM »
Updated to use the w3deny for changerace.  It compiles fine, but I haven't tested it.

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: Race Restrictions per Map
« Reply #8 on: April 12, 2016, 12:18:05 AM »
Is there any way of getting this working? Or something similar? For some reason it won't compile, this is what I get:

Code: [Select]
/home/groups/sourcemod/upload_tmp/phpcwia4n.sp(3) : fatal error 182: cannot read from file: "W3SIncs/War3Source_Interface"

Compilation aborted.
1 Error.

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: Race Restrictions per Map
« Reply #9 on: April 12, 2016, 04:33:02 AM »
That says to me that you're trying to compile the sourcecode from an area that doesn't have the required W3Incs

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: Race Restrictions per Map
« Reply #10 on: April 12, 2016, 06:02:47 AM »
Ah yeah, you're right. I'm pretty new to compiling etc. so I assumed the sourcemod web compiler would work. Not entirely sure how else I'm supposed to compile it as I don't have shell access for my gameserver

Edit: Okay I managed to finally get it done! Compiled it locally, after a few failed attempts, and it's now working beautifully :)
« Last Edit: April 12, 2016, 09:07:48 AM by mart3h »