ATB Interrupt Condition Javascript [Yanfly ATB]

Status
Not open for further replies.

NewDayS

Warper
Member
Joined
Mar 21, 2019
Messages
4
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hey, looking for some help in regards to an ATB interrupt condition in Yanfly's ATB.

<ATB Interrupt Eval>

if () {

interrupt = true;

}

</ATB Interrupt Eval>


Here's the format I've been presented with, unfortunately, I have very little knowledge in regards to javascript and I was wondering if anyone could help me out. Here's what I need it to do:

I've changed the element types to a simplified 3: Shooting, Rush and Neutral. The idea is that certain skills can interrupt certain element types.

the logic I'd like to use:

If user is using a certain skill and target is using a "Rush element" type skill
Interrupt = true

Thanks to anyone who helps out in advance.
 

Palin

Veteran
Veteran
Joined
Mar 17, 2016
Messages
79
Reaction score
36
First Language
English
Primarily Uses
N/A
I don't have Yanfly's ATB to test this, but try this out...

Code:
<ATB Interrupt Eval>
var target_item = target.currentAction().item();
if(target_item && target_item.damage.elementId === x) interrupt = true;
</ATB Interrupt Eval>
where x is the element id for "rush element"

You may also need to change the first line to:

Code:
var target_item = (target.currentAction() ? target.currentAction().item() : false)
But I think a target that has atb charging always has a current action, so the first one "should" at least not crash your game! (no promises on it actually working)
 

NewDayS

Warper
Member
Joined
Mar 21, 2019
Messages
4
Reaction score
2
First Language
English
Primarily Uses
RMMV
I don't have Yanfly's ATB to test this, but try this out...

Code:
<ATB Interrupt Eval>
var target_item = target.currentAction().item();
if(target_item && target_item.damage.elementId === x) interrupt = true;
</ATB Interrupt Eval>
where x is the element id for "rush element"

You may also need to change the first line to:

Code:
var target_item = (target.currentAction() ? target.currentAction().item() : false)
But I think a target that has atb charging always has a current action, so the first one "should" at least not crash your game! (no promises on it actually working)
I deeply apologize for the late response, but, I'm very thankful for your help because it worked! The first one worked flawlessly and my game did in fact not crash. Thanks for the help.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games? And, if so, would any of you be interested in a short, proof of concept type non-euclidian puzzle game?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,232
Members
137,607
Latest member
Maddo
Top