State Add/Remove Commands v1.01
Shaz
IntroductionShaz
This script lets you enter RGSS script commands to be run when a state is added or removed. Like calling a common event when a state is added, or setting one state to be replaced by another after a certain number of turns.
Versions
Code:
1.01 26 May 14 Fix issue with + sign in regular expressions
Features
- Make something happen when a state is removed.
- Multiple commands may be run for a single state.
How to Use
Paste the script into a new slot below Materials.
In a state's note box, enter onadd: command or onremove: command, where command is any valid RGSS script command.
If a command requires more than will fit in the note box, allow it to wrap to the next line automatically - do NOT use the enter key to go to a new line.
Anything from onadd: or onremove: to the next manual line break will be executed.
You may have several onadd: or onremove: commands for a single state.
Script
Get it here
Examples
If you want to call common event 8 when a state is added, enter the following as the note:
Code:
onadd: $game_temp.reserve_common_event(8)
Code:
onremove: add_state(16)
Code:
onremove: if hp_rate < 0.5; add_state(20); else; add_state(21); end;
Code:
onremove: add_state(hp_rate < 0.5 ? 20 : 21)
FAQ
Credit and Thanks
- Shaz
Author's Notes
Free to use in commercial games. Please give credit.
Last edited by a moderator:

