SetMoveRoute not working when player is pressing a key

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
OK so I'm trying to make a hiding spot in my game so player can hide from guards. I have an event in front of the hiding spot that checks if the player is pressing say UP and Z :)C button) if he is I execute a Set Move Route that will make the player THROUGH ON and then move him up ONE TIME and then set his TRANPARENCY ON. The thing is that if the persons presses UP and Z and keeps holding UP the set move route won't work and the player will simply not move up breaking the whole thing. I tried set variables on game_player as to lock the input handle when this was executing as a meaning to resolve but If I lock the input the handle the set move route doesn't work either probably because he fakes a input movement with it (just trying to guess). So if anyone can shed some light on this I'd be more then glad...

Oh and here's are the commands for entering:

 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
What if you tried pressing up and the C button simultaneously?


Checking for button pressing in events is rather difficult because events process very quickly and if you just happen to miss that one nanosecond it won't work.
 
Last edited by a moderator:

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
What if you tried pressing up and the C button simultaneously?

Checking for button pressing in events is rather difficult because events process very quickly and if you just happen to miss that one nanosecond it won't work.
He does get both input witouth any problem the thing is that if I keep pressing UP he won't execute the set move route commands correctly. So he won't make him through on and move one step up...
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Just a quick script. Instead of being checked in nanosecond, I inserted time lag

class Game_Interpreter def wait_for_input(count, key) while count > 0 Fiber.yield count -= 1 if Input.trigger?(key) return true end end return false end endUse conditional branch, and then make a script call

wait_for_input(frame, key)- frame >> game frame which is 60 is equal as 1 second. It's used as time lag whether the certain key is being triggered or not

- key >> input key. ( :C ) is same as Z button in keyboard. And ( :UP ) for up arrow

For example :

wait_for_input(60, :C)Hope it helps
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
He does get both input witouth any problem the thing is that if I keep pressing UP he won't execute the set move route commands correctly. So he won't make him through on and move one step up...
That means you're not getting both input correctly.
 

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
That means you're not getting both input correctly.
I remember debugging it and adding p 'hi' at each condition and it was working. Also I can tell that it's getting both inputs since he's making player transparency ON all the time. If I press UP and Z and keep holding UP he'll still make transparency ON but won't execute the move route, but if I press UP and Z and let go quickly of the UP key then it will work as it should.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Why do you have two move routes? Just combine them into one. I don't know if it'll make a difference, but as two move routes, there IS that brief gap where something else could happen in between.


Also, what's the trigger on this event? Can you show the FULL event window, not just the commands? Since it's such an obscure issue, it could be something OTHER than the event commands causing the problem.
 

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
Ok so I got it to work after changing a bunch of things. My main problem was that I had a common event that worked with parallel process and he had a set move route that change the player's alpha so that was kinda messing up this set move route here. Anyhow, thanks to all! Thread can be closed :)
 
Last edited by a moderator:

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,050
Members
137,571
Latest member
grr
Top