Page 1 of 2
[Suggestion]Making script settings non-constant
Posted: 29 Mar 2013, 21:23
by steeffeen
hey there,
i would like to suggest making it possible to change the script settings BY the script itself!
why?
because it can easily happen that players accidentally or intentionally change the script settings to incompatible values making the whole server running buggy and destroying the user experience :/
if the script is able to change a setting it could check the value for validity and change it back if it's invalid, but right now it's impossible as script settings are declared as constant
regards
steff
Re: [Suggestion]Making script settings non-constant
Posted: 29 Mar 2013, 23:29
by Akbalder
The script should not directly use the value if the value can be wrong. It isn't more difficult to do that than to change the settings value automatically.
Re: [Suggestion]Making script settings non-constant
Posted: 29 Mar 2013, 23:41
by steeffeen
Akbalder wrote:The script should not directly use the value if the value can be wrong. It isn't more difficult to do that than to change the settings value automatically.
of course that could be done, but isn't it kind of ugly if the script runs with a completely different value than defined in the script settings?
Re: [Suggestion]Making script settings non-constant
Posted: 29 Mar 2013, 23:52
by Akbalder
I think that it is worst to see your settings automatically modified.
For example, a player would have to know in which order to change the settings to never be in a situation where the settings may be modified automatically.
I prefer that the script do the best choice in function of the asked settings.
Re: [Suggestion]Making script settings non-constant
Posted: 30 Mar 2013, 00:00
by steeffeen
Akbalder wrote:For example, a player would have to know in which order to change the settings to never be in a situation where the settings may be modified automatically.
i don't see the need of knowing any "order", each setting can be checked on its own
for example a time limit: if you call vote the time limit to be "-5", the round will end as soon as it has started... and this value doesn't depend on any other settings
Akbalder wrote:I prefer that the script do the best choice in function of the asked settings.
who/what else should check the settings than the script itself?
i wouldn't like to see a script running with completely different values than defined by the script settings, in fact the settings can be changed that much that you can't even tell how they are supposed to look like...
Re: [Suggestion]Making script settings non-constant
Posted: 30 Mar 2013, 00:31
by spaii
Suggestion :
Copy value of settings in another variable before each start of map.
Example :
#Settings S_TimeLimit 180 as ("Time Limit")
at main() start :
declare CurrentTimeLimit = S_TimeLimit;
and before each start of map, simply copy settings value to declared variable :
CurrentTimeLimit = S_TimeLimit;
then you can check if value of CurrentTimeLimt is okay
for exemple :
if (CurrentTimeLimit < 0) CurrentTimeLimit = 180;
And use this proper variable along your script.
if player change script settings, then it only change at map start and allways checked before map starts.
Re: [Suggestion]Making script settings non-constant
Posted: 30 Mar 2013, 00:33
by steeffeen
i know how i could avoid invalid values!
but as already stated: i don't want that the script runs with completely different values than the users have declared in the script settings!!
Re: [Suggestion]Making script settings non-constant
Posted: 30 Mar 2013, 00:37
by spaii
so sorry, i think i don't understand
I'm going to sleep, then come back tomorrow... zzZzzzzzzZZzzz
Re: [Suggestion]Making script settings non-constant
Posted: 31 Mar 2013, 12:00
by Akbalder
steeffeen wrote:Akbalder wrote:For example, a player would have to know in which order to change the settings to never be in a situation where the settings may be modified automatically.
i don't see the need of knowing any "order", each setting can be checked on its own
for example a time limit: if you call vote the time limit to be "-5", the round will end as soon as it has started... and this value doesn't depend on any settings
In more complicated cases, some settings may be incompatibles with each others. When this happen, automatically chanching the settings values may not be possible.
Re: [Suggestion]Making script settings non-constant
Posted: 31 Mar 2013, 13:22
by steeffeen
Akbalder wrote:In more complicated cases, some settings may be incompatibles with each others. When this happen, automatically chanching the settings values may not be possible.
of course, then you don't have to do that