Assassination Mechanic Help

I am trying to get this assassination game mechanic to work where ideally the player can approach an Event/Npc from behind and get the option to assassinate them if the player has the "Assassinate" Skill.

I'm having several issues I will list in order.

1. Characters who have not learned the skill are getting the option to use it, and able to use it, despite all of the switches and checks I have tried to apply.

2. When the ability is used I scripted a self switch in the common event associated with the skill that is supposed to change the event to show the character collapsed as if assassinated. I can get the assassination to work, but the self switch won't trigger and I'm not sure how to set up my common event script for the ability to trigger a change in the event/npc that doesn't effect every other event and npc. For context, I tried a normal switch and tried having that trigger with the assassination, but when that switch gets turned on, every npc that can be assassinated would collapse along with the one you targeted because it's like a blanket effect instead of a personalized one like a self switch. So I made a self switch in that npc that is the collapsed character, and coded the common event to trigger it when assassination is confirmed by the player.

3. Generally I am confused about common events and how they trigger at this point because I've tried setting the trigger to "none", "autorun" or "parallel" with the associated switches and the only way I've gotten anything to run is by making an invisible event on the map that triggers the switch for if the character has the ability or not.
Screenshot (1248).png
Screenshot (1234).jpeg
Screenshot (1235).jpeg
Screenshot (1236).jpeg
Screenshot (1237).jpeg
Screenshot (1239).jpeg
Screenshot (1240).jpeg
Screenshot (1242).jpeg
Screenshot (1243).jpeg
Screenshot (1244).jpeg
Screenshot (1245).jpeg
make a condition if the actor has the skill that is in first position.

$gameParty.members[0] or $gameParty.leader.hasSkill(id of skill)

the "hasSkill(ID)" isn't correct here, but there is a check if they have it.
if they have it, use it directly rather than using a choice to assassinate unless
you want them to cancel it (do it with a timer).
I think the biggest takeaway here is you have some misunderstanding about event settings - it might serve you well to back up, read through the instructions regarding events, and look up some additional tutorials to work through.

When the ability is used I scripted a self switch in the common event associated with the skill
There's no such thing as a self switch on a common event. Only map events have self switches.

the self switch won't trigger and I'm not sure how to set up my common event script for the ability to trigger a change in the event/npc that doesn't effect every other event and npc.
You can either use a game variable/switch and have the other events reference that as a condition, or you can use the script call to set a self switch on a map event from within a common event.

I'm working through your post in order, so at this point I don't understand why you're calling a common event from a map event and not just setting the self switch on itself.
3. Generally I am confused about common events and how they trigger at this point because I've tried setting the trigger to "none", "autorun" or "parallel" with the associated switches
This is going to go back to my first point - your ability to progress in making a game with RPG Maker relies fairly heavily on you understanding the eventing system. Some general errors I see:
- Your corpse is a parallel event. Why? That's going to continuously display those text boxes about it being dead, because parallel means it runs and loops automatically. That should be action trigger.

- Your AssassinateAttempt2 event has an "Exit Event Processing" in the No branch - why? There are already no further event commands beneath that. You're telling it "don't do the other things that aren't there."

- When is your AssassinateCheck event run? Is switch 11 ever turned on? That doesn't seem like you should need a common event for that. You'd either use a Skills plugin to turn on the switch when it's learned or you'd embed the conditional in your event to check whether the player has learned the skill before displaying the option.

Okay, I'm now at the bottom of the post, and I'm still unsure why Assassinate is a common event. If you simply copy all of that, paste it into the NPC event itself, and include the Self Switch command there, it will work exactly the way you like. Then you only need to copy and paste that block of commands between events.

make a condition if the actor has the skill that is in first position.

$gameParty.members[0] or $gameParty.leader.hasSkill(id of skill)
There's no need for a script call, checking for a skill is one of the basic options in Conditional Branch.

1716209761217.png
Okay, I'm now at the bottom of the post, and I'm still unsure why Assassinate is a common event. If you simply copy all of that, paste it into the NPC event itself, and include the Self Switch command there, it will work exactly the way you like. Then you only need to copy and paste that block of commands between events.


There's no need for a script call, checking for a skill is one of the basic options in Conditional Branch.

View attachment 305706

I have a version of this that is input into a specific event, and that did work great, but I wanted to make it a common event to avoid having to script the same thing for each individual event and save some of my self switches for other things.

Going to try some of the things you mentioned thanks! I've watched some tutorials and stuff on events but just having a hard time with them I guess. Your advice definitely helps clarify a lot.
I wanted to make it a common event to avoid having to script the same thing for each individual event
It's not like that has to require effort on your part - you can copy and paste lines and selections between events. 😉

and save some of my self switches for other things.
There are plugins that add additional self switches. You might also (I haven't seen what you're doing with all of them) be able to combine some of your pages and use conditional branches within a page.
You can either use a game variable/switch and have the other events reference that as a condition, or you can use the script call to set a self switch on a map event from within a common event.
This is what I was trying to accomplish with the Self Switch in my Common Event for Assassinate.

There's no such thing as a self switch on a common event.
I meant that I made a common event, and within that event I put a "Self Switch A = On". So if I'm following you correctly, then putting that Self Switch in the common event is not the same as making a script call like you are saying? My logic was, if in my common event it says, "Self Switch A = On" then when that common event runs, whatever event it is running on will run it's Self Switch A.

If it's not too much trouble can you explain why common events even have the option to turn self switches on?

When is your AssassinateCheck event run? Is switch 11 ever turned on? That doesn't seem like you should need a common event for that. You'd either use a Skills plugin to turn on the switch when it's learned or you'd embed the conditional in your event to check whether the player has learned the skill before displaying the option.
The common event "AssassinateCheck" has the check for the skill "If ___ has learned Assassinate" followed by "Control Switches : #0011Assassinate ON". I also made a separate invisible Event that is the same settings, checking for the skill and turning the Switch on. It seems like only the invisible event worked so far.

Also, I made a big goof and posted the wrong screenshot of the Assassinate common event. This is the actual common event for Assassinate, the "AssassinateAttempt2" was an old one from when I was first screwing around with it. Going to update my og post screenshots.
Screenshot (1248).png


My take aways right now are that I need to ditch the parallel processing and do either "none" or autorun with the associated Switch for the common event being turned on by... an Event? Or just put a conditional "If player learned Skill" turn Switch on at the top of the Common Event for assassinate?

And if that doesn't work, I need to just write in the check for the individual events instead of a common event like we talked about above.
If it's not too much trouble can you explain why common events even have the option to turn self switches on?
There aren't different event commands listed between the map event, common event, and troop event screens. Not all of them are applicable to that specific screen.

For example, when you're adding a command to a map event, you can still access the Change Enemy HP command, but it's impossible for that to mean anything in that situation. You can Control Self Switch in a troop event, too, but it's not going to do anything there.

I've never tried what you tried - it's possible that it should do what you think, but you're the one who said it wasn't working 😛

The common event "AssassinateCheck" has the check for the skill "If ___ has learned Assassinate" followed by "Control Switches : #0011Assassinate ON".
Yes, but
- When is your AssassinateCheck event run?

My take aways right now are that I need to ditch the parallel processing and do either "none" or autorun with the associated Switch for the common event being turned on by... an Event?
I'm just not sure which part of this you feel needs to have either Parallel or Autorun. They are the same thing, they both run and loop automatically, just Autorun additionally blocks player input. I don't see what part of this setup needs either of those things.

So, this works perfectly for me:
1716214573438.png


This also works perfectly for me.
1716214638305.png

1716214649305.png


So I guess I can't duplicate the issue you're having. But there's definitely no need for anything parallel/autorun.
There's no need for a script call, checking for a skill is one of the basic options in Conditional Branch.
isn't it better if you have a party of 4 that $gameParty.leader is checked rather than 4
or all actors separately (if it can choose in 7 to 12 different actors that run the party?)

I think the scriptcall is a cleaner way as it just checks who is leading and has the skill.
isn't it better if you have a party of 4 that $gameParty.leader is checked rather than 4
or all actors separately (if it can choose in 7 to 12 different actors that run the party?)

I think the scriptcall is a cleaner way as it just checks who is leading and has the skill.
The OP's event that checks for the Assassinate option to be present is looking specifically whether their Igorr actor has the skill.

Nothing in the OP says Igorr has to be the first actor in the party. You could be right, but I don't see that stated.

Original thread: https://forums.rpgmakerweb.com/threads/assassination-mechanic-help.168856/