Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enable/Disable Scripts Easily + Script Exist?
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


This is for enabling/disabling scripts with ease, as well as returning whether or not a script exists in your editor.

Warning from TsunokietteHas not been tested yet.


EDIT: see later post

add this attribute accessor to each script you want to be able to enable/disable-

Code:
attr_accessor   :status

and then under the initialize method, add this -

Code:
#-----------------
# alias initialize
#-----------------
alias    :initialize_original    :initialize
def initialize
    @status = 'enabled'
    initialize_original
end
#---------
# Status
#---------
def status
    return @status
end

* How to Use *




To call a script with the newly added enable/disable ability, simply use this line

Code:
Script.new(script_name)

eg.
Code:
Script.new(Scene_Menu)

even if it's a scene


To disable it, use this line

Code:
Script.disable(script_name)

eg.
Code:
Script.disable(Scene_Menu)


To enable a script once it's been disabled, use this line

Code:
Script.enable(script_name)

eg.
Code:
Script.enable(Scene_Menu)


To return whether or not a script exists in the editor, use this line

Code:
Script.exist?(script_name)

eg.
Code:
Script.exist?(Scene_Menu)

Warning from TsunokietteThat should be all you need, If it doesn't work, please say so, as well I'd like any scripting 'Gurus' to help me develope this into something even simplar. Thank you for your time and interest.
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change character script jaigai 0 2,796 11-19-2006, 01:00 PM
Last Post: jaigai
  Just a modification of Abyssos' facs script lumina... 0 2,633 11-01-2006, 01:00 PM
Last Post: lumina...
  Credit Script 1.1 acoole 0 2,473 10-24-2006, 01:00 PM
Last Post: acoole
  Script Dev Kit Nick 0 2,844 10-15-2006, 01:00 PM
Last Post: Nick
  Opening Image script sasuke89 0 2,059 07-24-2006, 01:00 PM
Last Post: sasuke89
  Change Color of The diferent Status Script MASTERLOKI 0 2,311 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Event Name and ID Search Script Hadriel 0 2,077 06-21-2006, 01:00 PM
Last Post: Hadriel
  Currency Script Split 0 2,312 05-18-2006, 01:00 PM
Last Post: Split
  Book Script and Utility Bruth 0 2,262 05-07-2006, 01:00 PM
Last Post: Bruth
  Individuality Script DrakoShade 0 2,222 03-12-2006, 01:00 PM
Last Post: DrakoShade



Users browsing this thread: