Enemy skills trigger?

I am trying to make enemies do a sequence of skills based on certain actor statuses.
For example, yeti grabs main character and if it's still being held the turn after, he will crush him.

I created a custom condition for the main character while being held and gave him a struggle ability to try and break free before he gets killed.

The problem now is, how do i make the yeti enemy trigger the crush skill? Under condition there are only "self" state and not opponent state.
I have tried using a switch when the yeti use the grab skill but how do i let it know to not trigger if the skill fails (50% accuracy)
Been testing it and the switch triggers even if he misses the skill.

Is there a way to trigger a switch when player enter certain status condition?
I would say you can just have the yeti's skill add a "Held" status, have the struggle ability remove it, and have the crush skill require the status and set the priority very high

upload_2018-1-7_17-44-22.png


With the Skill being the crush skill and the state being "Held"


EDIT:

I should add that you'll need to have the attack add a "Held" status to themselves in the skill too at the beginning of the damage formula.

Something like this:

a.addState(10);

with 10 being whatever the "Held" state ID is

Edit again:

Just realized that might not work exactly.. I'll think of something
Hmm but i cannot link crush to held status.
Unless you mean giving held status as a yeti "buff" and have the player try to remove it but in that case how do i prevent the player from using attacks/skills without actually applying the debuff?
I prefer also having it as player debuff since in the future i plan having multiple enemies using combos based on that.

How i did it right now was:
Yeti uses grab
Grabs inflict a debuff which prevent all actions and add struggle ability, triggers common event with the character talking/CG showing and enables switch 001
If switch 001 is on, yeti uses crush
If player struggles, switch 001 turns off

My only problem is, the event happens regardless if the yeti grab lands or misses. Also if the player successfully struggles, the yeti still uses crush because the switch was on at the beginning of the turn.
Edit:

Thinking about it more, I think you'll need a "Grab" and a "Held" status. Something like this:

Skill Grab is used -> Have Grab added to the enemy automatically with a.addState(10); in the damage formula-> chance to inflict "Held" state in Effects in skills

held state restricts all skills, is set to remove after 2 turns and adds struggle skill

Struggle skill is used against the enemy -> chance of removing the enemy's grab status

Crush skill set to high priority with a "Grab" status requirement

Crush skill used (targets all enemies)-> in the damage formula, do an if statement:

if (b.isStateAffected(10))
{damage formula;}
else
{0;}

Also have the Crush skill remove the "Grab" status

Thats the only technique I can think of. The only downside with this way is that your other party members not affected by the status will appear to be taking 0 damage... Not sure of a way around that.

I didn't try it out myself, but it should work.

Let me know if you have any questions.

Edit: One more thing is that the Yeti would be using Crush skill no matter what if the first initial grab failed. I'm not sure of a way around this, but at least it wouldn't damage the players.

One more edit: Added in { } for the damage formula... not sure how i forgot about that.
I'm confused. How can i have a skill target both user and enemy and give them a buff/debuff respectively?
You have the skill target the enemy. In the damage formula you can add a.addState(10); to add the state to the enemy that uses the skill, and either b.addState(10); after that or add it in the effects.

Edit:

I forgot to add for the crush skill you'll also need to add:

a.removeState(stateId)

to the damage formula line:

Edit:

So something like this:

if (b.isStateAffected(HeldID))
{a.removeState(GrabID); damage formula; }
else
{a.removeState(GrabID); 0}
Ooh i see.
All this stuff wasn't in the random tutorials i found on youtube lol.

I managed to get it working.
Now the only problem is the event text/CG triggering even if the enemy fails the grab.

But thank you so much for the help!
You can implement something in the Troops part for that. Have the conditions set for turn end and have the span set for "turn".

then you can set up some conditions in there.

Let me know if you have any questions 🙂
You can implement something in the Troops part for that. Have the conditions set for turn end and have the span set for "turn".

then you can set up some conditions in there.

Let me know if you have any questions 🙂
Hmm is there any way to trigger the event if the player is under certain condition (being grabbed) as a common event rather than end turn?
On end turn with a big party size then the character getting grabbed won't talk until end turn, right? I'm still new to all of this xD

edit: somehow i evaded my own struggle skill lmao.
Sure, if what I said didn't work, you can have the grab skill also trigger a common event that checks for if your party members have the held state. You'll have to check it for each party member.

Do a conditional branch that checks if each party member has the state or not

upload_2018-1-7_19-59-39.png


Edit:

If you wanted to add a message after using the struggle ability you can do a conditional branch that checks the enemy's state too (on the 3rd page of the conditional branch)
I'm guessing i'm doing something wrong.
Do i need a specific trigger? Simply adding the conditional branch and getting the status effect doesn't seems to be working.

edit:i got it working, thanks!
You're welcome 👍😀👍
I was looking back at this thread and thought of something a little better than having the crush skill target all. I was looking at my High Jump skill for an example, and with one of yanfly's plugins (Buffs and States Core) you can have the yeti target that specific person instead of targeting all:

In the Grab status notepad:

// Buffs & States Core

<Custom Leave Effect>

// Get the crush skill.

var skill = 62;

// Get the last targeted index.

var target = -2;

// Queue the forced action.

BattleManager.queueForceAction(user, skill, target);

</Custom Leave Effect>

With this, you wouldn't even need crush to be set as a skill for the enemy, as having the grab status would trigger this. You would change the Crush skill to target one person. Let me know if that works 🙂

Original thread: https://forums.rpgmakerweb.com/threads/enemy-skills-trigger.89576/