RMMV Effect when enemy dies (YEP Buff & States Core)

Maronius

Villager
Member
Joined
Oct 29, 2015
Messages
21
Reaction score
4
Primarily Uses
Hello everyone,

I'm trying to make a state that heals the Magic Points of the Actor who kills the enemy.

With YEP Buff & States Core this should be easy, and I tried this:


<Custom Deselect Effect>
if (target.hp <= 0) {
user.gainMp(1000);
}
</Custom Deselect Effect>

But unfortunately this doesn't have any effect on the actor that kills the enemy with this state.
Can somebody give me a hint what's wrong here?
 

Jules98

Veteran
Veteran
Joined
Jul 10, 2017
Messages
339
Reaction score
224
First Language
Dutch
Primarily Uses
RMMV
The code you posted works fine on my end.

I can think of 3 possible reasons why it's not working for you.
  1. The state isn't actually active on the target when it is killed.
  2. There is something wrong with the state. Please post a screenshot of the database entry of the state, including whatever else is in the note box.
  3. There is a problem with your plugins (wrong order, conflicting plugins, etc). Please post a screenshot of your plugin manager so we can check this.
 

Maronius

Villager
Member
Joined
Oct 29, 2015
Messages
21
Reaction score
4
Primarily Uses
Alright, thanks for checking this out. Looks some other scripts are overriding the "enemy dead" handling, as only "if (target.hp <= 0)" isn't working out, all other "ifs" I tried are working right.
I'll check my plugins for this.
 

Latest Threads

Latest Profile Posts

Got like a sudden surge of wish lists overnight. :)
headshot_headshot.jpg
The theory has been proved. Based on an invisible image's data(the big red dot in the previous image), RM can identify different parts of an enemy and do something respectively. :kaojoy:
Ok.. coding what should be a simple "everyone is petrified and therefore dead, now go to game over screen" shouldn't involve needing to become Dr. J and dunking from the free throw line(my way of saying "jumping through hoops").
Hmmmm... how many xrays til I get super powers?
..of the major old school series that began in the 80s- early 90s, I still haven't beaten 'a' Zelda game. Mario 64 was the first Mario I've beaten. I don't know if I should give that honor to Link to the Past or A Link Between Worlds(I currently own both). Well technically I've haven't beaten a Sonic either (Game Genie doesn't count =P).

Forum statistics

Threads
115,381
Messages
1,089,427
Members
150,102
Latest member
Ketchy
Top