Setting a variable to the amount of remaining attacks of the current battler via sriptcalls

Hello peeps,

I hope this is the right place to ask this. I need the players of my game to know the amount of remaining actions. This is the scriptcall I wrote to realise it, but something is wrong, and I tried and errored the living **** out of this scriptcall but I really dont get it.

This is what I have:
$gameVariables.setValue(100, $gameParty.members(0).attackTimesAdd)

I thought this scriptcall would set the variable 100 to the amount of remaining extra attacks of the first (and at this point only) battler. But it sets it to 0 regardless of remaining actions.
Is there a syntax problem or did I used the wrong source for that information?

Thanks ahead

Ruby (Reyarius)
"Number of attacks remaining" only really has meaning when you're in the middle of choosing your attacks, but… if that's where you're using this, then we can probably work something out.

First of all, your syntax is all wrong. If you want to get the "attack times add", you'd do it like this:

JavaScript:
$gameVariables.setValue(100, $gameParty.members()[0].attackTimesAdd())

However, from the description of your problem, I don't think "attack times add" is the correct quantity. That's the number of times that the single chosen attack will be repeated – that is to say, if it's 2, you get to pick one skill, and it executes twice. If I'm wrong, and that is what you want, you can stop here.

What I think you're looking for is "action times add", which is what lets you select more than one skill when it's your turn. For that, I believe the following will get you closer to the answer you want:

JavaScript:
$gameVariables.setValue(100, $gameParty.members()[0]._actions.length)

That's the total number of actions you're going to get in the current turn. It'll only work if checked during input; if you check it while actions are going on, it'll give you the number of actions that are yet to execute. However, it will also count scripted (forced) actions. If that's what you're looking for, great; if you want it to work during input, that's on the right track but not quite there.
Dear Solar_Flare,

thank you so much, you were indeed right, what I needed was the latter one. I copied it in and it works perfectly smooth. I will let this script be called after every action the player takes. also every action the enemy does will set it to 1, as long as extra actions are not carried over to other turns that should do the trick. Thank you so much again!

best regards

Ruby (Reyarius)

Original thread: https://forums.rpgmakerweb.com/threads/setting-a-variable-to-the-amount-of-remaining-attacks-of-the-current-battler-via-sriptcalls.180680/