Raised This Month: $208 Target: $400
 52% 

CVAR 'mapcyclefile' always returns 'mapcycle.txt'


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-10-2009 , 12:11   CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #1

Hi,

I'm trying to retrieve the CVAR mapcyclefile (default value mapcycle.txt) but no matter what I set this to in my server configuration, only the default value is seen.

If I do rcon mapcyclefile, I get the map cycle file I actually configured returned.

It appears AMXX is not getting the correct value. Could I get some help on where the issue could be?
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-10-2009 , 16:45   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #2

Coad plz

and server.cfg
__________________
Bad_Bud is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-11-2009 , 08:46   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #3

Code attached.

Server configuration:
Code:
// Log forwarding
<< my hlsw clients >>


// Essentials
hostname "<< my server name >>"


// Configuration files
servercfgfile "server.cfg"
mapchangecfgfile "static.cfg"
mapcyclefile "mapcycle_two.txt"
motdfile "motd.txt"
bannedcfgfile "banned.cfg"
logsdir "logs"


// Passwords
rcon_password "<< my rcon password >>"
sv_password ""
sv_spectator_password ""


// Core variables
sys_ticrate 1000
fps_max 1000

sv_contact "<< my email address >>"
sv_downloadurl "<< my download url >>"

allow_spectators 1
deathmatch 1
decalfrequency 30
hpk_maxsize 10
pausable 0
skill 3


// Server variables
sv_accelerate 10
sv_aim 0
sv_airaccelerate 10
sv_airmove 1
sv_allowdownload 1
sv_alltalk 1
sv_allowupload 1
sv_bounce 1
sv_challengetime 15
sv_cheats 0
sv_clienttrace 1
sv_clipmode 0
sv_enableoldqueries 0
sv_failuretime 0.5
sv_filetransfercompression 1
sv_filterban 1
sv_friction 4
sv_gravity 800
sv_instancedbaseline 1
sv_lagcompensation 5
sv_lan 0
sv_lan_rate 32768
sv_log_monster_damage 1
sv_log_monster_monster_kills 1
sv_log_onefile 0
sv_log_singleplayer 0
sv_logbans 1
sv_logblocks 1
sv_logrelay 0
sv_maxrate 6144
sv_maxspectators 0
sv_maxspeed 320
sv_maxunlag 1
sv_maxupdaterate 25
sv_maxvelocity 2000
sv_minrate 0
sv_minupdaterate 10
sv_newunit 0
sv_notransition 0
sv_outofdatetime 1800
sv_player_log_frequency 30
sv_proxies 0
sv_region 3
sv_rcon_banpenalty 0
sv_rcon_maxfailures 10
sv_rcon_minfailures 5
sv_rcon_minfailuretime 30
sv_send_logos 1
sv_send_resources 1
sv_sendvelocity 0
sv_spectatormaxspeed 600
sv_spectalk 1
sv_stats 1
sv_stepsize 18
sv_stopspeed 100
sv_timeout 60
sv_unlag 1
sv_unlagpush 0
sv_unlagsamples 2
sv_uploadmax 0.5
sv_voicecodec "voice_speex"
sv_voicequality 5
sv_voiceenable 1
sv_wateraccelerate 10
sv_wateramp 0
sv_waterfriction 1
sv_zmax 32768


// Multi-Player variables
mp_allowmonsters 1
mp_autocrosshair 1
mp_consistency 1
mp_decals 1024
mp_disablegaussjump 0
mp_falldamage 1
mp_flashlight 1
mp_footsteps 1
mp_forcespawn 0
mp_fraglimit 0
mp_friendlyfire 0
mp_logdetail 3
mp_logfile 1
mp_teamplay 1301
mp_telefrag 1
mp_timelimit 60
mp_weaponstay 1


// Sven Co-op variables
mp_allowmonsterinfo 1
mp_banana 1
mp_chattime 4
mp_disable_autoclimb 0
mp_disable_player_rappel 0
mp_dropweapons 1
mp_grapple_mode 1
mp_multiplespawn 1
mp_no_akimbo_uzis 0
mp_noblastgibs 0
mp_npckill 2
mp_playervotedelay 300
mp_respawndelay 6
mp_voteallow 0
mp_votebanrequired 100
mp_votekickrequired 66
mp_votekill_respawndelay 15
mp_votekillrequired 51
mp_votemaprequired 66
mp_votetimebetween 60
mp_votetimecheck 20



// *****************
// AMX Mod X Plugins
// *****************


// AFK Plugin
mp_afktime 180
mp_afkminplayers 5


// Ammo Conservation Plugin
sc_limit_ammo 75.0
sc_limit_minigun 0.0
sc_limit_expendables 0.0
sc_limit_health 80.0
sc_limit_armor 75.0


// HTTP Bans List Fetcher Plugin
amx_httpbans_every 10.0
amx_httpbans_host "<< om nom nom >>"
amx_httpbans_script "/server/getbans.php"


// Information Messages Plugin
amx_chat_imessage 1
amx_top_imessage 0


// Rules Plugin
amx_rules_file "rules.cfg"
amx_rules_interval 3600.0
amx_rules_join 1
amx_rules_join_timeout 15.0
amx_rules_r 255
amx_rules_g 48
amx_rules_b 0
amx_rules_x 0.5
amx_rules_y 0.25


// SCXPM Plugin
amx_scxpm_gamename 1			// Adjust game name (not server hostname), helps promote server.
amx_scxpm_xpgain 10.0			// XP gain multiplier. 1.0 means normal rate (1 XP per point).
amx_scxpm_adminmultiplier 1.5		// Multiply XP gain rate for administrators. 0 = off.
amx_scxpm_allow_ammo556 0		// Allow M16/SAW/minigun ammo to be handed out in ammo recreation.
amx_scxpm_allow_argrenades 0		// Allow M16 grenades to be handed out in ammo recreation.
amx_scxpm_singleplayerlowxpgain 1	// Only allows 1 XP per point if less than 2 players are on.
amx_scxpm_bonusxp 100			// Bonus XP to give after for every "amx_scxpm_bonusxptime" seconds connected.
amx_scxpm_bonusxptime 300		// Bonus XP tick rate (seconds). 0 = off.
amx_scxpm_bonusxpminplayers 3		// Minimum players to provide bonus XP.
amx_scxpm_medalevery 25			// Give a medal for every X levels. 0 = off.


// Secondary FOV for 357 Magnum Plugin
amx_secondary_fov 60
amx_enable_fov 1


// Spray ID Plugin
amx_sprayid_distance 64
amx_sprayid_time 300.0
amx_sprayid_hud 0
amx_sprayid_r 64
amx_sprayid_g 160
amx_sprayid_b 255
amx_sprayid_x -1
amx_sprayid_y 0.4


// Swear/gag Plugin
amx_gag_enabled 1
amx_swear_enabled 1
amx_swear_warnings 5
amx_swear_slap 25
amx_swear_namecheck 1
amx_swear_xpmedal 1
amx_swear_namefix "I had a bad name"


// UnStuck Plugin
amx_unstuck_frequency 10.0



// ****************
// HookMod Settings
// ****************


df_hook_on 1		// Enable HookMod (1/0)
df_hook_password "<< my hookmod password >>"	// Hook requires a password to use (login: hook_login password)
df_hook_usekey 0	// Hook activates via the Use key (annoying!) (1/0)
df_hook_sound 1		// Enable sounds with the hook deploying / hitting target

df_hook_deployspeed 600 // Same units as sv_maxspeed (for swing type only)
df_hook_speed 400	// Same units as sv_maxspeed (from player to hook target)
df_hook_forcespeed 400	// Same units as sv_maxspeed (from player to hook target)
df_hook_hold 86400	// How long you can stay hooked (86400 is 1 day)
df_hook_wait 0		// Wait time before deploying another hook

df_hook_width 16	// How wide is the hooks rope? (same as env_laser)
df_hook_noise 0		// How much interfearance on the hooks rope? (same as env_laser)
df_hook_weapon 0	// Does the hook come out of the players' weapon? (1/0)
df_hook_showspy 0	// Show real team colour (1) for TFC spies, or disguise colour (0)

df_hook_ground 1	// Allow hooking to the ground? (1/0)
df_hook_sky 1		// Allow hooking to the sky? (1/0)
df_hook_players 1	// Allow hooking to other players? (1/0)

df_hook_instant 1	// Hook instantly reaches it's target? (1/0)
df_hook_gravity 1	// Does gravity effect the "instant" type hook? (1/0)
df_hook_swing 1		// Use swing type hook? (1/0)



// *****************
// RadioMod Settings
// *****************


df_radio_on 1		// Enable RadioMod (1/0)
df_radio_dies 1		// Players can shoot radios to kill them (1/0)



// **********************
// Execute Configurations
// **********************


exec amxx.cfg
exec amxx_menus.cfg
exec sql.cfg
// exec banned.cfg
exec listip.cfg
exec this.cfg
Attached Files
File Type: sma Get Plugin or Get Source (nextmap_sven.sma - 1125 views - 7.8 KB)
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-11-2009 , 18:53   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #4

Kind of off topic, and I'm still looking, but how old is this file? Are you working from AMXX 1.8.1? I notice these are all cvars, not pcvars.

Gosh, it's from the latest version? They should look into changing that.

But from what little I understood by looking at the code...

Part of the problem may be that your svenfix is appended on to the end of what's already there. It already performs readMapCycle before it gets to your if statement, where it reads it yet again, changing the g_pos twice. Also sets the lastmapcycle twice. I don't think the cvar is being read incorrectly, because when you turn of the fix it works as it should, and your fix doesn't read in the cvar again.

I can't look at it anymore today, sorry. Maybe in two days I can try again.
__________________

Last edited by Bad_Bud; 01-11-2009 at 19:55.
Bad_Bud is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-11-2009 , 22:41   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #5

This code seems to fully function if the mapcyclefile cvar is left as default, or mapcycle.txt already exists.

The original plug-in is here.

Basically, what I modified has to read the map cycle to see what should have been running now, and if not, ensure we don't skip the map.
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-12-2009 , 01:16   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #6

With amx_nextmap_svenfix set to 0, I had changed the mapcyclefile cvar to newmapcyclefile.txt, and then made another and changed it to oldmapcyclefile.txt, and both times it read the files and worked fine.

I was trying to print out every value that went into every variable into a logfile, but it wasn't printing them, which is what I'm going to mess with next time I look at it -- or what you should do if you don't want to wait for me to mess with it. Either way, I suggest trying to make the fix an either-or option, not an appendage to the already existing plugin. It should be if(svenfix){do svenfix type map checking}else{do it the other way}, instead of {do it}if(svenfix){fix it}.

And you could probably mess around a little bit and combine the if statement and the console command mainly into one function, and if you really want to impress people: change all of those cvars to pcvars.
__________________

Last edited by Bad_Bud; 01-12-2009 at 01:19.
Bad_Bud is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-12-2009 , 08:17   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #7

What game did you try it on?
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-12-2009 , 09:43   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #8

Condition Zero
__________________
Bad_Bud is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-12-2009 , 11:44   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #9

May be a game issue as in Sven Co-op 4, I tried with amx_nextmap_svenfix 0 and it still claimed mapcycle.txt couldn't be found, yet if I type "mapcyclefile" in HLSW's RCON section it returns the modified cvar.
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-13-2009 , 12:45   Re: CVAR 'mapcyclefile' always returns 'mapcycle.txt'
Reply With Quote #10

BTW I thought the way I written it would have been best.

What needs to happen is read the map cycle as normal to determine the next map, but read the previous map to check if it's running now. This is to ensure the map cycle is followed, because if the current map isn't the previous map, it re-schedules the previous map to run again.

That's why I'm reading the map cycle twice.

What's the difference between a CVAR and PCVAR btw?
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:16.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode