Author Topic: [XP] Heretic's Control Self Switches Anywhere  (Read 1793 times)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
[XP] Heretic's Control Self Switches Anywhere
« on: September 10, 2013, 10:17:16 AM »
Heretic's Control Self Switches Anywhere
Authors: Heretic
Version: 1.0
Type: Game Utility
Key Term: Game Utility

Introduction

This Script will allow you to Check and Change Self Swtiches from ANY Event on your current Game Map.

Minor Limitations:

It doesnt do anything in Battle or across different Maps.  If you need to check a Switch across Game Maps or in Battle, you'll be better off using a Game Switch instead of a Self Switch.  I've found that most of the Switch Calls that I've needed are done per Event, and almost always on the same Map, so Self Switches does the trick much "cleaner" in most cases, but yes, I still do use Game Switches as well.

NOTE:

The standard Set Move Route does allow for changing a Game Switch from within a Move Route, but there is nothing in there for changing a Self Switch.  You aren't limited to only changing an Events own Self Switches either as ALL Events on a Map can be simply accessed by their Event ID.

The Event ID in Arguments will default to self.id if an Event ID is not specified.  That is useful for copying and pasting events where your Event ID will be an unknown quantity.

Features

  • Allows easy access to Self Switches
  • Very high degree of Compatability
  • Prevents excessive reliance on Game Switches
  • It has Sound!  Only, not really.
  • Provides useful Error Messages when something goes wrong, like an Event doesnt exist.
  • Error Messages need $DEBUG and do not appear in Release Packaged Games
  • Can be called from Move Route -> Script

Screenshots

Screenshots of a Self Switch?  Really?  Okay, fine.

(click to show/hide)

Demo

No Demo at this time.

I am working on a project which will provide an included Demo for this script.  This section will be updated when the project is released.  ETA is roughly about a week or two.

Script

(click to show/hide)

Instructions

Put above Main and Below the Default Scripts.

- get_self_switch('A', event_id)
- set_self_switch('D', true / false, event_id)


Compatibility

Should be 100% compatible with all other scripts out there as the definitions should be unique.
Credits and Thanks

  • I'd like to thank the academy.

Author's Notes

I want to make this compatible with VX and VXA, but dont know if the Class names are different.  Yeah, I know, still never bought VX (probably never going to) or VXA.  I'll post different versions for each just so they're compatible, or one if the Class names in VX and Ace are the same.

This script probably wont be useful to experienced scripters.  It may still have a small value in keeping syntax short and readable instead of one lining key | value pairs, as well as the error messages.

I wrote this a long time ago, in a rather sloppy way.  After doing some heavy Mapping, Eventing, and Scripting recently, I realized how much I actually rely on this script.  Thus if I use it for other stuff as much as I apparently am, it will probably be VERY useful to others.  So I cleaned it up and decided to share.

Enjoy!
« Last Edit: October 03, 2013, 09:42:52 AM by Heretic86 »
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 815
  • LV: 510
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Heretic's Control Self Switches Anywhere
« Reply #1 on: September 10, 2013, 11:22:18 AM »
if you want to make it compatible with VX & VXA, change

Code: [Select]
class Interpreter
into

Code: [Select]
VX    = defined?(Window_ActorCommand)
Klass = VX ? Game_Interpreter : Interpreter
class Klass

and also, why are you limiting it to ABCD? If used correctly it can be used as unlimited switch :???:

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
Re: [XP] Heretic's Control Self Switches Anywhere
« Reply #2 on: September 10, 2013, 12:38:01 PM »
So VX and Ace both use Window_ActorCommand, or just VX?  I was pretty sure they both named Interpreter something else.  Now I know its Game_Interpreter.  Thanks for the heads up on that.

I only put a limit on the Self Switches due to Enterbrains limits of the 4 Self Switches on ther Event Page Condition Interface.  The Unlimited Self Switches didnt cross my mind.  Have to take a peek at it before I give a revision here.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Heretic's Control Self Switches Anywhere
« Reply #3 on: September 10, 2013, 08:51:57 PM »
The values are just strings, you can use anything for the switch value. I have created multiple self-switch scripts in the past, basically just have it check for values dynamically instead of being confined to just ['A', 'B', 'C', 'D'].

Obviously those are the only things that can be set via the editor, but if you are changing them using script calls, you can use 'blah_blah_blah' for a switch name and it would work the same.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 815
  • LV: 510
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Heretic's Control Self Switches Anywhere
« Reply #4 on: September 11, 2013, 11:33:04 AM »
yes VX and VXA use Window_ActorCommand

VX only = Window_BattleMessage
VXA only = Window_BattleActor