RMMV Question About Maintaining Direction If Only Using Side-View For Walking Sprites

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
20
Reaction score
23
First Language
English
Primarily Uses
RMMV
Hi there. So I am wanting to create sprites that only show their side views when walking (even though you can still walk up/down). While this is simple to do (just pasting side view for the typical walking up/walking down portions of the sprite), I encounter an issue when walking up and down in game. The character does not maintain the same direction when moving up or down.

side view walking example.png

For example, you can see in this image that the character only faces to the side, though I still want him to move upwards/downwards in game. When I make him walk upwards, he will always be facing to the left because the character in the sprite sheet here is facing to the left for the upwards walking animation. When he walks downwards, he will always face to the right.

I am looking for a way to make it to where, if I am walking to the right, then need to move upwards, he will still be facing right while moving upwards, and the same thing for facing to the left when moving downwards.

I greatly appreciate any advice anyone can give me regarding this issue. Thank you very much for your time!
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
794
Reaction score
637
First Language
English
Primarily Uses
RMMV
The easiest way is that you make the character's sheet all point right, then have the character's sprite's horizontal scale flip from +1 to -1 whenever they move left, and from -1 to +1 whenever they move right.

Would require a little work to implement in an event but probably not too excessive?

You'll want to dive into actual changing of the game script if you want something that doesn't require events on every page. (I have this behavior working for events as part of cross engine, but it's too snarled up with moghunter's code and unrelated features for me to give you a standalone version of it).
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,490
Reaction score
14,818
First Language
English
Primarily Uses
RMMV

Moving to Plugin Requests



You will need a plugin for this ...

Pop the following into a new file and give it whatever name you want, with a .js extension, and save into your plugins folder.

Code:
Game_Player.prototype.setDirection = function (dir) {
    if (dir == 4 || dir == 6) {
        Game_Character.prototype.setDirection.call(this, dir);
    }
};

If you only want it on sometimes, select a switch to turn on when you want the left/right-only movement, then turn the switch on and off as needed. Replace 15 below with the switch id you want to use, without leading zeros.

Code:
Game_Player.prototype.setDirection = function (dir) {
    if (!$gameSwitches.value(15) || dir == 4 || dir == 6) {
        Game_Character.prototype.setDirection.call(this, dir);
    }
};

If I wasn't being lazy, I'd put that into a plugin parameter for you. But I'm still unpacking, so that's my excuse.


Hmmm ... do you have multiple party members? If you do, and you have followers visible on the map, you'll also need to do the same for Game_Follower. Or just turn followers off for the time you need this to happen.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
794
Reaction score
637
First Language
English
Primarily Uses
RMMV
[mod]Moving to Plugin Requests[/mod]

You will need a plugin for this ...

Pop the following into a new file and give it whatever name you want, with a .js extension, and save into your plugins folder.

Code:
Game_Player.prototype.setDirection = function (dir) {
    if (dir == 4 || dir == 6) {
        Game_Character.prototype.setDirection.call(this, dir);
    }
};

If you only want it on sometimes, select a switch to turn on when you want the left/right-only movement, then turn the switch on and off as needed. Replace 15 below with the switch id you want to use, without leading zeros.

Code:
Game_Player.prototype.setDirection = function (dir) {
    if (!$gameSwitches.value(15) || dir == 4 || dir == 6) {
        Game_Character.prototype.setDirection.call(this, dir);
    }
};

If I wasn't being lazy, I'd put that into a plugin parameter for you. But I'm still unpacking, so that's my excuse.


Hmmm ... do you have multiple party members? If you do, and you have followers visible on the map, you'll also need to do the same for Game_Follower. Or just turn followers off for the time you need this to happen.
The one issue for this is with trying to trigger events above you or below you, since your interactions are going to be locked immediately left/right. Depending on what's wanted and how mapping works that might not be a problem
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,490
Reaction score
14,818
First Language
English
Primarily Uses
RMMV
Interesting ... hadn't thought of that.
 

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
20
Reaction score
23
First Language
English
Primarily Uses
RMMV
Wow... thank you all so much for your quick replies. Both of those ideas sound very promising, I will definitely look into to trying them out. I have not really used plugins before, but it doesn't sound too difficult from your description, so I will try it. Thank you all!
 

VanillaBrocker

Veteran
Veteran
Joined
Jul 25, 2015
Messages
69
Reaction score
84
First Language
Portuguese
Primarily Uses
Yo @Grassfur ! As mentioned in the PM, I've commissioned a plugin from the amazing @dsiver144 for this feature. I've been wanting it for a long time and your request was the spark that I needed before asking someone for that. :guffaw:

dsiver said that I can post the plugin. Feel free to share it as well!
 

Attachments

  • DSI-HorizontalCharacterSprite.js
    4.1 KB · Views: 13

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
20
Reaction score
23
First Language
English
Primarily Uses
RMMV
Yo @Grassfur ! As mentioned in the PM, I've commissioned a plugin from the amazing @dsiver144 for this feature. I've been wanting it for a long time and your request was the spark that I needed before asking someone for that. :guffaw:

dsiver said that I can post the plugin. Feel free to share it as well!
Thank you yet again! I really appreciate this, and that you decided to share it with the community!

Update: I just tried it out, and it works perfectly, no issues with events or anything else that I've noticed so far. It is also very neat, you can just use any regular RPG maker walk sprite sheet and they show side view only as well. You are a saint. Thank you again very much!
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Phew! logged back. Seems I was too occupied with 3D learning (yeah for RPGM purposes) creating IRL space, trying to grow catnip, dealing with health and DC is good. (so MrC) ^^
Currently trying to add items in the same style as Kyrise's excellent icons. I like having a large variety of items :3 KyriseandMe.PNG
Create MiniMaps, Sprites for MV Enemies, & Aethereal Plane Battlebacks | RPG Maker News #74

Vtubers Vs MOTHER.png

This might be my next project. You like it?
I'm off to search the master script list for my skill issue. HOORAY! FUN!

Forum statistics

Threads
112,328
Messages
1,067,420
Members
145,967
Latest member
zakariadu78
Top