Walking & Running

Joined
Dec 20, 2018
Messages
45
Reaction score
9
First Language
English
Primarily Uses
RM2k3
Hi there, its me yet again...
Is there a way to make the character walk, and make him run with different sprites while holding SHIFT.
Now if that is possible on another engine, then just tell me its not possible on RM2k3 because i completed my game 30% with much details and custom sprites, and i really do not want to do that again...
So is that possible?
 

Tw0Face

Master Strategist
Veteran
Joined
Nov 12, 2018
Messages
430
Reaction score
370
First Language
German
Primarily Uses
RMVXA
So is that possible?
Yes, it's possible. But I would have to try it myself to find a way to do this. If you want a quick solution: There's a German game called Velsarbor, in which this feature is implemented. You could search for it and open it in RM2K3 to see how it was made.

Greetings,
Tw0Face
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,253
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
there is a check for key press to determine walk speed, so it shouldn't be hard to redirect the call to also modify the character sprite.
I'd advice you to make both sprites into one single file, and only modify the coordinates of the animation, so there's no file load in between.
 

Bridgeman

Veteran
Veteran
Joined
Aug 10, 2014
Messages
121
Reaction score
18
First Language
Dutch
I tried to figure it out for you, but I'm not sure either. However I can get you started:

Make a common event called "Run", set it to parallel process. Do a Key Input processing and allow only the shift key, check wait for completion and store it in any variable that you want. Then do a conditional branch, check if the variable you chose is equal to 7, and if it is change your hero's sprite and his speed (you can do both with a Move Event).

The only thing this doesn't do is return his speed to normal and change his sprite back when you let go of shift. I can't figure out how to check if a button is no longer being held. If you do a conditional branch that checks if your key variable = 0, it won't work if you put it below the Key Input because then you still need to press some sort of key. And if you put it above the Key Input, it will execute it all the time because the variable is always 0 when you're not pressing a key.

Maybe someone else can shed further light on this, I'd like to know too.
 

JosephSeraph

White Mage
Restaff
Joined
Mar 7, 2014
Messages
1,186
Reaction score
1,444
First Language
Portuguese
I can't figure out how to check if a button is no longer being held. If you do a conditional branch that checks if your key variable = 0, it won't work if you put it below the Key Input because then you still need to press some sort of key. And if you put it above the Key Input, it will execute it all the time because the variable is always 0 when you're not pressing a key.

Maybe someone else can shed further light on this, I'd like to know too.
You can use an Else condition. This way, if the variable = shift, you do X, if the variable = 0, you do Y. That means only when you're pressing run will the event trigger.
Rm2k3 doesn't allow you to set a specific movement speed for the hero though, it only allows you to increase or decrease it. Because of that, it'll be useful to add a second conditional branch after the shift key press condition. something like:

>Is the Shift key Pressed?
>>Is The Switch "Running" turned on?
-----no, increase speed by 1 and turn it on.
-----else yes, do nothing.
>If the Shift key is not pressed:
>>Is The Switch "Running" turned on?
-----no, do nothing.
-----else yes, decrease speed by 1 and turn it off.

Additionally, you can further exert control over your player's sprites with something like a sprite manager that's separate from the running thing.
First it checks if the character's running, if it is, then it changes to the running sprite.
Otherwise it checks if the character is idle. After idling for X time (increasing a variable in a loop) you can display an idle sprite on the character.

That, coupled with key press checks, can allow you to have more than 3 frames on your animation, too. "Is the character running? Is the player pressing "left?" then display the animated spritesheet "running left" on the player's coordinates, (and keep refreshing the event every (other) frame to keep the coordinates you're displaying the picture in accurate)
I'd personally just do that for the idle sprite though. If any.

Uh, since I'm going all crazy here, you may as well throw in there a condition that asks which terrain the player is stepping on, and proceeds to play one of several random step sounds everytime a directional key is pressed. RM2k3's default step sounds only allows for a single sound effect.

Anyway yeah that was a lot of options lol sorry if it's overwhelming
 
Joined
Dec 20, 2018
Messages
45
Reaction score
9
First Language
English
Primarily Uses
RM2k3
Yeah, i will try that.
I don't care if my animation is 3 frames or more, i just want it to work :p
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top