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

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
27
Reaction score
50
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
848
Reaction score
707
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
43,385
Reaction score
15,195
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
848
Reaction score
707
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
43,385
Reaction score
15,195
First Language
English
Primarily Uses
RMMV
Interesting ... hadn't thought of that.
 

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
27
Reaction score
50
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: 23

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
27
Reaction score
50
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:

_C_Thun_

Warper
Member
Joined
Jun 25, 2021
Messages
4
Reaction score
0
First Language
Hungarian
Primarily Uses
RMMV
@VanillaBrocker
Your plugin is like holy water :LZSblush:
Would you mind if I would use it in a project that will eventually (hopefully) will be marketed?
 

Latest Threads

Latest Posts

Latest Profile Posts

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,291
Messages
1,088,682
Members
149,923
Latest member
R1ck_Str1k3r
Top