Save-Point
States : Expiration States - 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)
+--- Thread: States : Expiration States (/thread-5817.html)



States : Expiration States - Kain Nobel - 06-04-2016

Introduction

As confusing as the title sounds, this is a Status Effect script which causes the expiration of Status Effect A to switch to Status Effect B. A good example of this is "Death Sentence" from the Final Fantasy series...

Doom (3) => Doom (2) => Doom (1) => Dead

...Where "Death Sentence" (or, in this case, "Doom") lasts for three turns before the target dies.

Instructions

Place below default scripts and above Main.

You can see an example of the "Death Sentence" cycle which I've set up in the script for my game. Just look for the constant Expiration and see how I've set it up.

Script

Content Hidden

Compatability

Written for RPG Maker XP. It is possible it works in VX or VX Ace, but I haven't tested. If it does, let me know and I'll change the icon.

Author's Notes

If you can't tell by now, yes, most of my scripts are minor add-ons and they're usually inspired by Final Fantasy for some reason.

Credits

Free to use in commercial and non-commercial games. Credit Kain Nobel and enjoy!


RE: States : Expiration States - Noctis - 01-26-2017

Okay, first of all: Thanks for the script:
Im using your script alongside Atoas ACBS.
And when I have several states on I get the error message
NoMethodError occured, undefined method '>' for nil:NilClass

it happens on Game battler 2 line 223:      

Quote:if @states_turn[i] > 0


In full context:


Quote:#--------------------------------------------------------------------------
 # * Natural Removal of States (called up each turn)
 #--------------------------------------------------------------------------
 def remove_states_auto
   for i in @states_turn.keys.clone
     if @states_turn[i] > 0
       @states_turn[i] -= 1
     elsif rand(100) < $data_states[i].auto_release_prob
       remove_state(i)
     end
   end
 end


I think its because your script does affect the very same method.
Anyways to fix that?

BTW: IM NOT using SDK, is this even compatible without SDK?