Help with event processing a sword breaking things on maps.

I hope this is the correct place to ask, but I am having the hardest time figuring out a feature I'm trying to add in my game. I'm also using Yanfly plugins.The player can press a button using YEP_ButtonCommonEvents to swing his sword on the map like Link in Zelda games. I've figured out how to make the animations so that whatever position he's facing he'll swing the sword in the right direction. I'm also trying to make it where you can break pots, boxes, and cut grass when you swing the sword.

However, I've hit a roadblock and cannot figure out a work around. When the player is next to the "object" and swings his sword the pot or box will break, but it also breaks even if the player is facing away from the object or to the side. I'm also using YEP_EventProximity so I can use parallel process so I can use switches to let the game know when the player is swinging the sword and when he is not. I've tried using conditional branches such as ifplayer is facing x and etc but nothing seems to work. All I want is for the pot to break ONLY when the character is facing the pot and swinging his sword. I've attached photos in hopes it illustrates what I'm talking about. Any advice, cretic, or replies will be greatly appreciated!


Note: I also wanted to note this game still uses turn based battles, but I like for the player to be able to swing the sword outside of battle to break pots and kill npcs.





Capture5.PNG
The sprite sheet I use for when the player is swinging his sword outside of battle.


Capture4.PNG
The common event for the player to swing his sword on the map.





Capture3.PNG
Event page for the pot to break






Capture1.PNG
The pot breaks even when facing away from pot.




Capture2.PNG

The only time I want the pot to break when player attacks.
you need to either compare coordinates or use the correct conditions for facing check with the coordinates.

but I don't see anything in the screenshots where you check the coordinates, how do you determine which event is the target?
If the object has to be in front of the player, then you could use a normal action button trigger on it.

1650331790454.png
The way it determines in this scenario which event is triggered is the event proximity using the activation radius comment otherwise all the pots on the map will break when I swing the sword regardless of where I am. And I'm not too familiar using compare coordinates. How would I do that if you don't mind?

Also i can't use the action button because he has to be able to swing the sword using the common events. Sadly I wish I could combine action button and the sword swing common event lol
oh, I see, if you don't want to compare coordinates, what about something like this?:

Code:
Set Movement route: this event: Turn away from Player
Variable 101 = This event direction // Store the pot direction (Game Data -> Character)
Variable 102 = Player direction // Store the player direction (Game Data -> Character)
If Variable 101 = Variable 102 // pot and player face the same direction
    // Break the pot

😂
Iam not a fan of many Parallel Events but to continue your approach.
Restructure the Pot Event with 2 Eventpages(later on 3 or 4). And do not use Proximity Plugin for this.
We would use a self Evented Proximity Check for it.
This pot can be copy pasted many times, the variables need no further editing.

pot014545.png
Pot02454545.png

If Variable4 = 0 , than a Self Switch needs to be Activated that is Pagecondition for 3rd Eventpage
with Graphic of Broken Pot. I forgot thatone in the Picture.

Edit:
Everytime you do a Swordslash, you Activate the Switch1 "Swordslash" for a few Frames, than you turn it Off again. You allready did that, but in a slightly different place.
Thatway the Pot Events are only Parallel running when realy needed, and that is while a Swordslash.

Not sure if this helps.

Edit2: I made an Error with the Variables and its not correct:
var4 - eventx
var5 - eventy
if var4 less than 0 do var4*(-1)
if var5 less than 0 do var5*(-1)
var4 + var5
if var4 equals 0 than do: Pot is Hit, turn Self Switch On
The player can press a button using YEP_ButtonCommonEvents to swing his sword on the map like Link in Zelda games. I've figured out how to make the animations so that whatever position he's facing he'll swing the sword in the right direction. I'm also trying to make it where you can break pots, boxes, and cut grass when you swing the sword.

All I want is for the pot to break ONLY when the character is facing the pot and swinging his sword.

Seems this has now become somewhat of a full blow custom tutorial lmao
Make sure to follow it all for best results 😉

This method is only using YEP_ButtonCommonEvents ('ok' button triggers common event 1)
No other plugins used with this

Alright sooo stay with me here lol...
this is quite the unique way of doing this but provides great results 😉

Result is like this:


Spoiler: Pot Event
Spoiler: Page 1
1650339489769.png
Spoiler: Page 2
1650339500807.png
Spoiler: Page 3
1650339511171.png
Spoiler: Monster NPC
Very similar setup to the Pots but I noticed that in order to do longer event animations/etc. like the Orc spinning and falling down you need to go to another page due to the parallel event stopping once the "Sword Switch" (in my example Switch 004) is off.. so I just used the Switch 004 + Self Switch 'A' combo page to play a sound and trigger the next page using Self Switch 'B' which then plays a little character dying/fainting animation then turns on Self Switch 'C' to be fully dead/fainted.
Spoiler: Page 1
1650342917819.png
Spoiler: Page 2
1650342928316.png
Spoiler: Page 3
1650342936029.png
Spoiler: Page 4
1650342944572.png
This is what is placed into the event notebox:
JavaScript:
<swordCode:$gameSelfSwitches.setValue([$gameMap._mapId, event._eventId, 'A'], true)>

Spoiler: Sword Common Event - OUTDATED (See Below for more customization)
1650339471913.png

This is the core code used to run the "swordCode" for the events that the player is facing
JavaScript:
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  eval($dataMap.events[event._eventId].meta.swordCode)
})


In doing this whatever javascript code comes after '<swordCode:' and before '>' will be executed
in this case it turns on self switch 'A' of the current event, which in this event is a parallel process activated by self switch 'A' and switch 004 (sword) which then plays the sound of the pot breaking and turns on self switch 'B' with the broken graphic

Wellll hope that all makes at least a little sense to you lol
..I know it's probably alot to take in at first.

Let me know how it goes for ya 🙂
Works really well for me and can also of course be further customized since it's just evaluating whatever code the event has for "swordCode" in the notebox 🙂

Edit:
Okay so that's all good but time to take it even further down the rabbit hole 😀☺️😀...


Okay again stay with me here this might get crazy but very very effective since Yanfly Button Common Event Plugin doesn't allow us to normally run events when overwriting the 'ok' button, here is a way to do that and yet still use our sword whenever we want other than normal events that we should be able to activate using the 'ok' button.

New method results like this:


Here's the new updated method:
Spoiler: Updated Sword Common Event (AKA. Our New OK Button)
1650346811814.png
Code for the common event:
Spoiler: New Common Event Code
Place this at the start of the common event to check if we are using the sword or not:
JavaScript:
$gameSystem.noSword=false;
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  var actionCode = $dataMap.events[event._eventId].meta.swordCode;
  if (actionCode) {if (actionCode.toLowerCase().includes('nosword')){$gameSystem.noSword=true;};};
})
Place this wherever you want the swordCode from the events to execute:
JavaScript:
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  eval($dataMap.events[event._eventId].meta.swordCode)
})

So now we can use our 'swordCode' to make regular events that will activate as normal
by placing 'noSword' as the 'swordCode' that will trigger the standard default ok button.
Though since we still haven't reverted the 'ok' button fully when you want to play a message, choice, etc. things that need the ok button you still need to use Yanfly's plugin command 'RevertButton Ok' before messages, choices, etc. to allow the player to use the 'ok' button. Then once you want to go back to our sword common event use Yanfly's plugin 'SwitchButton Ok'

Like this treasure chest event for example:
Spoiler: Treasure Chest Event Example
1650346841943.png
Now you can place this in the notebox to trigger an event as normal:
JavaScript:
<swordCode:noSword>

Gosh I hope this is making sense. lol

Edit 2:
I suppose I could have just checked if there is no swordCode note then just allow the event to run as normal... eh... I'm tired lol

Use this code instead for the check to see if the sword should be used if you just want to leave the notebox blank to run events as normal:
Spoiler
JavaScript:
$gameSystem.noSword=false;
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  if (!$dataMap.events[event._eventId].meta.swordCode){$gameSystem.noSword=true;};
})
With that code normal events will activate as normal as long as the notebox is blank like this:
Spoiler
1650350182573.png

Okay.. yeah hope you can follow this crazy train lmao
Let me know how it goes. :popcorn:
Seems this has now become somewhat of a full blow custom tutorial lmao
Make sure to follow it all for best results 😉

This method is only using YEP_ButtonCommonEvents ('ok' button triggers common event 1)
No other plugins used with this

Alright sooo stay with me here lol...
this is quite the unique way of doing this but provides great results 😉

Result is like this:


Spoiler: Pot Event
Spoiler: Page 1
Spoiler: Page 2
Spoiler: Page 3
Spoiler: Monster NPC
Very similar setup to the Pots but I noticed that in order to do longer event animations/etc. like the Orc spinning and falling down you need to go to another page due to the parallel event stopping once the "Sword Switch" (in my example Switch 004) is off.. so I just used the Switch 004 + Self Switch 'A' combo page to play a sound and trigger the next page using Self Switch 'B' which then plays a little character dying/fainting animation then turns on Self Switch 'C' to be fully dead/fainted.
Spoiler: Page 1
Spoiler: Page 2
Spoiler: Page 3
Spoiler: Page 4
This is what is placed into the event notebox:
JavaScript:
<swordCode:$gameSelfSwitches.setValue([$gameMap._mapId, event._eventId, 'A'], true)>

Spoiler: Sword Common Event - OUTDATED (See Below for more customization)
View attachment 223611
This is the core code used to run the "swordCode" for the events that the player is facing
JavaScript:
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  eval($dataMap.events[event._eventId].meta.swordCode)
})


In doing this whatever javascript code comes after '<swordCode:' and before '>' will be executed
in this case it turns on self switch 'A' of the current event, which in this event is a parallel process activated by self switch 'A' and switch 004 (sword) which then plays the sound of the pot breaking and turns on self switch 'B' with the broken graphic

Wellll hope that all makes at least a little sense to you lol
..I know it's probably alot to take in at first.

Let me know how it goes for ya 🙂
Works really well for me and can also of course be further customized since it's just evaluating whatever code the event has for "swordCode" in the notebox 🙂

Edit:
Okay so that's all good but time to take it even further down the rabbit hole 😀☺️😀...


Okay again stay with me here this might get crazy but very very effective since Yanfly Button Common Event Plugin doesn't allow us to normally run events when overwriting the 'ok' button, here is a way to do that and yet still use our sword whenever we want other than normal events that we should be able to activate using the 'ok' button.

New method results like this:


Here's the new updated method:
Spoiler: Updated Sword Common Event (AKA. Our New OK Button)
Code for the common event:
Spoiler: New Common Event Code
Place this at the start of the common event to check if we are using the sword or not:
JavaScript:
$gameSystem.noSword=false;
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  var actionCode = $dataMap.events[event._eventId].meta.swordCode;
  if (actionCode) {if (actionCode.toLowerCase().includes('nosword')){$gameSystem.noSword=true;};};
})
Place this wherever you want the swordCode from the events to execute:
JavaScript:
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  eval($dataMap.events[event._eventId].meta.swordCode)
})

So now we can use our 'swordCode' to make regular events that will activate as normal
by placing 'noSword' as the 'swordCode' that will trigger the standard default ok button.
Though since we still haven't reverted the 'ok' button fully when you want to play a message, choice, etc. things that need the ok button you still need to use Yanfly's plugin command 'RevertButton Ok' before messages, choices, etc. to allow the player to use the 'ok' button. Then once you want to go back to our sword common event use Yanfly's plugin 'SwitchButton Ok'

Like this treasure chest event for example:
Spoiler: Treasure Chest Event Example
Now you can place this in the notebox to trigger an event as normal:
JavaScript:
<swordCode:noSword>

Gosh I hope this is making sense. lol

Edit 2:
I suppose I could have just checked if there is no swordCode note then just allow the event to run as normal... eh... I'm tired lol

Use this code instead for the check to see if the sword should be used if you just want to leave the notebox blank to run events as normal:
Spoiler
JavaScript:
$gameSystem.noSword=false;
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  if (!$dataMap.events[event._eventId].meta.swordCode){$gameSystem.noSword=true;};
})
With that code normal events will activate as normal as long as the notebox is blank like this:

Okay.. yeah hope you can follow this crazy train lmao
Let me know how it goes. :popcorn:


Seems this has now become somewhat of a full blow custom tutorial lmao
Make sure to follow it all for best results 😉

This method is only using YEP_ButtonCommonEvents ('ok' button triggers common event 1)
No other plugins used with this

Alright sooo stay with me here lol...
this is quite the unique way of doing this but provides great results 😉

Result is like this:


Spoiler: Pot Event
Spoiler: Page 1
Spoiler: Page 2
Spoiler: Page 3
Spoiler: Monster NPC
Very similar setup to the Pots but I noticed that in order to do longer event animations/etc. like the Orc spinning and falling down you need to go to another page due to the parallel event stopping once the "Sword Switch" (in my example Switch 004) is off.. so I just used the Switch 004 + Self Switch 'A' combo page to play a sound and trigger the next page using Self Switch 'B' which then plays a little character dying/fainting animation then turns on Self Switch 'C' to be fully dead/fainted.
Spoiler: Page 1
Spoiler: Page 2
Spoiler: Page 3
Spoiler: Page 4
This is what is placed into the event notebox:
JavaScript:
<swordCode:$gameSelfSwitches.setValue([$gameMap._mapId, event._eventId, 'A'], true)>

Spoiler: Sword Common Event - OUTDATED (See Below for more customization)
View attachment 223611
This is the core code used to run the "swordCode" for the events that the player is facing
JavaScript:
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  eval($dataMap.events[event._eventId].meta.swordCode)
})


In doing this whatever javascript code comes after '<swordCode:' and before '>' will be executed
in this case it turns on self switch 'A' of the current event, which in this event is a parallel process activated by self switch 'A' and switch 004 (sword) which then plays the sound of the pot breaking and turns on self switch 'B' with the broken graphic

Wellll hope that all makes at least a little sense to you lol
..I know it's probably alot to take in at first.

Let me know how it goes for ya 🙂
Works really well for me and can also of course be further customized since it's just evaluating whatever code the event has for "swordCode" in the notebox 🙂

Edit:
Okay so that's all good but time to take it even further down the rabbit hole 😀☺️😀...


Okay again stay with me here this might get crazy but very very effective since Yanfly Button Common Event Plugin doesn't allow us to normally run events when overwriting the 'ok' button, here is a way to do that and yet still use our sword whenever we want other than normal events that we should be able to activate using the 'ok' button.

New method results like this:


Here's the new updated method:
Spoiler: Updated Sword Common Event (AKA. Our New OK Button)
Code for the common event:
Spoiler: New Common Event Code
Place this at the start of the common event to check if we are using the sword or not:
JavaScript:
$gameSystem.noSword=false;
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  var actionCode = $dataMap.events[event._eventId].meta.swordCode;
  if (actionCode) {if (actionCode.toLowerCase().includes('nosword')){$gameSystem.noSword=true;};};
})
Place this wherever you want the swordCode from the events to execute:
JavaScript:
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  eval($dataMap.events[event._eventId].meta.swordCode)
})

So now we can use our 'swordCode' to make regular events that will activate as normal
by placing 'noSword' as the 'swordCode' that will trigger the standard default ok button.
Though since we still haven't reverted the 'ok' button fully when you want to play a message, choice, etc. things that need the ok button you still need to use Yanfly's plugin command 'RevertButton Ok' before messages, choices, etc. to allow the player to use the 'ok' button. Then once you want to go back to our sword common event use Yanfly's plugin 'SwitchButton Ok'

Like this treasure chest event for example:
Spoiler: Treasure Chest Event Example
Now you can place this in the notebox to trigger an event as normal:
JavaScript:
<swordCode:noSword>

Gosh I hope this is making sense. lol

Edit 2:
I suppose I could have just checked if there is no swordCode note then just allow the event to run as normal... eh... I'm tired lol

Use this code instead for the check to see if the sword should be used if you just want to leave the notebox blank to run events as normal:
Spoiler
JavaScript:
$gameSystem.noSword=false;
var direction = $gamePlayer.direction();
var x1 = $gamePlayer.x, y1 = $gamePlayer.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
$gameMap.eventsXy(x2, y2).forEach(function(event) {
  if (!$dataMap.events[event._eventId].meta.swordCode){$gameSystem.noSword=true;};
})
With that code normal events will activate as normal as long as the notebox is blank like this:

Okay.. yeah hope you can follow this crazy train lmao
Let me know how it goes. :popcorn:

Wow thanks, I'm doing my best but to incorporate this to somehow work... The one thing I am having trouble with thus far is the pots are respawnable. Meaning, when the player leaves the map and comes back the pot will reappear. I only have 1 event page because I've yet to figure out how to erase event with multiple pages and it not act up.
I may need to reconfigure my plugins as sometimes the player will break the pot but then all the pots break as well.
oh, I see, if you don't want to compare coordinates, what about something like this?:

Code:
Set Movement route: this event: Turn away from Player
Variable 101 = This event direction // Store the pot direction (Game Data -> Character)
Variable 102 = Player direction // Store the player direction (Game Data -> Character)
If Variable 101 = Variable 102 // pot and player face the same direction
    // Break the pot

😂
Actually this is exactly what would work with what I'm trying to do! Only problem is how would I configure the variables? And not sure if this is possible with only one page on the event... This is what I've got so far, and alas I know I may have to bite the bullet and make additional pages in order for the graphics to line up.
Iam not a fan of many Parallel Events but to continue your approach.
Restructure the Pot Event with 2 Eventpages(later on 3 or 4). And do not use Proximity Plugin for this.
We would use a self Evented Proximity Check for it.
This pot can be copy pasted many times, the variables need no further editing.

View attachment 223603View attachment 223604
If Variable4 = 0 , than a Self Switch needs to be Activated that is Pagecondition for 3rd Eventpage
with Graphic of Broken Pot. I forgot thatone in the Picture.

Edit:
Everytime you do a Swordslash, you Activate the Switch1 "Swordslash" for a few Frames, than you turn it Off again. You allready did that, but in a slightly different place.
Thatway the Pot Events are only Parallel running when realy needed, and that is while a Swordslash.

Not sure if this helps.

Edit2: I made an Error with the Variables and its not correct:
var4 - eventx
var5 - eventy
if var4 less than 0 do var4*(-1)
if var5 less than 0 do var5*(-1)
var4 + var5
if var4 equals 0 than do: Pot is Hit, turn Self Switch On
This is awesome and believe I can make this work... However I have a hard time reading the Edit2 to make proper changes... do I change the last control variables to conditional branches?
The one thing I am having trouble with thus far is the pots are respawnable. Meaning, when the player leaves the map and comes back the pot will reappear. I only have 1 event page because I've yet to figure out how to erase event with multiple pages and it not act up.
With my method that is quite possible and controllable to have them either respawn or remain

For the pot use something like this on the last page instead of my previous example...
The whole pot event is like this:
Spoiler: Pot Event - Page 1
1650420153244.png
Spoiler: Pot Event - Page 2
1650420169091.png
Spoiler: Pot Event - Page 3
1650419896038.png

Looks like this in game:


Edit:
I've also now even made it possible to have events that don't get erased can also be respawned/reset 😉
So that you can have other things happen like loot drops or a fainted enemy graphic stays until you re-enter the map

Like this:
Place an "initialize" event on the map that calls a common event
Spoiler: Initialize Event
1650423787396.png

1650439768559.png

Reset Event Code:
JavaScript:
$gameSystem.resetEventList = $gameSystem.resetEventList || [];
$gameSystem.resetEventList[$gameMap._mapId] = $gameSystem.resetEventList[$gameMap._mapId] || [];
$gameSystem.resetEventList[$gameMap._mapId].forEach(function(ev){
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'A'], false);
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'B'], false);
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'C'], false);
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'D'], false);
});
$gameSystem.resetEventList[$gameMap._mapId] = [];
That code simply just clears all self switches for all the events of the map in the 'resetEventList' then clears the list
In a move route of the event you want to reset/respawn place this code:
JavaScript:
$gameSystem.resetEventList[$gameMap._mapId].push(this)
Like these examples:
Spoiler: Pot Event - That Drops Random Amount of Loot Gold
1650439593198.png

1650424116609.png
Spoiler: Orc Monster that faints
1650439671705.png

1650424231022.png
Doing that results like this:
With my method that is quite possible and controllable to have them either respawn or remain

For the pot use something like this on the last page instead of my previous example...
The whole pot event is like this:
Spoiler: Pot Event - Page 1
Spoiler: Pot Event - Page 2
Spoiler: Pot Event - Page 3

Looks like this in game:


Edit:
I've also now even made it possible to have events that don't get erased can also be respawned/reset 😉
So that you can have other things happen like loot drops or a fainted enemy graphic stays until you re-enter the map

Like this:
Place an "initialize" event on the map that calls a common event
Spoiler: Initialize Event
View attachment 223731
View attachment 223748
Reset Event Code:
JavaScript:
$gameSystem.resetEventList = $gameSystem.resetEventList || [];
$gameSystem.resetEventList[$gameMap._mapId] = $gameSystem.resetEventList[$gameMap._mapId] || [];
$gameSystem.resetEventList[$gameMap._mapId].forEach(function(ev){
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'A'], false);
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'B'], false);
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'C'], false);
  $gameSelfSwitches.setValue([$gameMap._mapId, ev._eventId, 'D'], false);
});
$gameSystem.resetEventList[$gameMap._mapId] = [];
That code simply just clears all self switches for all the events of the map in the 'resetEventList' then clears the list
In a move route of the event you want to reset/respawn place this code:
JavaScript:
$gameSystem.resetEventList[$gameMap._mapId].push(this)
Like these examples:
Spoiler: Pot Event - That Drops Random Amount of Loot Gold
Spoiler: Orc Monster that faints
Doing that results like this:

I think this makes sense and seems like exactly what I'm trying to do... One question though... Do I change the OK button in buttoncommonevents plugin parameters? I have everything else the same I believe.
I think this makes sense and seems like exactly what I'm trying to do... One question though... Do I change the OK button in buttoncommonevents plugin parameters? I have everything else the same I believe.
This is my plugin parameters.. all OK buttons connect to common event #1 (Aka. Sword)
Spoiler: Plugin Parameters
1650482867470.png
Spoiler: Common Event #1
1650482688519.png
Is that what you were asking? Sorry if I misunderstood
This is my plugin parameters.. all OK buttons connect to common event #1 (Aka. Sword)
Spoiler: Plugin Parameters
Spoiler: Common Event #1
Is that what you were asking? Sorry if I misunderstood
Wow good stuff! Think it's working good... One last question, do I need to change all OK keys to the common event in the parameters or do I need at least just one? When I load up the game in test play I notice I can't hit OK on the title screen and have to click with the mouse. Is there a work around for this... Again, thank you so so much for all your help thus far. Very great stuff!
Wow good stuff! Think it's working good... One last question, do I need to change all OK keys to the common event in the parameters or do I need at least just one? When I load up the game in test play I notice I can't hit OK on the title screen and have to click with the mouse. Is there a work around for this... Again, thank you so so much for all your help thus far. Very great stuff!
Much welcome ☺️
Very odd, I changed them all as previously show but yet it still allows me to use any of the 'OK' keys while in the title & all menu scenes. Is there any other plugin perhaps blocking the OK button?

However no you don't really need to change them all, I just did to make it all uniform to allow the player to press any of the 'OK' keys to use the sword.
Much welcome ☺️
Very odd, I changed them all as previously show but yet it still allows me to use any of the 'OK' keys while in the title & all menu scenes. Is there any other plugin perhaps blocking the OK button?

However no you don't really need to change them all, I just did to make it all uniform to allow the player to press any of the 'OK' keys to use the sword.
You are a wizard CT!! Got it working and yes it was another plugin conflicting but it was one I didn't need so it all works now. Thank you yet again so much for everything and taking the time to help me work this out.
You are a wizard CT!! Got it working and yes it was another plugin conflicting but it was one I didn't need so it all works now. Thank you yet again so much for everything and taking the time to help me work this out.

Awww shucks no prob ☺️
Yay!! Really glad to hear it's working
Very happy I could help out 😀

Happy Game Making! :popcorn: ☺️

Original thread: https://forums.rpgmakerweb.com/threads/help-with-event-processing-a-sword-breaking-things-on-maps.146886/