Conditional branch if key is only pressed for a short time, but not being holded

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
Howdy,

Is it possible to set that conditional branch in the common parallel event will only activate if specific key is pressed for a short time, but not if being holded? Because strange things happens if player holds the key. Normally this event should not repeat and would end after one cycle (i'm turning off the trigger switch at the end of the event). It works if player presses the button for a short time, but it seems that if player holds the button, the event repeats in strange manner.

Help!
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
947
Reaction score
2,213
First Language
Not English
Primarily Uses
RMMV
So you want the event to never happen again, but it shows up again if the player keeps holding the key?
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
604
Reaction score
1,421
First Language
English
Primarily Uses
RMMV
I haven't tested this, so I don't know if it works, but this is what I'd try:

I would try having the parallel event first set its switch off, then call a different common event that contains whatever you want to happen after the key press. This way, the first common event should wrap up and switch off before all the "stuff" happens.

If that still isn't working, try making the second event "autorun", and that should prevent further input from triggering the first.
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
So you want the event to never happen again, but it shows up again if the player keeps holding the key?
I want event to run every second time the player hits Enter key. Also the event has player route. So when player holds the button and press arrow keys, it breaks route.
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
I haven't tested this, so I don't know if it works, but this is what I'd try:

I would try having the parallel event first set its switch off, then call a different common event that contains whatever you want to happen after the key press. This way, the first common event should wrap up and switch off before all the "stuff" happens.

If that still isn't working, try making the second event "autorun", and that should prevent further input from triggering the first.
I tried exatly as you said with two events - a parallel event just set its switch off and then start autorun event switch when player hits enter, but still same results - if player holds the button and press arrow keys, it breaks the player route from autorun event.
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
947
Reaction score
2,213
First Language
Not English
Primarily Uses
RMMV
You mentioned move route that's in autorun. But nothing else happens when autorun is running. Is an event happening? Like a cutscene since you're using autorun?

You want the player to run, that can be done with conditional branch as you've said. Since autorun is causing a problem, first let the event finish, set self switch on. Make a new page with page condition set to self switch on. Just let the event finish running. Since I guess you wouldn't want the player to run during an event.
 

JLowther

Veteran
Veteran
Joined
Feb 20, 2016
Messages
327
Reaction score
38
First Language
English
Primarily Uses
You can try the attached plugin from DreamX (since I can't find the original link).

It allows you to disable all player movement input by turning on a switch.
 

Attachments

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
You mentioned move route that's in autorun. But nothing else happens when autorun is running. Is an event happening? Like a cutscene since you're using autorun?

You want the player to run, that can be done with conditional branch as you've said. Since autorun is causing a problem, first let the event finish, set self switch on. Make a new page with page condition set to self switch on. Just let the event finish running. Since I guess you wouldn't want the player to run during an event.
Yes, it's a cut scene with a possibility to stop it. I'm trying to create a custom movement system on world map. Player must use a helicopter to travel. There is a helicopter event in the map (empty event). Before helicopter starts moving, player should choose the destination (at this state, player char image is a pointer). A cut scene starts when player hits Enter. A parallel event stores the player x,y coordinates, teleports player to the helicopter event place, changes player char image to a helicopter, removes image from helicopter event, and starts route to the stored x,y coordinates (I use plugin Smart Path MV by Shaz). Also a pointer event is teleported to the destination place before starting route so you could see the destination on map when helicopter moves to it. When on route, if player hits Enter, the route stops and player could choose another destination (another parallel event does it).

Everything works only if player hits Enter for a short time. Otherwise player starts to act like crazy, if both Enter and an arrow keys are being holded. Please find attached both events, I hope it will be clearer.
 

Attachments

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
You can try the attached plugin from DreamX (since I can't find the original link).

It allows you to disable all player movement input by turning on a switch.
Thanks, but how can I set it?
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
Somehow I managed to make it work with DreamX plugin. Thanks a lot!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top