Battle Event - Enemy doing specific skill when actor has a certain state inflicted

Hey all! So, since this is a pretty specific problem, I figured I'd ask here.

What I'm trying to do is, basically, the enemy has a move where they inflict a state on one actor. And after looking through the battle events, I don't see an option for the enemy to do something when said actor has a certain state inflicted.

Basically, The opponent would use a skill, and grab the single actor, inflicting a "grab" state. And I want to set it to where if the Actor gets "Grabbed" then the opponent does one single move until the actor's death.

How would I go about that? I tried setting up a parallel process common event that if the main actor gets inflicted with the "Grab" state, a switch turns on, hence, motioning for the enemy to use the skill, but that didn't work.

How would I accomplish this?

I'm using rpg maker, vx Ace
I suppose you could use an AoE skill which only damages actors inflicted with the grab state, then turn on a switch if any actors are inflicted with this grab state... targeting specific actors can get complicated without coding.
troop pages.
run the check every start of turn.
WWonaDP.jpg


I use it to allow the player to break a battle without killing the opponent.
it's just one patch-up that doesn't really belong into a larger system.

you shouldn't have a problem adapting it for your needs.
I suppose you could use an AoE skill which only damages actors inflicted with the grab state, then turn on a switch if any actors are inflicted with this grab state... targeting specific actors can get complicated without coding.
I only want the enemy to use the skill if the Actor is inflicted with a certain state.
There's only one actor in this battle, and turning on the switch mid-battle doesn't work.
(And yes, I'm trying to flip a switch when the actor has the state, and it doesn't work.)

troop pages.
run the check every start of turn.
WWonaDP.jpg


I use it to allow the player to break a battle without killing the opponent.
it's just one patch-up that doesn't really belong into a larger system.

you shouldn't have a problem adapting it for your needs.

Pardon my ignorance, but I'm not sure how that allows the enemy to use a certain skill when they have a certain State inflicted.
To be more specific, use the enemy troop event to check the actor's states each turn.

Have the troop event turn on a switch when the grab state is inflicted.

Then setup the enemy's action condition to only use the skill when your switch is on.

I'm at work, so I can't give examples.
To be more specific, use the enemy troop event to check the actor's states each turn.

Have the troop event turn on a switch when the grab state is inflicted.

Then setup the enemy's action condition to only use the skill when your switch is on.

I'm at work, so I can't give examples.

You mean something like this?
This is what I have so far.

miOTTA6.png
how is that not working then?
how is that not working then?
It just doesnt. I have it set up to where the enemy does a specific move which inflicts the state on the single actor in battle. Once it's inflicted, the enemy just does their regular moves, and not the move I have set at 10, if the switch is activated.
Instead of erasing the event, you should have it turn the switch off in an else branch. I don't think that is the problem though.

Does your skill have a cost requirement that the enemy isn't meeting?

Edit- Just noticed that your troop event condition is setup to not run at all...
Instead of erasing the event, you should have it turn the switch off in an else branch. I don't think that is the problem though.

Does your skill have a cost requirement that the enemy isn't meeting?

So like this?
lHcAddp.png


As for skill requirement, I don't! In fact, here's the skill I want the enemy to use;

ZN9pgD0.png
Condition is setup to not run.
Condition is setup to not run.
What should I set it to?
0 + 1 turns should be fine. (still at work)
I'm the guy who likes to work with scripts, so my version is either to use Hime's Enemy Action Condition or to make a snippet overwriting one of the Game_Enemy's condition method. I mean, I was able to have one of my enemies pull an escape when one party member exists and it works quite often.

So in my case, I overwrote
Code:
def conditions_met_party_level?(param1, param2)
  $game_party.highest_level >= param1
end

and I would have a condition like $game_party.alive_members.any? { |actor| actor.state?(param1)}
or $game_party.members[0].state?(param1) since you only have one character. The param1 is the party level or the list number of your state in this case.

Granted, the Party Level condition would only be effective from 1 to 99, but ideally, your Hold skill (Rating 10, "party level" condition: Grabbed) should only activate if at least one of your party members has the Grabbed state active.
0 + 1 turns should be fine. (still at work)
Tried it, no dice

I'm the guy who likes to work with scripts, so my version is either to use Hime's Enemy Action Condition or to make a snippet overwriting one of the Game_Enemy's condition method. I mean, I was able to have one of my enemies pull an escape when one party member exists and it works quite often.

So in my case, I overwrote
Code:
def conditions_met_party_level?(param1, param2)
  $game_party.highest_level >= param1
end

and I would have a condition like $game_party.alive_members.any? { |actor| actor.state?(param1)}
or $game_party.members[0].state?(param1) since you only have one character. The param1 is the party level or the list number of your state in this case.

Granted, the Party Level condition would only be effective from 1 to 99, but ideally, your Hold skill (Rating 10, "party level" condition: Grabbed) should only activate if at least one of your party members has the Grabbed state active.

Thank you for your time, too!

I've went ahead and grabbed Hime's script, because I wouldnt feel comfortable overwriting some official scripts, just for safety.

Now, I'll look through it a bit more, and see if I can figure it out, Thank you all for actually trying to help! It's really appreciated.
Tried it, no dice



Thank you for your time, too!

I've went ahead and grabbed Hime's script, because I wouldnt feel comfortable overwriting some official scripts, just for safety.

Now, I'll look through it a bit more, and see if I can figure it out, Thank you all for actually trying to help! It's really appreciated.
Try as I might, I can't seem to find the right way to write out that a skill should be used when a state is applied.
I do not know a thing about Ruby, and upon looking at the comments on Hime's page, I haven't found a solution to the problem.

Harosata, is there a specific line of code I should enter when using Hime's script? If so, what is it?
Tried it when I got home... works fine.

Hora hora...

Spoiler: Screenshots
zzz_itworksfine_00.PNG zzz_itworksfine_01.PNG zzz_itworksfine_02.PNG
Tried it when I got home... works fine.

Hora hora...

nKA4HOT.png


RrdAtOZ.png


Yes! That's exactly what I wanted! Thank you SO much!

Just a tiny thing I'm not too worried about. After the Grab state is inflicted, the enemy attacks once, THEN does the move I have them programmed to do! A little odd, but it does what I want it to do, so thank you very much!

>Hora hora

The fact that you know what this is, makes me so happy, you don't even know.
If you're still curious about Himework's script, the notetag goes into the Enemy's notebox. This is the lower-right textbox in the database.

<action condition: ID>
FORMULA
</action condition>

ID = list number of your skill/action condition. For example, if Squeeze is the second skill from the top of your list, the ID is 2.

FORMULA = a condition that returns true or false, and uses letter shortcuts. What I mentioned earlier counts, but their shortcuts are:

p.alive_members.any? { |actor| actor.state?(4)}
p.members[0].state?(4)

And replace 4 with the ID of your "Grab" state.

But as your question was already answered, you don't need to have this script anymore.
If you're still curious about Himework's script, the notetag goes into the Enemy's notebox. This is the lower-right textbox in the database.

<action condition: ID>
FORMULA
</action condition>

ID = list number of your skill/action condition. For example, if Squeeze is the second skill from the top of your list, the ID is 2.

FORMULA = a condition that returns true or false, and uses letter shortcuts. What I mentioned earlier counts, but their shortcuts are:

p.alive_members.any? { |actor| actor.state?(4)}
p.members[0].state?(4)

And replace 4 with the ID of your "Grab" state.

But as your question was already answered, you don't need to have this script anymore.

oYYqoFc.png


So, like that, right?

Original thread: https://forums.rpgmakerweb.com/threads/battle-event-enemy-doing-specific-skill-when-actor-has-a-certain-state-inflicted.83730/