Post new topic    
Liquid Metal Slime
Send private message
How do I code a hero to face certain direction on keypress.. 
 PostFri Dec 19, 2014 3:25 pm
Send private message Reply with quote
By default if my hero in the game is facing right and I click the left arrow she will move one tile left.

Is there a way I can override this so that when I am facing right and click left the hero will first face left, then commence with walk?

An example of this is in Pokemon Red/Blue when you tap a direction you're not facing then the hero will face that direction rather than taking a step.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Slime Knight
Send private message
 
 PostFri Dec 19, 2014 3:49 pm
Send private message Reply with quote
I'm not sure if it is useful outside of player suspended cut scenes, but there appears to be a Set Hero Direction command.

Maybe you could link a Set hero Direction(me, left) command to a keypress on Key:left followed by a 1 or 2 tick wait command?

Perhaps you could do something with an if-then, or while-do script. So that if the Hero Direction (me, left) is true, it disregards the wait, and continues normal player control. I don't know if this way would require suspending the player or not.

Keep in mind, I'm just taking shots in the dark here, I haven't done anything like this, nor do I know if this would work, or if there are more simple ways to achieve it. I just like trying to figure thing out. Hurr
Slime Knight
Send private message
 
 PostFri Dec 19, 2014 3:51 pm
Send private message Reply with quote
Here's an artivle from moogle1's plotscripting tutorials that is just what you need.

http://moogle1.castleparadox.com/keyispressed.php
"I can't buy food with glory"
Liquid Metal Slime
Send private message
 
 PostFri Dec 19, 2014 4:20 pm
Send private message Reply with quote
Thanks, I didn't know about that resource. It looks like there's a lot of useful stuff there.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Display posts from previous: