PDA

View Full Version : Map Cvar Chooser


CaffeinePowered
05-09-2008, 23:46
This plugin will load a custom cvar list for specified maps, it is meant to expand on the functionality of the default options built into Source, as well as combining the functionality of these two (http://forums.alliedmods.net/showthread.php?p=607079) plugins (http://forums.alliedmods.net/showthread.php?p=598817).

The improvements on previous works are a simpler config and file structure, only one file is required as opposed to several files to accomplish the same functionality.

This plugin supports prefix matching, but not partial name matching.

Cvars Created: None

Config Path
/addons/sourcemod/configs/

Config Structure:
cp_dustbowl
{
cvar 1
cvar 2
}
ctf_*
{
cvar 1
cvar 2
}

Games Tested:
Team Fortress 2

FlyingMongoose
05-10-2008, 11:32
I have tested and this works awesome. Approved.

dann
06-21-2008, 08:49
does this actually work with sourcemod varibles like reserved slots and the afk manager?

PStar
06-21-2008, 10:09
So if i understand it correct it can replace the map config plugins, am i right?

r3dh3adkid
06-23-2008, 20:40
er....dunno why but i'm getting this error

20:39:13 L 06/23/2008 - 20:39:04: [SM] Native "IsEndOfFile" reported: Invalid file handle 0 (error 4)
20:39:13 L 06/23/2008 - 20:39:04: [SM] Debug mode is not enabled for "MapCvar.smx"
20:39:13 L 06/23/2008 - 20:39:04: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 58 on

PStar
06-23-2008, 21:20
er....dunno why but i'm getting this error

20:39:13 L 06/23/2008 - 20:39:04: [SM] Native "IsEndOfFile" reported: Invalid file handle 0 (error 4)
20:39:13 L 06/23/2008 - 20:39:04: [SM] Debug mode is not enabled for "MapCvar.smx"
20:39:13 L 06/23/2008 - 20:39:04: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 58 on

I think there could be something wrong whit your mapcvarlist.cfg.
Could you post yours? I think this could be a missing "{" or "}".

r3dh3adkid
06-23-2008, 22:18
Its quite big....

//List Cvars Between Curly brackets
//One Cvar per line
default
{
//Server Name
hostname "|SovP| Testhouse! [PARTY/Custom Menu/FunSounds/FastSpawn]"

//Default Gravity
sv_gravity 800

//Birthday Mod - On
tf_birthday 1

//Build Restrict - On
sm_buildrestrict_enabled 1

//Build Restriction - Red
sm_buildrestrict_red_dispensers 1
sm_buildrestrict_red_teleport_entrances 1
sm_buildrestrict_red_teleport_exits 1
sm_buildrestrict_red_sentries 1

//Build Restriction - Blue
sm_buildrestrict_blu_dispensers 1
sm_buildrestrict_blu_teleport_entrances 1
sm_buildrestrict_blu_teleport_exits 1
sm_buildrestrict_blu_sentries 1

//Maprate
maprate_autorate_delay 1
maprate_autorate_time 300
maprate_db_config maprate

//Kigen Anti-Cheat
kac_validate 0

//Spam Medic
sm_cvar tf_max_voice_speak_delay -100

//Show Damage Box - Off
sm_cvar sm_showdamage 0

//Advertisements Interval - 15 Seconds
sm_cvar sm_advertisements_interval 15

//Bad Name Ban Immunities - On
sm_cvar sm_bnb_allowimmun 1

//Bad Name Ban Action - (-1 kick, 0 perm)
sm_cvar sm_bnb_bantime -1

//Bad Name Ban Logs - On
sm_cvar sm_bnb_log 1

//Bad Name Ban - Reason
sm_cvar sm_bnb_reason "Do not wear our tags without being in the clan"

//Spawn Protection - On
sp_on 1

//Spawn Protection Time - 5 Seconds
sp_time 5

//Sudden Death Melee - On
sm_suddendeathmelee_enable 1

//Respawn time - 5 Seconds
mp_respawnwavetime 5
}
cp_*
{
// Max number of rounds to play before server changes maps
mp_maxrounds 2

// Max number of rounds one team can win before a server changes maps
mp_winlimit 8
}
ctf_*
{
// Max number of rounds to play before server changes maps
mp_maxrounds 3
}
og_*
{
// Max number of rounds to play before server changes maps
mp_maxrounds 2

// Max number of rounds one team can win before a server changes maps
mp_winlimit 6
}
pl_*
{
// Max number of rounds to play before server changes maps
mp_maxrounds 2

// Max number of rounds one team can win before a server changes maps
mp_winlimit 10
}
sn_*
{
// Max number of rounds to play before server changes maps
mp_maxrounds 2

// Max number of rounds one team can win before a server changes maps
mp_winlimit 10
}
whoaaaaaa
{
sm_buildrestrict_enabled 1

sm_buildrestrict_red_sentries 0
sm_buildrestrict_blu_sentries 0
}
tc_hydro
{
// Max number of rounds to play before server changes maps
mp_maxrounds 2

// Max number of rounds one team can win before a server changes maps
mp_winlimit 8
}
sn_snipervolcano
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
sn_sniper_nsa
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
rj_rckteer
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
pyro_achieve_b1
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
melee_ringking
{
sp_time 2

// Max number of rounds to play before server changes maps
mp_maxrounds 2
}
mario_kart_cp_a11f
{
sm_cvar mp_stalemate_at_timelimit 20
}
duel_octagon_B1
{
mp_respawnwavetime 0
}
duel_inexistence_b3
{
mp_respawnwavetime 0
}
dm_store
{
mp_respawnwavetime 0
}
dm_Shipment_v2
{
sp_time 6

// Max number of rounds to play before server changes maps
mp_maxrounds 15

// Max number of rounds one team can win before a server changes maps
mp_winlimit 0

mp_respawnwavetime 0
}
dm_castlewars_v2
{
mp_respawnwavetime 0
}
dm_biosphere_v3
{
sp_time 4
}
cyberpunk
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
ctf_hallofdeath
{
mp_respawnwavetime 0
sp_time 2
}
ctf_convoy_v2
{
mp_respawnwavetime 0
}
cp_sentrywart14
{
// Max number of rounds to play before server changes maps
mp_maxrounds 2

//changes respawn to 0 (def 10)
mp_respawnwavetime 0

//Enable/disable restricting buildings in TF2.
sm_buildrestrict_enabled 1

sm_buildrestrict_red_dispensers 2
sm_buildrestrict_red_teleport_entrances 2
sm_buildrestrict_red_teleport_exits 1
sm_buildrestrict_red_sentries 2

sm_buildrestrict_blu_dispensers 2
sm_buildrestrict_blu_teleport_entrances 2
sm_buildrestrict_blu_teleport_exits 1
sm_buildrestrict_blu_sentries 2
}
cp_oilrig_b3
{
mp_respawnwavetime 7
}
cp_neodam_b3
{
mp_respawnwavetime 3
}
cp_elimination_b1
{
mp_maxrounds 7
}
cp_corporation_b3
{
mp_respawnwavetime 3
}
cp_beach_final
{
mp_respawnwavetime 4
}
cp_arenaball
{
mp_respawnwavetime 2
}
avanti_b1
{
// Max number of rounds to play before server changes maps
mp_maxrounds 3

// Max number of rounds one team can win before a server changes maps
mp_winlimit 4
}
achievementbox_b3
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
achievement_help
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}
air_gladiator_beta2
{
wait 180000; sm_map sm_nextmap
mp_respawnwavetime 0
}

PStar
06-24-2008, 07:36
Hmm, ther is nothing wrong whit it.....
Could you enable debug info? It could help the author to solve the problem.
Could you write you SM version to?

r3dh3adkid
06-24-2008, 12:59
L 06/24/2008 - 12:55:10: [SM] Native "IsEndOfFile" reported: Invalid file handle 0 (error 4)
L 06/24/2008 - 12:55:10: [SM] Displaying call stack trace for plugin "MapCvar.smx":
L 06/24/2008 - 12:55:10: [SM] [0] Line 90, /home/groups/alliedmodders/forums/files/3/3/1/9/2/26551.attach::LoadCvarList()
L 06/24/2008 - 12:55:10: [SM] [1] Line 55, /home/groups/alliedmodders/forums/files/3/3/1/9/2/26551.attach::OnMapStart()

PStar
06-24-2008, 14:09
Try delete the plugin and reinstall it.
But keep your cfg file.
Try to load the plugin whit the original cfg and after it whit you modified cfg.
And see if it is caused by the modifie cfg or not.

r3dh3adkid
06-24-2008, 14:45
........really noob mistake here....I just realized my filetype got changed to .txt, I've changed it to .cfg and now lets see if it works.

If it doesn't ill test your plan.

[edit]

.txt to .cfg didnt really do anything, i did what you said and it's seemed to work. I removed all of the empty lines and so far it looks like its working.

Also, the default area executes when there are no special cvars for that map correct?

GriMz
07-01-2008, 20:48
does this work for CS:S as well as TF2?

CaffeinePowered
07-16-2008, 08:50
this should work in any mod

As for the errors earlier, I believe you need to end the cfg file with a newline. In testing I never had any issues, but then again, I only used the default config you see above, with a few cvars in each to make sure it was working correctly.

Default executes when it can not find a particular map or a prefix for the map type

Falcon1
05-28-2009, 07:31
pls delete post

MMax
06-01-2009, 20:05
fix line 203:
GetArrayString(Map_Cvars, i, command, 80);

to:
GetArrayString(Default_Cvars, i, command, 80);

And it works fine with default parameters. :wink:

Wyrda Ebrithil
04-11-2010, 04:01
the default doesnt seem to be working for me...
//List Cvars Between Curly brackets
//One Cvar per line
default
{
sv_gravity 800

}
gg_super_mario_reloaded
{
sv_gravity 350
}



map changes to gg_super_mario_reloaded and the gravity is reset to 350

map changes to gg_fy_funtimes and the gravity stays at 350 instead of changing back to 800

CMCW
11-09-2011, 19:13
say i only wanted 2 maps of my rotation to have reduced time but other then that be my regular server config rules.

do i only add one line?

or do i need to completley re configure every line for each of those maps.

CMCW
11-09-2011, 20:49
I had problems with this mod with gravity carrying onto every server. also time limit seemed to work but would get stuck at 0, what am i doing wrong or is there another plugin for this everyones using now?

CMCW
11-10-2011, 21:25
is support to this dead?

gH0sTy
11-14-2011, 00:22
I had problems with this mod with gravity carrying onto every server. also time limit seemed to work but would get stuck at 0, what am i doing wrong or is there another plugin for this everyones using now?
You'll need to add the gravity cvar with its default value to the server.cfg so it'll be set after a map change.
I'm using the Map configs (https://forums.alliedmods.net/showthread.php?p=607079) plugin.

417
02-28-2012, 19:18
Thanks CaffeinePowered for making this plug-in to simplify issuing map specific CVARS.

I just got it running for an orangebox source server installation for - Stargate: The Last Stand.

I ran into an issue with getting it to work which I figured out how to resolve and realized that nothing was said about it (it is only implied) so I figured I would make a reply to this post so people know it.

If you use this plug-in to change multiple CVARS for specific maps you need to make sure and list the default configurations for each CVAR you have listed to change per map in your mapcvarlist.cfg file under the configs default section. Otherwise, it won't work right (it will just load whatever you have for that particular CVAR your server.cfg file).

If you forget to list even one of the CVAR variables you change for a specific map in the 'default' section of your mapcvarlist.cfg file then the plugin won't do what it should for any of the CVARS listed for each specific map.

Example:

//List Cvars Between Curly brackets
//One Cvar per line
default
{
mp_timelimit 20
sv_alltalk 0
sv_gravity 800
}
tls_abydos
{
mp_timelimit 45
}
tls_blargh_rawr2
{
sv_alltalk 1
echo "All Talk is ON for this map"
}
MapName
{
sv_gravity 600
}

NOTE: All CVARS wanting to be changed per map are listed in the 'default' area of the mapcvarlist.cfg file.