Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Script Help needed

I have this script and it works well for me, but I have hit a snag

I want to either call a common event when the state is inflicted, but it doesn't seem to work in battle normally (without a script)
So I was wondering if there was a way to have it implement it via scripting

Otherwise I need to have the state inflicted, and then depending on the character's name give them a certain skill for the time the state effects them.

Also I need it so that the script (all of it) will only effect the party characters.
Currently it is also effecting the monsters.
Here is the script:
[/spoiler]
class Game_Battler
States_Activated_When_Health_Below_Percent = {30 => [17]}
alias_method :seph_statesactivatedbyhealth_gmbtlr_states, :states
def states
n = seph_statesactivatedbyhealth_gmbtlr_states.dup
percent = Integer(self.hp / self.maxhp.to_f * 100)
States_Activated_When_Health_Below_Percent.each do |p, state_ids|
next unless percent <= p
state_ids.each {|s| n << s unless n.include?(s)}
end
return n.dup.sort
end
end
[/spoiler]
(ps Sorry I'm not totally sure on how to implement spoilers)
Thanks for the help.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top