Instant cast gives infinite turns

I am using Yanfly's Instant Cast script.  What is supposed to happen is this:

A character has the ability to scan the enemy.  I don't want this to take up a turn (as players tend not to use it if it does) So I have made it Instant Cast.  As well as scanning the enemy, it also debuffs that enemy's DEF for one turn.  In order to prevent the irritating 'Failed' message coming up, it also inflicts a blank state.

All of that happens, but instead of restricting it to just one turn, I can have as many as I like doing that.  So the player could debuff every enemy and scan the whole troop in one turn.  As soon as I select another action, it moves on in the expected way.  If I remove the <instant> note tag, the problem vanishes, so it is definitely located there.

Here is a screenie of the skill.  As you can see, there's nothing exotic there.

Scan%20skill_zpsafnd7tya.png


Does anyone have any idea why this is happening?

Thanks.
Mm, working as intended? If you want to restrict the ability to spam the skill, look at Yanfly's 'Skill Restrictions' script (put the skill on a cool down of 1 if you want them to be able to use it next turn).
But I shouldn't need to put in another script to get this one to work.  I used it in my previous project and it gave just one extra turn, which is what is supposed to happen.

Just had a thought.  This time I'm using Yami's Battle Symphony.  Could that be the cause?
Hmm, well, in every game I have used the script in, I can spam the instant cast skill until I run out of mana or TP.
That may be a cause if it worked in a previous project. Something you could do is open up a new project put this script in see if it works. If it does then put in yami's script and if that breaks it then that is probably the cause. (Also just wanted to say this but yanfly has a anti-fail message script).

Edit: after reading through the instant action script some more. It would appear as if it gives enemies an extra action but for players since it gets called outside of the battle phase, they will be able to use it as many times as they want so long as it is the first skill they choose.
Sarlecc summed it up pretty well. The instant skill, due to the way it is invoked for the player, allows for infinite turns. What you could do is have the skill add a state to the player which seals the skill until the turn end. This way they cannot invoke the skill again, and have to pick another skill.
Okay, did the clean project, one script thing, and it still happened.  So it looks like Exhydra is right (though in that case I'd love to know what was the factor which made it not happen in my last game).

And Sarlecc, I'd forgotten about the anti-fail message script - but then I realised that in fact I don't need it or the state because I'm adding a buff, so there is an effect that the engine can detect, so no fail message will appear.

@bgillisp

Your post appeared just as I was about to hit the post button.  How does a state seal a skill until the end of the turn?

EDIT

Let me expand that.

I know that a state can seal a skill.  What I didn't know was that it could be turn limited in such a fine-tuned way.  The way that it reads states, doesn't this actually spill over into the next turn?
to have a state seal a skill until the end of the turn:

First, create a new state, set it to remove at the end of the turn (length 1 - 1). Then under the features add seal skill, the skill you want to seal.

When I've used this trick I don't even have the state add an icon. This way nothing shows up and the player thinks it is a cooldown of one turn.
Just done that, works perfectly.  Thank you.

And thanks to Exhydra and Sarlecc for your contributions.
Glad it worked. To clarify, if you use action end, then it spills into the next turn. Turn end on the other end, ends when the battle system says a turn is up, which is (usually) after everyone has taken a turn.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/instant-cast-gives-infinite-turns.41826/