How to track the direction the player is facing

Sednaiur

Veteran
Veteran
Joined
Jul 7, 2018
Messages
33
Reaction score
9
First Language
German
Primarily Uses
RMMV
Hello. I search for a way to track in which direction the player is facing when triggering an event.

In my case, I have an event resprited as a tree that activates on action button press and I like it to let the player perform a moveset from another player graphics sheet to let it look like he is chopping down the tree. Well, just making a *poof*-effect or something like that does not cut it for me. :p

How could I accomplish this? If this needs a plugin to be performed, I have access to the whole YanFly library if that helps. And if not, I would be willing to get the plugin needed for such action.

I am grateful for any offered help. :)
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
3,390
Reaction score
1,267
First Language
Dutch
Primarily Uses
RMMV
if you want to make that action, create a conditional branch.

if player facing left
do stuff
end
if player facing right
do stuff
end
if player facing up
do stuf
end
if player facing down
do stuff
end

while this is the basic stuff, but its also good for signs, when facing down
you cannot read the sight, if its facing right or left, you cannot either,
but only when you in the front (facing up).

same idea goes for those, but it's doable :)
 

Sednaiur

Veteran
Veteran
Joined
Jul 7, 2018
Messages
33
Reaction score
9
First Language
German
Primarily Uses
RMMV
Yes, something like this is what I have in mind but where do I find those actions? I checked all 3 action pages for events and there is no such thing like if player facing left etc.

Edit: xD Yes - here I go again. Please nevermind my brain flatulence as I just found it. Thanks a lot anyways. You made me realize where those conditions are.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,140
Reaction score
8,005
First Language
German
Primarily Uses
RMMV
@Sednaiur just one additional tip, because if you haven't seen the conditional branch options, then most likely you haven't seen the full power of control variable either.

open the control variable command in any event, switch to "game data" in the lower section, the one that defaults to Map ID.
But instead of accepting map id, click on the three dots at the right end of that "Map ID" line.

in a lot of cases those two commands are used together, with the control variable command for loading game data and then conditional branch to check what the game data in the variable is.
 

Sednaiur

Veteran
Veteran
Joined
Jul 7, 2018
Messages
33
Reaction score
9
First Language
German
Primarily Uses
RMMV
@Andar Thank you for the tip. I took a closer look onto what you said and yes, I can imagine the possibilities. I have not yet gotten to the point where I needed something like that but when I need it I will remember about it.
But how I could miss those "player facing XXX" options is really beyond me. I am trying to emulate the mechanics and behaviour of an SNES-game and so far I have to say it works a whole lot better than I would've expected. Just those simple options that I missed. xD

Also, I don't know if it is against the rules to ask this in the same thread, but I like to know if there is a way to offset the graphics for a player somehow. I need to shift the graphics down by 48 pixels just during the animation I can accomplish using the above eventing, or the downwards facing graphic will look off on my animation. Is that possible?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,140
Reaction score
8,005
First Language
German
Primarily Uses
RMMV
the sprites are always bottom-centered on the event frame if they are larger than 48x48 pixel.
that means you can only trick and shift into the three other directions, but not below.
for that you'll have to use another event one position below of the current position.
 

Sednaiur

Veteran
Veteran
Joined
Jul 7, 2018
Messages
33
Reaction score
9
First Language
German
Primarily Uses
RMMV
Yes, I guessed so. I could use the tree-event that is supposed to be chopped down to display the missing 48 frames. I guess I'll go by that.

Thanks for the help and suggestions. My questions have been answered and solved.
 

Latest Threads

Latest Posts

Latest Profile Posts

I wrote RPGMakerMZ JavaScript reference in Japanese.
But I think you'll be able to read it through the translator.

back in April of 2019, I watched my friend's art stream on twitch. that was when I got inspired to draw most of the assets for my game. it's been a LONG journey since, but totally worth it.
RPG MZ multiplayer in development
Square-Enix, why you didn't released the classic Dragon Quests on Steam yet? :kaocry:
This is by far my most favorite boss monster I've made, its name is Gosck

Forum statistics

Threads
109,139
Messages
1,042,480
Members
141,646
Latest member
Twigsmcsquids
Top