RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Script Disabler

0 Members and 1 Guest are viewing this topic.

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
Script Disabler
Version: 1.1
Author: TDS
Date: August 2, 2012

Version History


  • 1.0 2012.08.1 - Public Release
  • 1.1 2012.08.2 - Error check bug fix

Description


This script allows you to disable other scripts.

Features

  • Disable scripts in a group or many groups.

Instructions

Instructions are on the script, but here is an image of how it should look.



Any script between those 2 will be ignored by the engine.

Script


Code: [Select]
#==============================================================================
# ** TDS_Script_Disabler
#    Ver: 1.1
#------------------------------------------------------------------------------
#  * Description:
#  This Script allows you to disable a group of scripts.
#------------------------------------------------------------------------------
#  * Features:
#  Disable scripts.
#------------------------------------------------------------------------------
#  * Instructions:
#
#  To disable a group of scripts make 2 new blank scripts and in their name
#  add this:
#
#  <Disabled_Scripts>
#
#  </Disabled_Scripts>
#
#  Any scripts put between these 2 new scripts will be disabled at the start
#  of the game.
#------------------------------------------------------------------------------
#  * Notes:
#  The script names are the names on the left side box not inside the script
#  itself.
#
#  There is no limit to the amount of scripts groups you can disable.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
#   way from the consequenses.
#==============================================================================
# * Import to Global Hash *
#==============================================================================
($imported ||= {})[:TDS_Script_Disabler] = true

# Scripts Delete List Array
delete_list = []
# Delete Activd Flag
delete_active =  false
# Go through Scripts
$RGSS_SCRIPTS.each_with_index {|data, i|
  # Activate or Deactivate Delete Active Flag
  delete_active = true  if data.at(1) =~ /<Disabled_Scripts>/i
  delete_active = false if data.at(1) =~ /<\/Disabled_Scripts>/i
  # Add Script Data to Delete Scripts if delete flag is active
  delete_list << i if delete_active
}

# Clear Text in Scripts
delete_list.each {|i| $RGSS_SCRIPTS[i][2] = $RGSS_SCRIPTS[i][3] = ""}
# Clear All Delete Values
delete_list = delete_active = delete_list = nil


Credit


  • TDS


Support


On this topic.

Known Compatibility Issues

None that I'm aware of so far.

Author's Notes


I am aware there are many other ways to disable scripts such as adding __END__ at the top of a script or just commenting it out completely with CTRL + A  then  CTRL + Q, or simply just putting it below main, and this script is just another option. It helps me a lot while working on larger scripts and I thought it would help other scripters too.

Terms of Use

Only for use in non-commercial games.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
That's a neat idea TDS. Very helpful for scripters too, especially when looking for sources of incompatibility.

**
Rep: +0/-0Level 55
RMRK Junior
Is it possible to Activate YOUR script using a script call and Disable it?

I.e to make a script call to allow your script to disable other scripts, and to make another script call that disallows your script from disabling the other scripts?

Because that would solve so many compatibly issues...
Please respond.

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
No, it's not possible to disable scripts on command. This script is more of a tool for scripters to disable large amounts of scripts or people who are debugging their games and want to find a script which is causing problems.

As for disabling scripts, it usually would not solve compatibility issues since many custom systems may depend on other scripts and disabling them could cause more incompatibility problems.

@modern algebra: Thanks, I got lazy while working on battle systems and having to __END__ scripts and I thought other scripters might be lazy as well.

**
Rep: +0/-0Level 55
RMRK Junior
Could you make a script call to activate or disable scripts, if its possible.

Thanks in advance.
« Last Edit: August 25, 2012, 06:07:35 AM by Sievn »

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
It would be possible to do, but indexing would be terrible. There is no real visible way to obtain the index of a script other than counting them or guessing. It could be done by name, but that would mean all scripts that share the same name would be disabled as well.

I'll see what I can do.

**
Rep: +0/-0Level 55
RMRK Junior
It would be possible to do, but indexing would be terrible. There is no real visible way to obtain the index of a script other than counting them or guessing. It could be done by name, but that would mean all scripts that share the same name would be disabled as well.

I'll see what I can do.

Thanks, really appreciate it.

*
Rep: +0/-0Level 39
RMRK Junior
Did you see anything TDS?

I too would appreciate a script call so i can add the function to scripts lacking it. 

usefull for toggle  "same_script_v.1" or "same_script_v.2"

about indexing, user specified script count?