Script Disabler

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by TDS, Aug 2, 2012.

    Tags:
  1. TDS

    TDS - T D S - Veteran

    Messages:
    361
    Likes Received:
    129
    First Language:
    English
    Script Disabler 1.1




    by TDS


    Introduction

    This script allows you to disable groups of scripts without the need to delete them.

    Features

    - Disable scripts

    How to Use

    Instructions are on the script. But here is an example image of the tag name and placing

    [​IMG]

    Script

    Script

    Credit and Thanks

    - TDS

    Author's Notes

    Since this script deals with an internal variable of the system, there might be a few unforeseen bugs related to how scripts may be tracked. The script however never touches the scripts in the database so nothing there should be changed.

    Restrictions

    Only for use in non-commercial games.
     
    Last edited by a moderator: Aug 2, 2012
    #1
    Solistra, ct_bolt, Death10 and 2 others like this.
  2. Helladen

    Helladen Deviant Designer Veteran

    Messages:
    635
    Likes Received:
    183
    Location:
    United States of America
    First Language:
    English
    Wow, very useful!
     
    #2
  3. BigEd781

    BigEd781 undefined method 'stupid_title' found for nil:NilC Veteran

    Messages:
    940
    Likes Received:
    303
    Location:
    Austin, TX
    First Language:
    Dothraki
    Primarily Uses:
    N/A
    So, it's a neat idea, but personally I don't think Ctrl+A Ctrl+Q is any more difficult and it has the same affect.
     
    #3
  4. MakoInfused

    MakoInfused Veteran Veteran

    Messages:
    42
    Likes Received:
    0
    First Language:
    English
    Hm...not to be a spoil sport, but this effect can be achieved without a script, at least not one that has more than 1 word in it. I certainly like the effort, though! Besides, your work did inspire me to speak about my method.

    My way of disabling scripts:

    1. Make a new script entry under "Main" (You can just cut and paste "Main" to move it, if necessary)

    2. Title it "Unused" or whatever you want

    3. in the script area simply write



    Code:
    exit
    Now anytime you want to disable a script just place it below our "Unused" script.

    Explanation: That's it, there is no possible way this script will ever run because before the program can get to it's entry it will have read and interpreted the exit command.
     
    #4
  5. Helladen

    Helladen Deviant Designer Veteran

    Messages:
    635
    Likes Received:
    183
    Location:
    United States of America
    First Language:
    English
    Yes that is true, but when you have a ton of scripts, and you do not want to move them out of that spot, this is the best way to do it. Moving them back and forth is a huge waste of time and effort.
     
    Last edited by a moderator: Aug 2, 2012
    #5
    ct_bolt likes this.
  6. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,515
    Likes Received:
    14,142
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    @Mako The good part about this script is nothing needs to be moved around (The Ctrl+A Ctrl+Q can achieve the same thing). But instead of highlighting everything and CTRL+Qing and if some scripters did that for their comments, since it does happen. You can just put tags. It's helpful if you have 150 scripts, specially <w<;
     
    Last edited by a moderator: Aug 2, 2012
    #6
    Acetonide and Helladen like this.
  7. MakoInfused

    MakoInfused Veteran Veteran

    Messages:
    42
    Likes Received:
    0
    First Language:
    English
    I'll take your word for it :) . I didn't know moving scripts was so troublesome, I guess it never was a problem for me so I dismissed the need for it. I'm glad there is a need though, because even though the script is short it would be a shame if it went unused!

    Edit: Also, I never knew how to use Ruby to get a list of the current scripts in the database, that's neat!
     
    Last edited by a moderator: Aug 2, 2012
    #7
  8. Helladen

    Helladen Deviant Designer Veteran

    Messages:
    635
    Likes Received:
    183
    Location:
    United States of America
    First Language:
    English
    Even though this script is nice, it has a major drawback which caused me to go to Ctrl + A/Ctrl + Q. Whenever you get an error, it will not go directly to that line or even the script if you have disabled scripts above it, because it doesn't take those into consideration.
     
    #8
    BigEd781 likes this.
  9. TDS

    TDS - T D S - Veteran

    Messages:
    361
    Likes Received:
    129
    First Language:
    English
    Yeah, someone testing it gave me an idea of what the error could be.

    Try the new version and let me know if it still causes the error.
     
    #9
    Helladen likes this.
  10. Helladen

    Helladen Deviant Designer Veteran

    Messages:
    635
    Likes Received:
    183
    Location:
    United States of America
    First Language:
    English
    It is fixed, thanks. :)
     
    #10
  11. Drei7717

    Drei7717 Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    is there a way to disable a script during the middle of a game with this?
     
    #11
  12. TDS

    TDS - T D S - Veteran

    Messages:
    361
    Likes Received:
    129
    First Language:
    English
    Nope, this is meant to be used as a testing tool to disable scripts while testing your game.
     
    #12
  13. Drei7717

    Drei7717 Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    ah ok thanks
     
    #13
  14. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,053
    Location:
    Toronto
    First Language:
    English
    I don't see much point in disabling scripts at run-time. If you don't want something to run then just use a flag.

    If a script overrides another class/method definition, and you want to make it so that you can "un-override" it or override it later...there's something wrong with that design.
     
    #14
  15. ct_bolt

    ct_bolt Creator Veteran

    Messages:
    451
    Likes Received:
    85
    Location:
    Planet Earth
    First Language:
    Javascript
    Thanks a bunch for this nice simple script. Saves me a lot of time when debugging. BD
     
    #15
  16. Zeriab

    Zeriab Huggins! Veteran

    Messages:
    1,198
    Likes Received:
    1,250
    First Language:
    English
    Primarily Uses:
    RMXP
    Nice idea :D

    I like that you can disable section of scripts :3

    For single sections I would still make the interpreter stop parsing early. I.e.putting the following code line as the first:

    __END__The downside of this is that it may change the behavior if you merge several sections together into fewer sections.


    I don't see much point in disabling scripts at run-time. If you don't want something to run then just use a flag.

    If a script overrides another class/method definition, and you want to make it so that you can "un-override" it or override it later...there's something wrong with that design.

    There is a different between a script that allows you to turn on and off by a script, and editing each specific script to allow that.

    One use could be to have features disabled to start with, and the enabling them as the game progresses.

    Of course it probably impossible to make such a script in a generic sense.

    *hugs*
     
    Last edited by a moderator: Feb 22, 2013
    #16
  17. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    the key maybe on how the script is loaded in the first place.

    i realize this. if we put TDS script below other script. We CANNOT disable that script.

    so when the

    $RGSS_SCRIPTSvariable changed. the scripts is already loaded.

    until we found out this step there's no way to script something for that.

    even we found a way to 'reload' the script with parameter passed to the loading method to enable the disabled script. but won't all the game object back to initialized?
     
    #17
  18. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,405
    Likes Received:
    2,819
    Location:
    Philippines
    First Language:
    Tagalog
    so basically, this is useful for games in development... pretty neat... 
     
    #18
  19. Misaki

    Misaki Pikalyze Veteran

    Messages:
    156
    Likes Received:
    24
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Nice work!
     
    #19

Share This Page