Script Disabler

● ARCHIVED · READ-ONLY
Started by TDS 19 posts View original ↗
  1. 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



    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.
  2. Wow, very useful!
  3. 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.
  4. 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.
  5. 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.
  6. @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<;
  7. 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!
  8. 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.
  9. 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.
  10. It is fixed, thanks. :)
  11. is there a way to disable a script during the middle of a game with this?
  12. Nope, this is meant to be used as a testing tool to disable scripts while testing your game.
  13. ah ok thanks
  14. Drei7717 said:
    is there a way to disable a script during the middle of a game with this?
    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.
  15. Thanks a bunch for this nice simple script. Saves me a lot of time when debugging. BD
  16. 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.

    Tsukihime said:
    is there a way to disable a script during the middle of a game with this?


    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*
  17. 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?
  18. so basically, this is useful for games in development... pretty neat... 
  19. Nice work!