[Suggestion]Making script settings non-constant

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

[Suggestion]Making script settings non-constant

Post 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
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    Akbalder
    Posts: 1059
    Joined: 15 Jun 2010, 11:00
    Contact:

    Re: [Suggestion]Making script settings non-constant

    Post 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.
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [Suggestion]Making script settings non-constant

    Post 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?
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      Akbalder
      Posts: 1059
      Joined: 15 Jun 2010, 11:00
      Contact:

      Re: [Suggestion]Making script settings non-constant

      Post 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.
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: [Suggestion]Making script settings non-constant

      Post 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...
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        User avatar
        spaii
        Posts: 1075
        Joined: 19 Jun 2010, 00:04
        Location: Rémy - France
        Contact:

        Re: [Suggestion]Making script settings non-constant

        Post 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.
        Last edited by spaii on 30 Mar 2013, 00:33, edited 1 time in total.
        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2463
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: [Suggestion]Making script settings non-constant

        Post 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!!
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks
          User avatar
          spaii
          Posts: 1075
          Joined: 19 Jun 2010, 00:04
          Location: Rémy - France
          Contact:

          Re: [Suggestion]Making script settings non-constant

          Post by spaii »

          so sorry, i think i don't understand :)

          I'm going to sleep, then come back tomorrow... zzZzzzzzzZZzzz
          Akbalder
          Posts: 1059
          Joined: 15 Jun 2010, 11:00
          Contact:

          Re: [Suggestion]Making script settings non-constant

          Post 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.
          User avatar
          steeffeen
          Translator
          Translator
          Posts: 2463
          Joined: 14 Oct 2012, 16:22
          Location: Germany

          Re: [Suggestion]Making script settings non-constant

          Post 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
            Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

            ManiaControl, FancyManiaLinks
            Post Reply

            Return to “ManiaScript”

            Who is online

            Users browsing this forum: No registered users and 1 guest