How to create a 2,5d movement system

Baigga

Villager
Member
Joined
Aug 21, 2019
Messages
6
Reaction score
0
First Language
French
Primarily Uses
RMMV
Hello, I am pretty new to rpg maker so maybe what I'll ask is impossible to do, or even maybe it's really simple and can be done with eventing (but in this case I need some indications because I have absolutely no idea of how to do it). What I want is a kind of 2,5d movement system with only 2 ways sprites movement system. I mean that I want my character to move left, right, down and up, but when he moves down and up, his sprite is the left/right sprite, according to the direction he's facing. If that's not clear, here is a game (named : "Crawl") that uses exactly this movement system :



And if I am not wrong, with this kind of system, we can use 2d platformer sprite that have only two directions.
If someone can help me in any way, it would be super kind because I am kind of stuck for now.

Ps : Sorry for my grammar and all the mistakes I probably did, english isn't my mother's tongue so it's sometime kind of hard to explain such "technicals" things.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,546
Reaction score
5,005
First Language
English
Primarily Uses
RMVXA
So first of all, you won't be able to totally simulate "depth" because your characters will be the same size as they move "toward" (down) and "away from" (up) the camera, and they won't have any slight left/right movement onscreen (necessary to fully simulate depth-of-field) as the player holds up/down, either. You COULD do some fancy coding to get that in there (see this thread), but it would take a lot of work.

For a simpler implementation where all you're changing is which way the characters are facing (which I think would get the point across OK), I think what you'd want to do is modify this method in rpg_objects.js:

Code:
Game_CharacterBase.prototype.setDirection = function(d) {
    if (!this.isDirectionFixed() && d) {
        this._direction = d;
    }
    this.resetStopCount();
};
I might do it something like this:
Code:
Game_CharacterBase.prototype.setDirection = function(d) {
    if ((d === 4) or (d === 6)) {
        if (!this.isDirectionFixed() && d) {
            this._direction = d;
        }
    }
    this.resetStopCount();
};
Not sure whether that will cover all cases (like forced movement by events), but the idea is that it only allows a character/event's direction to be set to Left or Right at any given time, while allowing them to move in any direction.
 

Baigga

Villager
Member
Joined
Aug 21, 2019
Messages
6
Reaction score
0
First Language
French
Primarily Uses
RMMV
Hey Wavelength, thanks for your help ! Unfortunately, I did exactly what you said and I have the following error message when I try to launch the game :
"ReferenceError
Game_Temp is not defined"

I guess it's because of the code I modified right ?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,111
First Language
English
Primarily Uses
RMMV
Please show the screenshot of the console with the full error message.

The console will probably show an error message that there's a syntax error in the script that you modified. When there's a syntax error, it stops trying to load the rest of the script. Therefore, something which might have been defined doesn't get loaded, and so it isn't defined.

it's probably the "or" which should be "||" in javascript
 

Baigga

Villager
Member
Joined
Aug 21, 2019
Messages
6
Reaction score
0
First Language
French
Primarily Uses
RMMV
You were right Aloe. That work perfectly now, thanks you both for your great help that's really helpful and cool ! I have another question if you don't mind (that is linked to this first one), do you know if it is possible to make the same system but the player face the direction of the mouse cursor ? I mean if the mouse is left to the character, the sprite is the left one and the contrary if it's right.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Dama wrote on akoniti's profile.
Hi
Thanks for your review.
I was checking the trailer for details and as the woman shut the door at the exact moment the song I was hearing said "you slim the door" and I couldn't resist to add it there. :D And I used this idea one more time on another scene.
Just doing some tileset tinkering again...
rux
Someone please help me make my game.
I need someone to volunteer, I am on my knees man.
I made my own pizza. First critique, more chicken next time.

Forum statistics

Threads
104,690
Messages
1,008,143
Members
136,182
Latest member
kingmart420
Top