Altering a "substitute" script to activate based on a variable.

ProtoflareX

Veteran
Veteran
Joined
Jul 16, 2013
Messages
40
Reaction score
5
First Language
English
Primarily Uses
I originally found the script below on this site. There is a link to the exact page below. Anyway, I would like to know if it is possible to edit this script so that it uses a variable instead of an HP percentage. More specifically, if an actor has the substitute flag, I want them to cover for any actor whose HP is lower than or equal to the value in the specified variable.

Where I found the script: http://forums.rpgmak...ult-substitute/

  1. class Scene_Battle < Scene_Base
  2. #--------------------------------------------------------------------------
  3. # * Check Substitute Condition
  4. #--------------------------------------------------------------------------
  5. def check_substitute(target, item)
  6. # default value is 25%, change it to whatever you want
  7. target.hp < target.mhp / 4 && (!item || !item.certain?)
  8. end
  9. end
 
Last edited by a moderator:

EatYourBeetS

The Abysswalker
Veteran
Joined
Feb 23, 2015
Messages
96
Reaction score
30
First Language
Italian
Primarily Uses
Just change "target.mhp / 4" with $game_variables[id] and it should work  :)  
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top