How do I make a skill activate a specific event on the map

Hello all! So I'm trying to create a Golden Sun-style spell system - where you can cast a certain spell on the map to effect the environment, solve a puzzle, reveal secrets, etc, etc. Also similar to Pokemon HMs. I'm specifically trying to replicate the Frost spell from Golden Sun in this example. You need to open the menu then cast to specific spell to solve the puzzle.

frost2_resize.gif

frost4_resizex.gif


I do have something working already. Unfortunately, I'm not sure how to activate a specific event with a skill. If I have multiple "Frost" events on the map, the skill will activate all of them. I know why it's happening but what's the best way to go about activating specific events? Do I need to create specific region ids for each event?

So this is my method. I have two common events - Frost and Frost duration. I surround the on-map frost event with 4 region ids. Depending on the Id the player is standing on, the player will turn to the event, "cast" the spell then the event activates. I have a parallel process checking when the player is standing on one of those ids.

1707282350614.png

1707283324497.png

1707283414653.png

1707283485797.png


Sorry for all the images and slightly complicated question. I'm just wondering if there's a more efficient method. The idea is the player can cast up to three of these frost spells (to effect the environment) but they'd have to unlock the ability to "concentrate" on more than one. Anyway, thanks everyone!
right side panel, under the damage formula, skill after-effect.
use your common event there.
right side panel, under the damage formula, skill after-effect.
use your common event there.
Yes, that's how I'm currently activating the events on the map. The spell frost calls the common event "Frost" which then does it's thing. I guess I should have mentioned that. Is there an efficient way to target multiple specific events with this method.
you mean events on the map?
"events" are there to be interacted *with*, by the player.
if you want to trigger "an" event through an action by the player through the main menu, you gonna have to fake it.
it can be "triggered" "directly" ("ish") but it's rather complex and somewhat unstable.
your best bet is to engineer it so that it looks like an interaction, but it's actually an after-effect.

you may want to use the common after-effect to raise a variable or a self-switch (directly, manually, which is something that can be done without messing it up, and will still bounce over to the map event, triggering it) and set the event to respond to that self-switch.

SSwitches can be changed in bulk with a loop.
you mean events on the map?
"events" are there to be interacted *with*, by the player.
if you want to trigger "an" event through an action by the player through the main menu, you gonna have to fake it.
it can be "triggered" "directly" ("ish") but it's rather complex and somewhat unstable.
your best bet is to engineer it so that it looks like an interaction, but it's actually an after-effect.

you may want to use the common after-effect to raise a variable or a self-switch (directly, manually, which is something that can be done without messing it up, and will still bounce over to the map event, triggering it) and set the event to respond to that self-switch.

SSwitches can be changed in bulk with a loop.
Thanks for the help! Ok, I'm thinking that's not too different from what I have right now. Could you explain what you mean by after-effect? And could you talk more about "Triggering it directly (ish)"? Or if there's a link or tutorial out there about this topic - that would be really helpful.

I was following this MV/MZ tutorial but got stuck on the bottom half. Basically, it shows you how to set up your skills and events so the player can choose when and where to use the skills (to activate an event). That's what I'm trying to do.


1707553320996.png


So the part above is what stopped me. The script box in Control Variables options for VX Ace doesn't allow me to enter the piece of code (converted into Ruby) - $game_map.event_id_xy($game_player.x, $game_player.y). There's not enough space in the script box.

1707553752446.png


Any suggestions on how to enter/replicate this bit of code in VXA so I can continue with the tutorial? Thanks everyone!
"Triggering it directly (ish)"?
you could code the after-effect of the skill to send a fake key press to the event and trigger it, as you would normally.
it involves poking the process in unorthodox ways, so it's not recommended.
the correct way is to fake it with an after effect, in two parts.... but a compromise between the two would be to raise that SSwitch and have the event handle it on it's own, if you must have the map event handle it all (for design purposes)

I think there's a function in Ace's code called X_with_direction or something, where you provide player's location and facing, and it brings whatever is in front of the player.
no need to check for facing 4 times.

work backwards here: solve the exit of the sequence, then solve the sequence itself (which would be an animation alone), then the triggering of the sequence, and then the position check.

There's not enough space in the script box.
you can wrap that with other simpler functions with a small plugin.

go into the code section and add something like:
Code:
module Custom
 def self.wrapper(params)
  $object.method_with_an_insanely_long_name(params)
 end
end

then call Custom.wrapper(X) from somewhere else.
Any suggestions on how to enter/replicate this bit of code in VXA so I can continue with the tutorial? Thanks everyone!
If you want to use this method then use the script command not the variable script method
1707575579906.png

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-skill-activate-a-specific-event-on-the-map.165529/