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
24
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
832
Reaction score
671
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,869
Reaction score
14,989
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
832
Reaction score
671
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,869
Reaction score
14,989
First Language
English
Primarily Uses
RMMV
Interesting ... hadn't thought of that.
 

Grassfur

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

Grassfur

Joyful Creature
Member
Joined
Mar 29, 2018
Messages
20
Reaction score
24
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
3
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

Turning a specific vibe into reality is incredibly difficult. For instance, this song is one of the ones I listen to when working on my post apocalyptic project, and getting it's "feeling" into the game has been a real challenge.

I don't just wanna regurgitate the numbers I see, I wanna actually understand the calculations I'm making so I'm probably gonna make a post later with some calculations and what I THINK they mean to get some advice and corrections.

Edit: All (Most) of these will be tested in game prior. I just wanna make sure I understand what's going on under the hood if you will.
my girlfriend calls all my little chibi art cute lol... funny considering that wasn't the original art style of the game.
100 problems in RMMZ 100 more problems take one down pass it around 101 Problems in RMMZ
Made some progress on my game, mostly mapping. Learned quite a bit in the process!.

M6eUoTT.png

Forum statistics

Threads
113,776
Messages
1,077,352
Members
147,806
Latest member
DalzielEnda
Top