DoubleX RMMV Action Cost

@DoubleX. Hey, it's me again. Sorry to bother you but after playing around with your action cost and action times plugins I gotta' say I really like them, a request though. Your action times plugin works fine and is compatible with everything, though your cost one isn't, namely with victor's ctb plugin. I know it might be too cumbersome for you to tinker with it to get it to be compatible but if you could that would be very cool as I'd like to utilize it as well. The issue is the costs of the actions correspond with the specified actions times of the actor. But after you've selected the actions, it goes to the next turn and nothing happens. Though for some reason torigoya's quickskill works with this and the actions do play out normally.
@DoubleX. Hey, it's me again. Sorry to bother you but after playing around with your action cost and action times plugins I gotta' say I really like them, a request though. Your action times plugin works fine and is compatible with everything, though your cost one isn't, namely with victor's ctb plugin. I know it might be too cumbersome for you to tinker with it to get it to be compatible but if you could that would be very cool as I'd like to utilize it as well. The issue is the costs of the actions correspond with the specified actions times of the actor. But after you've selected the actions, it goes to the next turn and nothing happens. Though for some reason torigoya's quickskill works with this and the actions do play out normally.
You may want to place this snippet after both this plugin and the victor ctb:
JavaScript:
DoubleX_RMMV.Act_Cost.BattleManager.setupAction = BattleManager.setupAction;
BattleManager.setupAction = function(battler) {
    battler.actCostInputs = -999;
    DoubleX_RMMV.Act_Cost.BattleManager.setupAction(battler);
};
Wow, thanks for replying so quickly. I did place it below both but got this.
Wow, thanks for replying so quickly. I did place it below both but got this.
Sorry for my mistake. Try this instead:
Code:
DoubleX_RMMV.Act_Cost.BattleManager.setupAction = BattleManager.setupAction;
BattleManager.setupAction = function(battler) {
    battler.actCostInputs = -999;
    DoubleX_RMMV.Act_Cost.BattleManager.setupAction.call(this, battler);
};
Oh wow. No errors now, but something odd is now taking place. Sorry for bothering you. You've been very patient lol. Let's say the actor has one +100 action times in their traits. They have 2 native turns always. Good. (Making sure attack and defend have a cost of 1 like the help section says.) Now let's say a skill has a cost of 2. What I thought was the case was the skill that costs 2 actions would consume those two actions and it would become the next actors turn. But what happens is the actor is still able to input another command. (As if they're always able to act their max action times set, in this case 2.) But is unable to select anything with a cost value at all. (Since the skill consumes their 2 native turns.) But the skill costing 2 actions actually does prompt the end of the turn and becomes the next actor's turn when the ctb plugin is turned off. So I understand if it's something that might be unable to be remedied. : /
I'm sorry that I failed to reproduce the issue. In my case I placed the Victor CTB above my Action Cost plugin. If that doesn't work for you, I'm afraid that you'll have to give me your project(via pm of course) so I can test that out 🙂
Works now. Thanks! :LZYcheeze:
@DoubleX. Hey man. I really appreciate your help from earlier. But just one question. For certain actions, if there a way to force the actor's turn to end? Like after defending? Or a certain skill? Regardless of they have multiple action slots remaining?
Updates
JavaScript:
 *      v1.02a(GMT 0300 20-5-2020):
 *      1. Added <max act cost> notetag
*bows deeply*
Hello DoubleX! I have been testing your Plugin, it is a Wonder.

But I have a problem, how can I subtract an AP (Action Point) without using a Skill?

I mean using that "subtraction" through a Script Call.

I hope you can help me.
But I have a problem, how can I subtract an AP (Action Point) without using a Skill?
Actually this is about the number of action slots a battler has, rather than the number of action slots needed for using a skill, so it's pretty much nothing to do with my plugin 🙂

However, the script call you want is simple, provided that you're using the default turn-based battle system:
JavaScript:
battler._actions.length -= x;
Where x is the amount of subtraction, and battler is the battler you want to have the number of action slots subtracted, like either of the following:
JavaScript:
$gameActors.actor(actorId) // The game actor with id actorId
$gameParty.members()[i] // The ith game party member
$gameTroop.members()[i] // The ith game troop member
OH MY GOD!

Good evening, thanks for your prompt response, that was exactly what I was looking for!

Now everything works as it should, thank you very much, I will make sure to send you a Translated Demo and the respective Credits.

Original thread: https://forums.rpgmakerweb.com/threads/doublex-rmmv-action-cost.60556/