Changing the NPC's local switch by touching him, even if he's running a event.

Hello! I want to know if there's some way to change the NPC's switch by touching him, even if he's running a event.


Example:
I made a event that runs in "Parallel" and the NPC is supposed to interact with some stuff to build a monster. ( http://prntscr.com/bp6ldj )
I already finished the event, but I want to make it so you can interact with him to make him stop building the monster and attack you. How do I do that? ( https://sendvid.com/bfhxzyql this is the video of the script running, graphics are obviously not finished yet )
Thanks! 
EDIT: http://imgur.com/a/Z9Nhd this is the event, I probably could fit them into just one or two pages, but I didn't think about it at that time. 😛  
Thank you for the video and all, but you're actually missing the most crucial screenshot; a screenshot of the event contents. Showing a screenshot of the map won't help us in understanding how your events are setup 😛


Can you provide more screenshots of all the events involved?
Thank you for the video and all, but you're actually missing the most crucial screenshot; a screenshot of the event contents. Showing a screenshot of the map won't help us in understanding how your events are setup 😛


Can you provide more screenshots of all the events involved?

Edited the post with it, thanks! 🙂  
@st4rdust: you need to restructure the entire event, because you can't interrupt a sequence like that.


Additionally, where and how do you check the finished "building"? that is an event page that is still missing, and we need to know how the process is checked.


But basically, you can't interrupt a parallel unless you provide a way for the interruption. One option would be to move him around with autonomous movement instead of set move route, and keep the page content on action button for the disruption. Another way would be to place conditional branches on your parallels, or a third one would be to use a second parallel event to check for key presses.


But we can't determine which way is best unless we know how you handle the building of the monster.


One more advice:


ALWAYS, ALWAYS name your switches and variables. Using unnamed variables like you did will cause you a lot of headaches when it comes to bughunting your completed game.
@st4rdust: you need to restructure the entire event, because you can't interrupt a sequence like that.


Additionally, where and how do you check the finished "building"? that is an event page that is still missing, and we need to know how the process is checked.


But basically, you can't interrupt a parallel unless you provide a way for the interruption. One option would be to move him around with autonomous movement instead of set move route, and keep the page content on action button for the disruption. Another way would be to place conditional branches on your parallels, or a third one would be to use a second parallel event to check for key presses.


But we can't determine which way is best unless we know how you handle the building of the monster.


One more advice:


ALWAYS, ALWAYS name your switches and variables. Using unnamed variables like you did will cause you a lot of headaches when it comes to bughunting your completed game.

Thanks for answering!


First, I had to port the map to another project because the one I was using was in PT-BR, my language, so that's why they didn't have any names.



The sixth switch activates the monster and is the finished event. But I will "rebuild" the event because it's pretty cluttered.


Also, how do you make a condition branch to check if a player pressed the action button on the NPC? I tried to but you can only check if the player is on a set direction or if he's on the party (Correct me if I'm wrong)


I will try to make a NPC which has a determined set of movements, and events on each box that has "On Event Touched" set in them to activate the "Holding piece of the monster" on the NPC, but wouldn't that make it so the player can also activate it?
EDIT: "Event Touch" only works for players 🙁  
@st4rdust: you need to restructure the entire event, because you can't interrupt a sequence like that.


Additionally, where and how do you check the finished "building"? that is an event page that is still missing, and we need to know how the process is checked.


But basically, you can't interrupt a parallel unless you provide a way for the interruption. One option would be to move him around with autonomous movement instead of set move route, and keep the page content on action button for the disruption. Another way would be to place conditional branches on your parallels, or a third one would be to use a second parallel event to check for key presses.


But we can't determine which way is best unless we know how you handle the building of the monster.


One more advice:


ALWAYS, ALWAYS name your switches and variables. Using unnamed variables like you did will cause you a lot of headaches when it comes to bughunting your completed game.

http://imgur.com/a/Fh4B7 


I tried to create another parallel event that checks if the player pressed OK, but couldn't make a condition of "The player is near the NPC"


Have I, at least, done this right?
yes, and placed this way it shows that there is a much easier way to implement that.


Use neither set move route nor control switch commands.


Use the move route command "Switch ON" at the places where you interrupted the move route to place the control switch command.


This will create one (large) move route containing everything, but do not place this move route into a set move route command, place it into the autonomous movement (switch it from fixed to custom and then program the move route there)


In case you didn't see it - the autonomous movement is between the sprite selection and the content area (left of the content area).


Done that way you don't need to use parallel trigger (autonomous movement is automatically parallel) and can use the action button trigger to switch the event to a "defeated" page that has no autonomous movement, disrupting the building of the monster on action button.
yes, and placed this way it shows that there is a much easier way to implement that.


Use neither set move route nor control switch commands.


Use the move route command "Switch ON" at the places where you interrupted the move route to place the control switch command.


This will create one (large) move route containing everything, but do not place this move route into a set move route command, place it into the autonomous movement (switch it from fixed to custom and then program the move route there)


In case you didn't see it - the autonomous movement is between the sprite selection and the content area (left of the content area).


Done that way you don't need to use parallel trigger (autonomous movement is automatically parallel) and can use the action button trigger to switch the event to a "defeated" page that has no autonomous movement, disrupting the building of the monster on action button.

Thanks so much! It finally worked 🙂  

Original thread: https://forums.rpgmakerweb.com/threads/changing-the-npcs-local-switch-by-touching-him-even-if-hes-running-a-event.64829/