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
781
Reaction score
492
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
31,434
Reaction score
7,713
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

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,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top