Save-Point
Troop : Self-Switches - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker VX/VXAce (RGSS2/3) Engines (https://www.save-point.org/forum-117.html)
+---- Thread: Troop : Self-Switches (/thread-9053.html)



Troop : Self-Switches - Kain Nobel - 06-10-2016

Introduction

This script allows you to use Self-Switches for Troops, exactly like you would for Map Events.

While self-switches are originally intended for map events, this script allows you to use self-switches within a troop's event commands list.

Instructions

Place below default scripts and above Main.

Compatability

This was written within RPG Maker XP.

Not tested in VX or VX Ace but I'm assuming it should work there too; just change Interpreter into Game_Interpreter.

If that doesn't work, PM me and I'll see about writing a different version for VX and VX Ace.

Script

Content Hidden

Screen Shots

Nothing fancy, just an example of use. This is in the Database > Troops tab.

[Image: troopselfswitches_zpsx5rsqjko.png]

Message displays only once; first time you fight Basilisk (x2). Useful for quick tutorial battles.

Author's Notes

My good friend PK8 wrote a Self Data Suite, which also has Troop Self Switch capabilities. My script is only Troop-related, so I'm not exactly sure what the differences are. PK8's suite, on the other hand, handles tons more self-switch related content for Actors, Enemies, Troops, Maps, etc. so it might be worth checking out.

Additional Capabilities

You've gained new functions!

Code:
# You can set Troop Self-Switches A-D
$game_troop.switch_a = bool

# You can check Troop Self-Switches A-D too!
unless $game_troop.switch_a
  p 'Hello world!'
  $game_troop.switch_a = true
end

Use within Call Script and/or Conditional Branch > Call Script commands :)

These calls will only work while in battle; I have not designed them to work on map events.

Credits

Free for commercial and non-commercial use. Just credit Kain Nobel and enjoy!