[Fixed] making a cvar for auto map_restart

9 replies [Last post]
^t
smasherchif's picture
Offline
Joined: Oct 2009
Posts:

hello, e+ devs.

how about making a cvar (for example, xp_maprestart) that will hold list of custom (config-specific) var names for automatically performing map_restart if one of them changed via callvote.
example: consider we have plusn.cfg (or plusc, or whatever with custom vars - it doesn't matter). we want to change xp_freezestyle via callvote. we vote yes, vote succeedes and we have to wait until next map for changes to take effect. but if this custom var is contained in xp_maprestart list, the server will automatically restart map (as it does when voting on g_gametype cvar succeedes).
so, we would have smth like this in server start script:
blah-blah-blah1
set xp_maprestart "xp_freezestyle, xp_itemstyle"
blah-blah-blah2
(if the server admin/owner doesn't want to mess with that thing he simply will not edit default value of that cvar: '', that's it).

and one more thing: is this possible to implement 'reloading' server cfg upon changing custom vars via callvote without map_restarting (without resetting the game and starting new match, i.e. on-the-fly)? i guess server could perform some kinda preprocessing to ensure if restart is needed or not (e.g. if some 'critical' cvars are changed by config or not: g_gametype, etc). if so, that would be great.

with respect, illca.


.aNk/xXxp4l/:bR.Shady'XYN! wrote:
Fuck! I just thought of the most awesome pun about the BC vs Smurfs final game and the flames that followed :
"In Soviet Moldavia, Pole rages YOU"
like 2 months after Call me

3M'darkangel wrote:
// 09:30:49 27.06.2010, UNKNOWN LOCATION,
Name { "Biotoxin" }
IP { "localhost" }

SHUDDER wrote:
People are training hard to hide their autoshoot so well while gain enough skills to win (or at least compete on similar level) without them. This is getting insane or provoked. I feel like I would cut myself with Ockham's Razor if I claim a cheat there.

¯¯__█ALI█¯¯__
xpaliminium's picture
Offline
Joined: Nov 2005
Posts:
Re: [suggestion] making a cvar for auto map_restart

I think the answer will be :
Won't implement.

You can make a cvar and add it on callvote list if I remember well containing something predefined
seta item1 "xp_itemStyle 1; map_restart"
note that you can use http://www.excessiveplus.net/documentation/server/server-cvars-commands#execstr

Wanna avoid seeying mow, skull & co Surprise

Check this peacefull place

^t
smasherchif's picture
Offline
Joined: Oct 2009
Posts:
Re: [suggestion] making a cvar for auto map_restart

i guess we should wait for devs to answer Happy
thanx for info, ali.


.aNk/xXxp4l/:bR.Shady'XYN! wrote:
Fuck! I just thought of the most awesome pun about the BC vs Smurfs final game and the flames that followed :
"In Soviet Moldavia, Pole rages YOU"
like 2 months after Call me

3M'darkangel wrote:
// 09:30:49 27.06.2010, UNKNOWN LOCATION,
Name { "Biotoxin" }
IP { "localhost" }

SHUDDER wrote:
People are training hard to hide their autoshoot so well while gain enough skills to win (or at least compete on similar level) without them. This is getting insane or provoked. I feel like I would cut myself with Ockham's Razor if I claim a cheat there.

^t
smasherchif's picture
Offline
Joined: Oct 2009
Posts:
Re: [suggestion] making a cvar for auto map_restart

ehm, i wonder does any of devs read feedback forum? Confused


.aNk/xXxp4l/:bR.Shady'XYN! wrote:
Fuck! I just thought of the most awesome pun about the BC vs Smurfs final game and the flames that followed :
"In Soviet Moldavia, Pole rages YOU"
like 2 months after Call me

3M'darkangel wrote:
// 09:30:49 27.06.2010, UNKNOWN LOCATION,
Name { "Biotoxin" }
IP { "localhost" }

SHUDDER wrote:
People are training hard to hide their autoshoot so well while gain enough skills to win (or at least compete on similar level) without them. This is getting insane or provoked. I feel like I would cut myself with Ockham's Razor if I claim a cheat there.

EQUILIBRIUM
telox's picture
Offline
Joined: Jul 2005
Posts:
NL Netherlands
Re: [suggestion] making a cvar for auto map_restart

On topic: Why do you need devs answer when Ali already said how it can be done? Do you see any drawbacks in the way he suggested?

Off topic: There is no need to doublepost (for example to give your thread extra attention), if you use the EDIT button, your last post date changes to a more recent one and it is displayed as the last post in the category, so it's as if you replaced your old post with a new one, you just get 1 post less, but it makes it for others more enjoyable to read.

----------------------
|ZOO| team - Connecting people.

^t
smasherchif's picture
Offline
Joined: Oct 2009
Posts:
Re: [suggestion] making a cvar for auto map_restart

as for ali's answer - this is not the feature i asked for (anyway, thanx ali, maybe i will use that). this is not the same thing and it's inconvenient to use. what if xp_freezestyle gets new value? right, we should make a new var then. what if some custom var has a range of acceptable values something like 0..120? what should we do then? right, seta item100500 "xp_somecvar 100500; map_restart". that's an obvious drawback - creating things like this one: seta item "blah-blah-blah" for each var value.

equi << and this is not the only thing i asked about. plz, read the post carefully. you don't need to be so smart, do you?


.aNk/xXxp4l/:bR.Shady'XYN! wrote:
Fuck! I just thought of the most awesome pun about the BC vs Smurfs final game and the flames that followed :
"In Soviet Moldavia, Pole rages YOU"
like 2 months after Call me

3M'darkangel wrote:
// 09:30:49 27.06.2010, UNKNOWN LOCATION,
Name { "Biotoxin" }
IP { "localhost" }

SHUDDER wrote:
People are training hard to hide their autoshoot so well while gain enough skills to win (or at least compete on similar level) without them. This is getting insane or provoked. I feel like I would cut myself with Ockham's Razor if I claim a cheat there.

lagstard
Developer (retired)
rabusmar's picture
Offline
Joined: Jan 2008
Posts:
Re: [suggestion] making a cvar for auto map_restart

Your suggestion seems interesting. However, the problem is that we can only track for modifications on cvars used by the mod, so implementing that is not possible.

However, I offer you an alternative: a /cmd2 (alias /c) command for defining new "commands" that would accept parameters. It would work like this:

  • You define the command in a cvar, like this:
    // strings of the form $(X), where x is a number,
    // will be replaced by the parameters passed
    // this will set xp_itemStyle to the first parameter and restart the map
    set set_items "set xp_itemStyle $(1); map_restart"

  • You add the string cmd2 <cvarname> (or c <cvarname>) to callvote, like this:
    // add the "command" to vote string
    set xp_vote "c set_items"

  • In the server, callvote the command, like this: /callvote "c set_items" 1

If the need to enclose the command with brackets seems too ugly, we might come with some convention, like for example that every string of the form =cvarname inside vote/referee string can be expanded to /cmd2 =cvarname (or simply /cmd2 cvarname), so you would have to do /callvote =cvarname param instead, or something like that.

About the second suggestion, won't implement. The config is loaded only once when map is starting, and it will be like that to keep the implementation details simple.

Había una vez un barco chiquito...

^t
smasherchif's picture
Offline
Joined: Oct 2009
Posts:
Re: [suggestion] making a cvar for auto map_restart

wow, that's great alternative, beast! i love it Happy /callvote =cvarname param - cool. thanx a lot.
a little question though: why can't we use a conventional assignment operator? i mean: /callvote cvarname=param.


.aNk/xXxp4l/:bR.Shady'XYN! wrote:
Fuck! I just thought of the most awesome pun about the BC vs Smurfs final game and the flames that followed :
"In Soviet Moldavia, Pole rages YOU"
like 2 months after Call me

3M'darkangel wrote:
// 09:30:49 27.06.2010, UNKNOWN LOCATION,
Name { "Biotoxin" }
IP { "localhost" }

SHUDDER wrote:
People are training hard to hide their autoshoot so well while gain enough skills to win (or at least compete on similar level) without them. This is getting insane or provoked. I feel like I would cut myself with Ockham's Razor if I claim a cheat there.

¯¯__█ALI█¯¯__
xpaliminium's picture
Offline
Joined: Nov 2005
Posts:
Re: [Fixed] making a cvar for auto map_restart

Wooohooo Big grin

I was like Oo, I have thought that I have missed such command, but it isn't released yet. Happy

Wanna avoid seeying mow, skull & co Surprise

Check this peacefull place

^t
smasherchif's picture
Offline
Joined: Oct 2009
Posts:
Re: [Fixed] making a cvar for auto map_restart

nah, ali, i don't think you would miss such a command Big grin


.aNk/xXxp4l/:bR.Shady'XYN! wrote:
Fuck! I just thought of the most awesome pun about the BC vs Smurfs final game and the flames that followed :
"In Soviet Moldavia, Pole rages YOU"
like 2 months after Call me

3M'darkangel wrote:
// 09:30:49 27.06.2010, UNKNOWN LOCATION,
Name { "Biotoxin" }
IP { "localhost" }

SHUDDER wrote:
People are training hard to hide their autoshoot so well while gain enough skills to win (or at least compete on similar level) without them. This is getting insane or provoked. I feel like I would cut myself with Ockham's Razor if I claim a cheat there.