public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

An Enable / Disable script, your thoughts?

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: An Enable / Disable script, your thoughts?
  • Original author: Napoleon
  • Original date: June 10, 2014
  • Source thread: https://forums.rpgmakerweb.com/threads/an-enable-disable-script-your-thoughts.28236/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support

Summary

{ "lightbox_close": "Close", "lightbox_next": "Next", "lightbox_previous": "Previous",

Archived First Post

Protected download

I counted 140+ scripts in my project. Obviously script compatibility debugging becomes an issue at some point. Or I commission a new script and then it bugs in my project because one of my own scripts may not be compatible.

Outcommenting over a 100 scripts every time that happens is such a waste of time and sadly Ace has no way to turn scripts on/off so I came up with a script to do that.

You have to add your script to the $scripts = [] array and you have to add these 2 lines:

if !$imported || ($imported[:nap_script_boss] && Script_Boss.script_enabled?nap_rnd_dialogue))# <your script here>end # Script BossI can not seem to find a way around adding those 2 lines because the scripts are loaded by the closed internal code of Ace. If someone knows a legal way around it, please enlighten me.

It seems rather complicated but it does save me a LOT of time. I can now disable entire batches of scripts and not worry about any crashes. I repeat this until the script works and then I know what script(s) caused the incompatibility. Or are there better solutions?

Full script:

#-----------------------------------------------------------------------------=beginWhy:I got so tired of [ctrl]+[q]'ing entire scripts or adding 'if true/false end'to them to enable/disable them. It get's worse when they have dependencies.About:When a script is enabled while one or more of it's dependencies are disabledthen this script will either enable all those depenencies or just disable thescript (and then all scripts that have that script as a dependency).Instructions:- Place this script on before any other script that is listed here.- Add a new entry to: $scripts = []- Add the 2 lines listed below around your script.Copy-Paste stuff:if !$imported || ($imported[:nap_script_boss] && Script_Boss.script_enabled?REPLACE_ME))# <your entire script goes here>end # Script BossLicense:- All rights reserved (for now). (Currently not released)=end#-----------------------------------------------------------------------------$imported ||= {}$imported[:nap_script_boss] = 2.00#===============================================================================# Script Reporting & Enable/Disable Preferences#===============================================================================module Script_Boss ON_MISSING_DEPENDENCY_ACTION = :disable # possible values: :enable, :disable REPORT_ENABLED_DEPENDENCIES = true REPORT_DISABLED_DEPENDENCIES = true REPORT_ENABLED_SCRIPTS = false REPORT_DISABLED_SCRIPTS = true # - Array of scripts that you need enabled. # - Everything else will be disabled. But dependencies will be enabled as well # of course. # - ALWAYS_ENABLED entries are still enabled. DISABLE_ALL_EXCEPT = [] # Disables the scripts by index. Excluding ALWAYS_ENABLED entries. # value: [min, max] DISABLE_RANGE = [] DISABLE_CATEGORIES = [] # Disables all scripts from these categories. ALWAYS_ENABLED entries are still enabled. ALWAYS_ENABLED = [:nap_ev_text, :set_win_size, :skip_title_scrn, :khas_lighting_v2, :route_helper, :event_finetuning] # list of keys that are always enabled no matter what. REPORT_SCRIPT_INDEX = -1 # -1 disables it. Set to a value to retrieve the name of the script for the specified value.end#===============================================================================# Class SBoss#===============================================================================class SBoss attr_reader :key, :category, :req_scripts attr_accessor :enabled def initialize(key, script_enabled, category, *req_scripts) raise if script_enabled.class == Array @key = key; @enabled = script_enabled; @category = category; @req_scripts = req_scripts end # Transforms the @req_scripts from keys into actual SBoss classes def translate_req_scripts return if @req_scripts.empty? translated = [] req_scripts.each { |k| req = $scripts.find{ |s| s.key == k} raise "ERROR: Required script '#{k}' for '#{@key}' not found while translating!" if req.nil? translated << req } @req_scripts = translated end def enable_req_scripts(key = nil) # If the dev doesn't want to enable the dependencies then disable the script that requires them instead. if Script_Boss:N_MISSING_DEPENDENCY_ACTION == :disable req_scripts.each { |req| if !req.enabled @enabled = false print "■ Disabled: '#{@key}' because it requires '#{req.key}'.\n" if Script_Boss::REPORT_DISABLED_DEPENDENCIES return end } return end return if key == @key # return if it is starting to loop (found itself again) req_scripts.each { |req| if !req.enabled req.enabled = true print "■ Enabled: '#{req.key}' because '#{@key}' requires it.\n" if Script_Boss::REPORT_ENABLED_DEPENDENCIES end key = @key if key.nil? # If it's the first in the recursive-tree then set the value to the 'initial caller'. req.enable_req_scripts(key) } endend#===============================================================================# Script Settings#===============================================================================# Turning on/off scripts happens here.SKIP_TITLE = true$scripts = [ SBoss.newfix_passability, true, :bugfix), SBoss.newfix_f12, true, :bugfix), SBoss.newfix_text_cache, true, :bugfix), SBoss.newnap_inifile, true, :core), SBoss.newunlimited_resolution, true, :misc, :nap_inifile), SBoss.newset_win_size, true, :misc), SBoss.newfulscreen_pp, true, :misc), SBoss.newevent, true, :core), SBoss.newevent_hook, true, :core, :event), SBoss.newinitialization, false, :core, :event_hook), SBoss.newperm_cache, false, :core, :event_hook, :nap_map_overlay), SBoss.newnap_map_overlay, false, :misc), SBoss.newgeneric_audio, false, :misc), SBoss.newnap_core, true, :core), SBoss.newpoint, true, :core), SBoss.newnap_npc_rnd, false, :misc), SBoss.newrectangle, true, :core, oint), SBoss.newsprite_ani, true, :core, :rectangle), SBoss.newsettings_mgr, true, :core, :event_hook, :achievement), SBoss.newnap_image, true, :misc), SBoss.newmagazines, true, :misc, :settings_mgr, :nap_core), SBoss.newalien_shooter, false, :minigame, :rectangle), SBoss.newtelephone, true, :menu), # <snip> SBoss.newfps, true, :debug),] # Do not edit/remove this character#===============================================================================# Enable / Disable scripts based on preferences#===============================================================================module Script_Boss # Set script dependency class references $scripts.each { |s| s.translate_req_scripts } $scripts.each_with_index { |s, i| if !s.enabled s.enabled = true if ALWAYS_ENABLED.include?(s.key) next end if !DISABLE_ALL_EXCEPT.empty? s.enabled = false if !DISABLE_ALL_EXCEPT.include?(s.key) next end if !DISABLE_RANGE.empty? s.enabled = false if i.between?(DISABLE_RANGE[0], DISABLE_RANGE[1]) next end if !DISABLE_CATEGORIES.empty? s.enabled = false if DISABLE_CATEGORIES.include?(s.category) end } # Enable Dependencies $scripts.each { |s| s.enable_req_scripts if s.enabled } #============================================================================= # Report enabled/disabled dependencies (if applicable) #============================================================================= if REPORT_ENABLED_SCRIPTS || REPORT_DISABLED_SCRIPTS $scripts.each{ |s| if s.enabled print "* Enabled: '#{s.key}.\n" if REPORT_ENABLED_SCRIPTS elsif REPORT_DISABLED_SCRIPTS print "» Disabled: '#{s.key}.\n" end } end #============================================================================= # End Reporting #============================================================================= enabled = 0; disabled = 0 $scripts.each{ |s| s.enabled ? enabled += 1 : disabled += 1 } enabled_perc = (enabled / (enabled.to_f + disabled)).round(2) print "=============================================================================\n" print "[#{ ('■' * (enabled_perc * 10)).ljust(10) }] #{(enabled_perc * 100).to_i}% #{enabled} enabled and #{disabled} disabled scripts out of #{enabled + disabled} total.\n" print "=============================================================================\n" print "Script at index #{REPORT_SCRIPT_INDEX}: #{$scripts[REPORT_SCRIPT_INDEX].key} \n" if REPORT_SCRIPT_INDEX != -1 #============================================================================= # Script_Boss.script_enabled?(key) #============================================================================= def self.script_enabled?(script_symbol) script = $scripts.find { |s| s.key == script_symbol} raise "[Line:#{__LINE__}] Script not added to Script Boss array: #{script_symbol}" if script.nil? return script.enabled endend # module Script_Boss#===============================================================================# ■ End of Script ■#===============================================================================
I did notice that disabling the range as well as the counting for the enabled scripts are bugged lol. I forgot to include the 'dependency-disabled scripts' to the total count.

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

License / Terms Note

#-----------------------------------------------------------------------------=beginWhy:I got so tired of [ctrl]+[q]'ing entire scripts or adding 'if true/false end'to them to enable/disable them. It get's worse when they have dependencies.About:When a script is enabled while one or more of it's dependencies are disabledthen this script will either enable all those depenencies or just disable thescript (and then all scripts that have that script as a dependency).Instructions:- Place this script on before any other script that is listed here.- Add a new entry to: $scripts = []-...

Referenced Images / Attachments

script boss ss.png
script boss ss.png
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#rgss-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar