Is it possible to restrict a skill's usage if another actor is incapable of acting?

1) You gonna need to learn basic actor conditions like checking states [which is I think, actor.state?(id)]...


2) No not so stupid player will do that, trust me... else you gotta make variations to the battle flow so that you can reselect a command which is not really easy... just to fix something that is quite logical... or if you don't wanna request, use a CTB or an ATB so that commands are executed right after you select them... that will fix away all your worries...
1) You gonna need to learn basic actor conditions like checking states [which is I think, actor.state?(id)]...

2) No not so stupid player will do that, trust me... else you gotta make variations to the battle flow so that you can reselect a command which is not really easy... just to fix something that is quite logical... or if you don't wanna request, use a CTB or an ATB so that commands are executed right after you select them... that will fix away all your worries...
1. ...Which is why I'm asking for support since I don't know that...

2. I've yet to find a single CTB or ATB script that wasn't a buggy mess. This does not fix the problem anyway.

The only problem I'm having is that it requires both actors to have the TP needed for one of them to cast the TP skill in question. I don't want that to happen. If it can be fixed so that their usage of a TP skill does not depend on the other character's TP, and only on their state, then I have no problems.
Already told you how to check state...

You gonna need to learn basic actor conditions like checking states [which is I think, actor.state?(id)]...
so in your case, I guess it would be


!$game_party.battle_members[1].state?(1) and !$game_party.battle_members[2].state?(1)


that should return true if both actors are still alive and kicking... though that wouldn't fit on a single note line...
Already told you how to check state...

so in your case, I guess it would be

!$game_party.battle_members[1].state?(1) and !$game_party.battle_members[2].state?(1)

that should return true if both actors are still alive and kicking... though that wouldn't fit on a single note line...
I actually need to check for three states. 1, 28 and 29.

So if I can't do that... then what?
!$game_party.battle_members[1].state?(1) and !$game_party.battle_members[2].state?(1) and !$game_party.battle_members[1].state?(28) and !$game_party.battle_members[2].state?(28) and !$game_party.battle_members[1].state?(29) and !$game_party.battle_members[2].state?(29)

or

(assuming states array is directly accessible)

if you can't do that, you can always make it as a custom method somewhere and use that method...

like

Code:
module Push  def self.button    return !$game_party.battle_members[1].states.any?{|id| [1,28,29].include?(id)} and !$game_party.battle_members[2].states.any?{|id| [1,28,29].include?(id)}  endend
then on your condition, just use Push.button
!$game_party.battle_members[1].state?(1) and !$game_party.battle_members[2].state?(1) and !$game_party.battle_members[1].state?(28) and !$game_party.battle_members[2].state?(28) and !$game_party.battle_members[1].state?(29) and !$game_party.battle_members[2].state?(29)

or

(assuming states array is directly accessible)

!$game_party.battle_members[1].states.any?{|id| [1,28,29].include?(id)} and !$game_party.battle_members[2].states.any?{|id| [1,28,29].include?(id)}
Would that work with Tsukihime's script?
As long as it supports ruby formulas, it should

if you can't do that (doesn't fit), you can always make it as a custom method somewhere and use that method...

like

Code:
module Push  def self.button    return !$game_party.battle_members[1].states.any?{|id| [1,28,29].include?(id)} and !$game_party.battle_members[2].states.any?{|id| [1,28,29].include?(id)}  endend
then on your condition, just use Push.button
As long as it supports ruby formulas, it should
Putting it like it was in your previous post causes it to crash here:

tr0nFVK.png


Crashes when opening the menu when TP condition has been met, but if you try and open the menu before you have enough TP, it doesn't crash.
Then I guess that means it doesn't support multi lines or something, so you need to do the custom method I posted


also, when you encounter an error, make it a habit to take a screenie of it or at least write down the whole error message
Then I guess that means it doesn't support multi lines or something, so you need to do the custom method I posted

also, when you encounter an error, make it a habit to take a screenie of it or at least write down the whole error message
Um... Where do I put that? The custom method I mean.
make a new script then put it there...
make a new script then put it there...
I don't know how to script...
Just create a blank script and paste the code I posted... It's the same as when you placed Hime's script into your project...
2) No not so stupid player will do that, trust me... else you gotta make variations to the battle flow so that you can reselect a command which is not really easy... just to fix something that is quite logical... or if you don't wanna request, use a CTB or an ATB so that commands are executed right after you select them... that will fix away all your worries...
This is what I would recommend.


The problem is that a skill was usable when you first selected it, but then it was no longer usable when it came time to use it.


So, instead of having separate command input and action execution phases, just make it so that when you enter your input, it is executed.
As long as it supports ruby formulas, it should
Yeah this doesn't work at all.

8WzUvyK.png


The game crashes the moment I try to boot a test battle.

This is what I would recommend.

The problem is that a skill was usable when you first selected it, but then it was no longer usable when it came time to use it.

So, instead of having separate command input and action execution phases, just make it so that when you enter your input, it is executed.
But this DOESN'T FIX THE PROBLEM.

Even if I have a battle system that does this, if one character's turn comes up and they use a TP skill, putting them at 0 TP, when the next character's turn comes up, even if they have met the TP requirement for one of their skills, they won't be able to use it because it keeps trying to check the TP value of the other actor. I'm trying to tell you that I DO NOT WANT THIS TO HAPPEN.
Your skill requires both actors to be able to use their own skills.


One actor has insufficient TP, therefore, one actor can't use their skill, and therefore it can't be used.


I don't understand what the problem is, nor do I understand what you want to do, because what you're doing contradicts what it means to be able to use a skill.
Your skill requires both actors to be able to use their own skills.

One actor has insufficient TP, therefore, one actor can't use their skill, and therefore it can't be used.

I don't understand what the problem is, nor do I understand what you want to do, because what you're doing contradicts what it means to be able to use a skill.
...You don't seem to be understanding what I'm saying.

1. I want Actor A to be able to use a skill, provided that Actor A or Actor B are not afflicted with the death, freeze or shock states.

2. I want Actor A to only be able to use the skill in question when they have at least 10 TP.

3. I do not want Actor B's TP to be called into question. Actor B's TP does not matter when Actor A uses this skill.

It's not a hard concept to grasp...
Then all you need to is check whether actor B has a certain state, which is what Engr. wrote...except for some reason it doesn't work. You can just copy that into the note-box.

!$game_party.battle_members[1].states.any?{|id| [1,28,29].include?(id)} && !$game_party.battle_members[2].states.any?{|id| [1,28,29].include?(id)}That assumes you always have two actors in the party, and only those two as the 2nd and 3rd actors, but I'm assuming that's what you wanted.The formula I gave you before was under the assumption that actor B needed to be able to use the skill, cause you wanted them to actually be able to use the respective skills

Well, but they wouldn't be able to USE the skill.

In this game, there's 2 party members, the knight and the mage.

If the knight initiates the team attack, then it's generally something like a magically enhanced sword attack. If the mage does, it's an enhanced spell using the mana (not actual MP drain) of the knight.

So they have completely separate pools of Team Attacks. They wouldn't be able to use each other's skills in that way.
@Push - go to the script and make the condition run in only 1 line (cannot show it here coz the page wraps it up), I think the break made it invalid...
Then all you need to is check whether actor B has a certain state, which is what Engr. wrote...except for some reason it doesn't work. You can just copy that into the note-box.

!$game_party.battle_members[1].states.any?{|id| [1,28,29].include?(id)} && !$game_party.battle_members[2].states.any?{|id| [1,28,29].include?(id)}That assumes you always have two actors in the party, and only those two as the 2nd and 3rd actors, but I'm assuming that's what you wanted.The formula I gave you before was under the assumption that actor B needed to be able to use the skill, cause you wanted them to actually be able to use the respective skills
So we had a misunderstanding...

However... it still doesn't work...

First of all... I don't know why you assumed I was working with the 2nd and 3rd actors... having [1] and [2] there causes the game to crash when I attempt to use the skill. [0] and [1] is what I needed...

But now it's like the formula does nothing. One of them was dead and the other was still able to use their TP attack.

hDP0sYQ.png


State 1 is death, and it should prevent them from using the skill if their ally is dead... but it doesn't...

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-restrict-a-skills-usage-if-another-actor-is-incapable-of-acting.21887/