How can I make one event touch other event and start a condition? The objective is use a "MOG HUNTER PICK AND THROW" plugin for attack enemies, like a Zelda with pot or Goofy Troop combat (SNES). The event A (barrel, pot or rock, anyway) touch a moving event B (enemy), an that way I will make a damage in enemy using my event systems. The question is: how can I make a event touch other event and trigger conditions?...
As mentioned by
@Tea's Jams this is no easy task to do. Especially without causing memory leakage or causing other issues. I've tried to code plugins for this a few times in the past and always had some issue come up.
However today to solve your issue I decided to take another try at it and believe I have some pretty good results
☺️
This time I have made the plugin that will run any code that you put into the triggering event.
Which seems most optimal.
This plugin also will have very minimal memory leak issue (shouldn't) as long as the inputted code is done correctly, but that will be up to you (the game designer).
To solve the issue of too many processes occurring at once like can happen by creating parallel processes or linking directly to an update function. The plugin I created will only check to run the code placed in the event's page upon the event "moveStraight" and also "updateJump" when the Jump has landed.
Also since you mentioned using MOG's Pickup & Throw plugin, I added compatibility for that.
I did have to overwrite the 'Game_CharacterBase.prototype.canPassThrow' function though to allow thrown events to actually hit/land on the target event though.
So make sure to
place my plugin below MOG's Pickup & Throw plugin
Well without further ado..
I present to you my newest Event Trigger Event plugin MV:
Allows Events to Run Code When Touches Other Events
ct-bolt.itch.io
Here's how to use it:
Setup:
Place the following notetag into an events notebox:
<eTrigger:true>
This can also be javascript such as: <eTrigger:$gameSwitches.value(1)>
That will only have the Event Trigger the "Event_Trigger" code if switch 1 is on
After placing the notetag then use the following comment setup: Event_Trigger: <**javascript code goes here*** />
Some very basic examples would be like the following:
Example #1:
Event_Trigger: <
$gameMap.eventsXyNt(x, y).forEach(function(event) {
event._triggeredBy = this;
$gameSelfSwitches.setValue([$gameMap._mapId, event._eventId, 'B'],true);
},this);
/>
The above code cycles though each events that is touched that are not using the "through" setting
It then assigns the event that is calling the code to the property "_triggeredBy" to the event
Then it turns on Self Switch "B" of that event
Example #2:
Event_Trigger: <
$gameMap.eventsXyNt(x, y).forEach(function(event) {
if ($dataMap.events[event._eventId].meta.targetEvent){
$gameSelfSwitches.setValue([$gameMap._mapId, event._eventId, 'B'],true);
};
});/>
The above code cycles though each events that is touched that are not using the "through" setting
If the "touched" event has a meta tag "targetEvent" then it turns on Self Switch "B" of that event
again this is only if it has the meta tag "targetEvent", like this <targetEvent:true> in the notebox
Example event(s):
Spoiler: Throwable Pot
The above code cycles though each events that is touched that are not using the "through" setting
If the "touched" event has a meta tag "targetEvent" then it turns on Self Switch "B" of that event
again this is only if it has the meta tag "targetEvent", like this <targetEvent:true> in the notebox
So when using something like this you will also need to have events that have a tag in the notebox <targetEvent:true>
Spoiler: Example of a "Target Event"
Spoiler: Orc Knight
The above code cycles though each events that is touched that are not using the "through" setting
It then assigns the event that is calling the code to the property "_triggeredBy" to the event
Then it turns on Self Switch "B" of that event
Spoiler: Game of Tag like in the Demo on the plugin page - Event Setup
Spoiler: Event Trigger Code
Event_Trigger: <
var event = $gameMap.eventsXyNt(x, y)[0];
if (!$dataMap.events[event._eventId].meta.noEventTrigger){
event._triggeredBy = this; $gameSelfSwitches.setValue([$gameMap._mapId, event._eventId, 'B'],true); $gameSelfSwitches.setValue([$gameMap._mapId, this._eventId, 'C'],false);
};
/>
Results look like this:
I might still add to this later too so it's kind of released but also still somewhat Beta
:popcorn:
Well hope all this makes at least some sense lol... anyways let me know how it goes.
Hope all works out to suit your need.
☺️