[ACE] Help with making an alternate event trigger button

I am still very new to RGSS so please bear with me.

For the purpose of adding a pickpocket feature to my game, I want to use an extra button that can also trigger an event. Though I assigned Input Z (D on the keyboard) as an extra event trigger button, it is not as perfect as I had hoped. The extra button (In this case, Input Z) for triggering an event requires you to move your character against the event in order for it to actually work. I want to make it so that pressing Input Z will trigger an event just like how you'd normally do it by pressing Input C (Z or Spacebar on the keyboard) while standing next to the event and facing it.

Here is what my script looks like:

class Game_Player < Game_Character#----------------------------------------------------# Pickpocket Button Addon#----------------------------------------------------def start_map_event(x, y, triggers, normal) return if $game_map.interpreter.running? $game_map.events_xy(x, y).each do |event| if event.trigger_in?(triggers) or Input.press?🙂Z) && event.normal_priority? == normal event.start end end endendI've tried changing Input.press? to Input.trigger?, but the result is the same. Can someone please help me with this? I'd really appreciate it. 🙂

Also for the record, I am aware that events have button press conditional branches. I just find it to be a lot more convenient if I only have to press one button to trigger the conditional button event rather than having to hold the conditional button and activating the event with Input C.
I'm not sure what you're saying the problem actually is. If it's not responding at all, I think it's because you've got the input check in the wrong place.


start_map_event is only called if Input::C is being pressed. So if the problem is that you have to be moving towards it at the same time as pushing the button, that's because that condition will only be true if you're pressing BOTH buttons at the same time or you've got it set to a touch event (I think).


If you want it to allow Input::Z to be a trigger instead of (or in addition to) Input::C, you'd have to test for it at the same place. So you'd have to do something in update_nonmoving, I think.


If you only want certain events to be triggered by Input::Z and not all of them, THEN you could add some logic into the method you've modified here, but it would be in addition to changing update_nonmoving, and you'd have to have something in the event to tell whether it responds to :C or :Z.
If you want it to allow Input::Z to be a trigger instead of (or in addition to) Input::C, you'd have to test for it at the same place. So you'd have to do something in update_nonmoving, I think.
Ah, that was it! I didn't know about the whole update_nonmoving thing >_< . I originally did this modification in both RMXP and RMVX, and it wasn't as complex as this since all I had to do was add another Input press similar to the above and it worked normally. Anyway, thank you very much! This issue is considered solved now 🙂 .
Yeah, Ace breaks things down into more/smaller methods than the previous two makers, to make it easier to introduce changes.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/ace-help-with-making-an-alternate-event-trigger-button.22533/