[ACE] Help with making an alternate event trigger button

Status
Not open for further replies.

Vassim74

It's a Secret!
Veteran
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Vassim74

It's a Secret!
Veteran
Joined
Jan 7, 2014
Messages
115
Reaction score
85
First Language
English
Primarily Uses
RMMV
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 :) .
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top