- Joined
- Jan 7, 2014
- Messages
- 115
- Reaction score
- 85
- First Language
- English
- Primarily Uses
- RMMV
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.
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?
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.
