Custom Effects with YEP's Buffs & States core - endlessly repeating skills

Status
Not open for further replies.

thepsyche

Veteran
Veteran
Joined
Nov 16, 2016
Messages
325
Reaction score
75
First Language
English
Hi everyone.

I'm trying to create a state, that at the end of an actor or enemy's turn whom is affected by the state, will force a skill on them.

For instance, in a Custom Turn End Effect, I would like to force skill 54.

Using the "BattleManager.queueForceAction" command does not work, as skill 54 will endlessly repeat on the user. Here is how the actual skill is set up:

1580611200323.png

Initially I was using "Custom Action End Effect" and thought if I swapped it to Turn End, it would stop the infinite loop because skill 54 was considered an action. However, it made no difference.

So I thought I could try this instead:


JavaScript:
<Custom Turn End Effect>
if (! a._isThisForceActionInitiated) {
a.forceAction(54);
a._isThisForceActionInitiated = true;
}
</Custom Turn End Effect>
<Custom Turn Start Effect>
a._isThisForceActionInitiated = false;
</Custom Turn Start Effect>
Whereby if the flag was not on, it would execute the skill, followed by immediately turning the flag on so it would not execute the skill a second time. However, instead of endlessly repeating the skill in this case, it does not even occur once.

So now I'm a bit stuck, and was wondering how to execute a skill in a custom effect that only occurs on the user once.

Keep in mind, the poison idea is just a generic test, so I'm not really after advice on how to create a general poison skill in other more efficient ways.

Thanks!!!
 

rainyday

Veteran
Veteran
Joined
Nov 5, 2019
Messages
73
Reaction score
44
First Language
English
Primarily Uses
RMMV
Try this code.
Code:
<Custom Turn Start Effect>
user._hasExecutedSkill = false;
</Custom Turn Start Effect>
<Custom Turn End Effect>
if(!user._hasExecutedSkill){
BattleManager.queueForceAction(user, 54, -2);
user._hasExecutedSkill = true;
}
</Custom Turn End Effect>
 
Last edited:
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top