Author Topic: [XP][VX][VXA] Heretic's Auto State Switches  (Read 1834 times)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
[XP][VX][VXA] Heretic's Auto State Switches
« on: October 01, 2013, 01:56:59 PM »
Heretic's Auto State Switches
Authors: Heretic, LittleDrago
Version: 1.03
Type: Automatic Game Switch Controller
Key Term: Environment Add-on

Introduction

This Script will automagically Enable and Disable a specified Game Switch when a Party Member has a specified State, such as a Spell Effect, or certain type of Armor equipped.

Features

  • Enables specific Game Switches to be Enabled or Disabled Automagically
  • Affects Game Switches, not Self Switches, so MANY Events can be altered
  • Unlimited Number of Spell Effects / Game Switches
  • One State can change Multiple Switches if desired
  • Highly Useful for Event Page Changing
  • Townsfolk can be given different Dialogues on different Pages more easily
  • Enemy NPCs can have Different "Behaviors" (Attack, Run Away, etc)
  • Highly Useful in Battle Eventing with compatible Battle Systems
  • Insert teh funny here

Screenshots

No Screenshots

Demo
XP - Download Demo

Script

Place anywhere above Main and below Default Scripts.
(click to show/hide)

Instructions

YOU MUST CONFIGURE THIS SCRIPT BEFORE USING

Edit the List of State ID's and Game Switch ID's

List = [ [25,114],[26,115] ]

The List is an Array of Arrays.  Each Array is a STATE ID and GAME SWITCH to change.  So in the example provided, 25 is the State ID and 114 is the Game Switch.  When ANY Member of your Party has a State of 25, the Game Switch will be set to On.  When NO Members of your Party have a State of 25, the Game Switch is Off.  

If you really want to, you can use One State ID to change Multiple Switches.

I also strongly recommend labeling your Game Switches as "(Auto) whatever" so you do not come back and try to edit that Game Switch with other Commands later.  Just leave the Auto Switches alone once you assign one of them to this Script.

Compatibility

May not work on the Atari 2600

Credits and Thanks

  • Little Drago for VX / Ace Edits
  • The Academy
  • Starbucks and 5 Hour Energy for making this script possible

Author's Notes

This is just a really efficient way of Automating Game Switches as opposed using Parallel or Common Events to alter Game Switches.  Where this script really shines is in the Power of Event Pages.  Both in Map Events and Battle Events.  No changes need to be made to the States themselves for this Scritp to function properly.  This script is designed to work as a Standalone Script that compliments a Collection that I am also working on, including Super Event Sensor (not yet released, working on Demo).  This script is very simple powerful tool for making your game much more Dynamic.  It works very well with Spells as Spells can cause States to be imposed.  The states dont even have to do anything.  For example, just label it Invisible to prevent a Player from being approached by an Enemy NPC.  That would require an additional Event Page for an Enemy Event NPC.  It is also very useful in Battle for checking an Actors State during a Battle.  Oh, main actor is Knocked Out?  Time to event out some drama.  States were also chosen over Elements because Armors can induce an Auto State.

---  BUGS  ---

Most of the Bugs will be Your Own.

No offense.  This is just to tell you of what Pitfalls to avoid.  You may find that after editing the Config, the Settings you are trying to use are NOT working.  As you develop your game, you'll find you need to make changes to your Database for things like Adding New Items, and States, etc.  If you come across times where you find that changing your Database and editing the Config is not working as expected in your game, it is NOT a bug, it is a feature.  The script was set up so you can change your State Switches on the Fly.  What is causing your most common appearance of a Bug is that you've loaded a Saved Game where the New Settings are NOT APPLIED.  Starting a New Game should cause your State IDs and Switches to work as expected.  I did it this way because there may be times you want to alter the List of State IDs and Switch IDs as a story progresses.

If you want to check what ID's are being shown due to possible bugs, do this.  The Text in the Script Commands is too short due to Word Wrap so I'll fix that.  (Edit: Fixed, had something else on my brain, put in the wrong variable names)

s=$game_system.state_switches
print s.list

To Change the List (IE Save Game or suspected Bug):

s=$game_system.state_switches
new = [ [old_state_id, old_switch_id],[new_state_id, new_switch_id]  ]
s.list = new

Replace the Old and New text there with just your IDs so it should look more like this:

new = [ [12,23],[34,45],[56,78] ]

Just letting you know about Pitfalls before you get caught in one.  You'll probably need this during Development of your Game, but probably not use it for the Game Player.  I can not predict that you will or will not, thus, I allowed you the ability to change on the fly, even if it does cause a bit more work, it shouldnt be too much.

---

Edit: Using Little Drago's revision for VX and VX Ace compatability since I have neither.
« Last Edit: October 07, 2013, 09:39:49 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: 831
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Heretic's Auto State Switches
« Reply #1 on: October 02, 2013, 01:30:57 PM »
it's a nice script, btw I have edited it so it would compatible with VX or VXA (and also to prevent corrupted old savegames)

http://pastebin.com/q7iXT2xq

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
Re: [XP][VX][VXA] Heretic's Auto State Switches
« Reply #2 on: October 02, 2013, 03:12:43 PM »
That works since I think everyone knows I dont have VX or Ace.  I missed that save bug.
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 Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
Re: [XP][VX][VXA] Heretic's Auto State Switches
« Reply #3 on: October 03, 2013, 09:17:04 AM »
Updated to version 1.02

XP Demo Released.  I dont have VX or Ace so someone else that feels like doing a demo.  The Demo will get the point across.

Changed it around to check if the State ID in the List is a Knockout State.  This allows Knockout States to also change Game Switches while the MOVABLE Option is Enabled.  Normally, when an actor is Knocked Out (not Movable), the script excludes them allowing to enable the Game Switch.  Say Basil has an Armor of Switchiness.  If Basil is Knocked Out and he is the only Party Member that has such an Armor, then that Game Switch will be Disabled because Basil is Dead.  I had to update to 1.02 because Knockout was excluded because the actor was dead, which was a bug that is now fixed, with Little Drago's help for VX and Ace version compatability.

Smell ya later!  (You'll understand that once you download the demo)

---

Updated to 1.03 - Fixed Initial Equipment not being checked.
« Last Edit: October 03, 2013, 11:28:24 PM 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.)