I know there's no standard trigger for this (unfortunately, there really should be), but I'm wondering i there is some solution to it besides making a new custom plugin (I don't have the skills to do that). If one already exists that I have missed, please do tell.
Otherwise, is there maybe some kind of script command or anything that could be used in what I want to do, which is:
For the player to be able to push certain objects onto enemy on-map sprites and have them take damage/destroy them.
If it was just one object the player could push and one enemy, I could simply do the rather tedious solution of tracking both event's x and y position and see if they overlap. But I can't do that for a large dungeon with several monsters and several objects to be used by the player. Or well, I guess I technically could but... you know, that would be kind of painful to execute.
(just to be clear, the "push the object" part is not what I'm asking about. I'm asking about how to trigger the collission between the enemy sprite and object being pushed).
If the objects being pushed are all the same, and the objects they're being pushed onto are all the same, I'd just give all the 'target' events the same name, and set up a common event that gets called by the pushed objects, to move away from player, check if there is another event on the destination tile, and if there is, does it have the 'target' event name? If it does, then turn on a self switch on the 'target' event which does the damage/destruction you're after.
You don't need a plugin, but you will need several script calls. And you'll need a way to allow the pushed item to go onto the 'target' item but not onto other events.
If one of the events is set to Through, will it let you throw something onto another event?
You might have problems getting the enemies to walk into the player and cause damage if you have them set to above or below player - that would require them to be on the same tile as the player, so they really should be set to same as characters. Which means the event you're throwing will have to be thrown onto a 'same as characters' priority event. If it can't, the event being thrown would have to be set to above/below characters, which could cause issues with the picking up side of things. I'm not sure if setting the event to same as characters, and through, will cause the same potential issues.
Experiment with that a bit, and see what's possible with the pick-up-and-throw plugin. I'll look up some script calls for determining what it lands on after I get home.
Let us know if that works for you. I'm lazy, and don't want to look up the info if you already have a solution 😀
Okay, I've just done some simple testing so there could still be complications down the road I'm not yet aware of but Galv's plugin seems to do the trick when it comes to checking if the event in question is overlapping another event or if it's a specific x/y position.
This is also very usable when doing push-block-floor-switch puzzles.
But I've yet to figure out a good way to throw or push the blocks in question ONTO enemy events. It could be, there's no elegant solution to it besides asking (which would mean paying, probably) someone to modify Moghunter's plugin for me. If he even allows such things?
I dunno. I'm still open to suggestions regarding this. But worst case scenario, I might just scrap all enemies from the entire game and make a straight up puzzle game out of it instead.... If there is no good solution to be had that is.
Oh it's quite possible, I myself use event based projectiles. I have repurposed one as a boulder. On the first page it simply plays whatever boulder lifting animation you want. The second page covers all the "magic", I've commented the interesting areas. This particular solution is using Yanfly's Self Variables & Switches but you can obviously use whatever variables/switches you want. Here I'm making the boulder check the space in front of it for an event, then if it finds one it moves one step forward (to give the illusion of being on top of it), then turns on that event's self switch D, and the boulder's self switch B.
Oh and pardon the rough code, I opted for an earlier prototype projectile to make the example easier to understand. Later ones started differentiating between what types of events. I'm a bit worried if I'm left alone long enough with them, my projectiles will become self-aware. :hwink:
Ah yes, Mog's notoriously hard to work with plugins. I took a look at that plugin and played with Mog's Master file to see how it works. As best I can tell it literally ignores all other code on the event page and just runs the throw code. As my knowledge of editing plugins is currently very little, I can't really advise how to edit the plugin directly. However I have a potential idea to work around it
The first image is an event, put it on any map you where you want to throw stuff. The second is just the code for the target event. I just edited the events in Mog's Master file, so if you have that around it's an easy copy and test.
The first event is just capturing the event ID of whatever is in front of the player in variable 1 whenever they hit the okay button. Then the other is the switch code that compares variable 1 against the position of the button. I tested it in Mog's own Master project, and it worked perfectly. The downside is you have to have the first event appear on any map you want to use the pick up and throw. So maybe use Yanfly's Event Copier in case you edit it in the future.
Okay, it's mostly the other event that confused me be it might clear up as I eat breakfast and actually tests it out in MV.
Else, I'll be back here asking questions again I guess 🙂