- Joined
- Jun 7, 2013
- Messages
- 1,393
- Reaction score
- 210
- First Language
- English
Consider the following code, executed in battle, DIRECTLY after a player commits an action:
this._actorWhobrokeLaw.gainHp(-lawObject.amount); if (this._actorWhobrokeLaw._hp <= 0) { this._actorWhobrokeLaw.die(); this._actorWhobrokeLaw.preformCollapse(); }Couple things to note: this._actorWhobrokeLaw is a game actor instance. Obviously. lets assume amount is 1000.
So what happens when a player executes the attack command and this code is triggered?

The first thing in the stack is the

The particular line we care about is the else in the inf statement. the cursor blinks on context, I believe context is not defined in this instance.
How does this have anything to do with yanfly?
This code:

particularly the: this.contents at the bottom of the page.
So my question is, how do you update the actors health directly after they execute an action? I have it so that I say, in the Game Action, apply function, that:
On hit, if target is a game enemy and the item is attack, take 1000 hp from the player.
Any ideas about these errors? Is there a simple solution here?
this._actorWhobrokeLaw.gainHp(-lawObject.amount); if (this._actorWhobrokeLaw._hp <= 0) { this._actorWhobrokeLaw.die(); this._actorWhobrokeLaw.preformCollapse(); }Couple things to note: this._actorWhobrokeLaw is a game actor instance. Obviously. lets assume amount is 1000.
So what happens when a player executes the attack command and this code is triggered?

The first thing in the stack is the

The particular line we care about is the else in the inf statement. the cursor blinks on context, I believe context is not defined in this instance.
How does this have anything to do with yanfly?
This code:

particularly the: this.contents at the bottom of the page.
So my question is, how do you update the actors health directly after they execute an action? I have it so that I say, in the Game Action, apply function, that:
On hit, if target is a game enemy and the item is attack, take 1000 hp from the player.
Any ideas about these errors? Is there a simple solution here?
