Dark Knight Skill with the conditional aspect of Yanfly's Instant Cast Plugin causes battle test to crash

Ripslash1

Villager
Member
Joined
Nov 25, 2016
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Hey, everyone. I'm making some skills for a Dark Knight, and I have one where the idea is that if the target has the fear state, it will become an instant skill, allowing the user to act again.
This is what I have in the note section of the skill. I will preface this by saying that I don't know Javascript like, at all:
<HP Cost: 15%>
<Instant Eval>
if (target.isStateAffected(30)) instant = true;
</Instant Eval>
if (target.isStateAffected(30)){
var gain = .15*user.mhp;
user.hp += gain;
target.removeState(30);
}

I basically copied and pasted the example from the help section in Yanfly's Instant Cast Plugin, but changed it from if the user's attack is equal to or more than 300 to what I have here. That section is the only section that messes up, as I've isolated each part of the note and tried again.

Any time I try to battle test, the test crashes, with the error code: require(...).Window.get(...).isDevToolsOpen is not a function.

Now, is this something with the Script, or is it something on my end, i.e. the code?

I don't really know Javascript all that well, but I do know Java. I've just taken to trying things out, and most of the time, they work. But if this is something with me, then what is it, and how do I fix it?
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
659
Reaction score
373
First Language
English
Primarily Uses
RMMV
I have seen in multiple yanfly plugins the following update:
* - Bypass the isDevToolsOpen() error when bad code is inserted into a script call or custom Lunatic Mode code segment due to updating to MV 1.6.1..
Sounds like you're using an older version of at least one of the plugins. Probably the instant cast plugin, since that's the one that'd be reading the note tag.

Your note tag also appears to contain a block of code which is not contained inside any tags, so it will never be parsed. I think you want that second if check wrapped inside of an <After Eval> tag. I'm not sure that's what's causing the problem here, though.

Without being able to see the error that should be thrown by this note tag, I'd suspect the <Instant Eval> tag does not have access to the target of the skill, so as target is not defined, it can't check if the target has a state on it or not.

After updating the instant cast plugin, try replacing 'target' with 'BattleManager._targets[0]' in your note tag. I'm not sure it will work either, but give that a try and see what happens.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,011
Reaction score
7,023
First Language
German
Primarily Uses
RMMV
Additionally please keep in mind that the battletest uses some shortcuts to speed up its launch, and those shortcuts do not work with every plugin.

If you get an error in battletest, then you should always check that same battle in a regular playtest. ONLY if that playtest get you the same error you should go to solve it. Because only then you are guaranteed that this is a true error and not caused by the battletest skipping initialization functions.
 

Ripslash1

Villager
Member
Joined
Nov 25, 2016
Messages
10
Reaction score
0
First Language
English
Primarily Uses
After updating the instant cast plugin, try replacing 'target' with 'BattleManager._targets[0]' in your note tag. I'm not sure it will work either, but give that a try and see what happens.
This is exactly what it needed, thank you!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I based this on the armor of Actor 1_7 of the RTP. Hair is from Derex and Sythian Bard.
Stream will be live shortly! Going to do another art stream tonight so that I can finish my Fauna Focus piece~ Feel free to drop by!
Humans are fallible creatures, we all know that. It's when we're forced to look at ourselves that we start to disagree. :p
Expectation: Working on boss battle.
Reality: "Look at how awful are these code and database organization. Let me clean this mess", *yet, casually adding more modules that I have no idea if I would use it later*
Trying to learn to read Japanese so I read my manga. I like to buy them without all the edits made during translation.

Forum statistics

Threads
97,864
Messages
947,445
Members
129,086
Latest member
mikeymastermind
Top