Running in 2k3

LightDiviner

That Guy With Lots of Ideas
Veteran
Joined
Jul 2, 2017
Messages
197
Reaction score
68
First Language
English
Primarily Uses
RM2k3
I was wondering if there is a way to do that, like in a common event that changes your speed when you press a button, and decreases it when it isn't pressed.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Yes, there is.
Key input processing ->shift assigned to a variable.

Then if that variable is equal to 7:
If switch (for example 50) is Off:
Turn switch 50 on.
Set move route: Player
Increase move speed
Increase move speed

If that variable is not equal to 7
If switch 50 is On:
Turn switch 50 off
Set move route: Player
Decrease move speed
Decrease move speed

You're welcome.
 

LightDiviner

That Guy With Lots of Ideas
Veteran
Joined
Jul 2, 2017
Messages
197
Reaction score
68
First Language
English
Primarily Uses
RM2k3
Yes, there is.
Key input processing ->shift assigned to a variable.

Then if that variable is equal to 7:
If switch (for example 50) is Off:
Turn switch 50 on.
Set move route: Player
Increase move speed
Increase move speed

If that variable is not equal to 7
If switch 50 is On:
Turn switch 50 off
Set move route: Player
Decrease move speed
Decrease move speed

You're welcome.
OK hold up a sec. I'm still new to this. XD This is what I have so far. What would I do next?running.PNG
 

CleanWater

Independent Developer
Veteran
Joined
Apr 8, 2017
Messages
637
Reaction score
739
First Language
PT-BR
Primarily Uses
Other
Now you need to set the Common Event to Parallel Process in the Condition Switch.

After this you just do exactly what @Poryg said earlier with the events.
 

Tricimir

Veteran
Veteran
Joined
Jul 17, 2017
Messages
50
Reaction score
14
First Language
English
Primarily Uses
RMMV
If I can, I'd like to suggest a more reliable run button set up.
The one Porgy suggested WILL work but it's got two major flaws

A:
run buttons in rm2k3 tend to cause the player to ignore any events that activate on contact.
The is because only one event at a time can effect the player to avoid breaking the game by making you do something impossible.

B: Related to the above, but reversed, run buttons in rm2k3 are inconsistent and can fail if you walk over an event or something else interrupts you. At worst the run button might only half fail and you'll end up with a hero that moves way to slow or way to fast and you'll have no way to fix it.

This is a little more advanced but I'll try my best to walk you through it.

To start off, Make an event set to Parallel Process
Add a key input process for the Shift button, just like Porgy described and have it set to a variable. (Again, we'll say variable 50 for this example. We'll call this variable "RUN")
Make sure the "wait until key is pressed" option for the key input is NOT checked.
Add a "wait" command for 0.0 seconds.
(This is an old lag busting trick that reminds the program to breath. If you ever have a laggy, complex event, sprinkle in a few "wait 0.0" commands and watch the lag disappear.)

So your page should look like this:

>Key Input Process
>Wait 0.0

Good.
Set a conditional branch and have it check if a new variable (We'll call it variable 51, or "RUN CHECKER")
is equal "=" to "RUN"
Check the box to create an else statement.

What we're doing is setting up a memory so the event only changes something when you first press or release the button instead of repeating the command over and over for as long as the run button is held.

In the ELSE branch, Use a control variable command to set "RUN CHECKER" to EQUAL "RUN"

Directly under the variable command, make a new conditional branch (With the else branch checked)
Set it to Check if "RUN CHECKER" is EQUAL to 7.
Add a Move Route command aimed at the player and set it to
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Increase move speed
Increase move speed
Increase move speed
Increase move speed

That's 5 decreases and 4 increases. What this is doing is setting the player's speed all the way to the bottom before increasing it back to the speed you want it at. It's much less likely to fail and if it does, it'll fix itself the next time you press the button instead of getting stuck that way.

In the Second conditional branches ELSE branch
Use a Move Route command aimed at the player.
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Increase move speed
Increase move speed
Increase move speed


That's 5 decreases and 3 increases. This will put you back to the default speed when you release the button.


And you're done.

This version has the built in speed failsafe
And it's only active when you first press or release the button, so it won't interfere with other events. (Spamming the run button rapidly may still cause issues.)
As a result, it's also much less laggy.
Even if you prefer to stick with the simpler design up above, I suggest you at least add the speed failsafe to it, because there's really no reason not to.
 
Last edited:

LightDiviner

That Guy With Lots of Ideas
Veteran
Joined
Jul 2, 2017
Messages
197
Reaction score
68
First Language
English
Primarily Uses
RM2k3
If I can, I'd like to suggest a more reliable run button set up.
The one Porgy suggested WILL work but it's got two major flaws

A:
run buttons in rm2k3 tend to cause the player to ignore any events that activate on contact.
The is because only one event at a time can effect the player to avoid breaking the game by making you do something impossible.

B: Related to the above, but reversed, run buttons in rm2k3 are inconsistent and can fail if you walk over an event or something else interrupts you. At worst the run button might only half fail and you'll end up with a hero that moves way to slow or way to fast and you'll have no way to fix it.

This is a little more advanced but I'll try my best to walk you through it.

To start off, Make an event set to Parallel Process
Add a key input process for the Shift button, just like Porgy described and have it set to a variable. (Again, we'll say variable 50 for this example. We'll call this variable "RUN")
Make sure the "wait until key is pressed" option for the key input is NOT checked.
Add a "wait" command for 0.0 seconds.
(This is an old lag busting trick that reminds the program to breath. If you ever have a laggy, complex event, sprinkle in a few "wait 0.0" commands and watch the lag disappear.)

So your page should look like this:

>Key Input Process
>Wait 0.0

Good.
Set a conditional branch and have it check if a new variable (We'll call it variable 51, or "RUN CHECKER")
is equal "=" to "RUN"
Check the box to create an else statement.

What we're doing is setting up a memory so the event only changes something when you first press or release the button instead of repeating the command over and over for as long as the run button is held.

In the ELSE branch, Use a control variable command to set "RUN CHECKER" to EQUAL "RUN"

Directly under the variable command, make a new conditional branch (With the else branch checked)
Set it to Check if "RUN CHECKER" is EQUAL to 7.
Add a Move Route command aimed at the player and set it to
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Increase move speed
Increase move speed
Increase move speed
Increase move speed

That's 5 decreases and 4 increases. What this is doing is setting the player's speed all the way to the bottom before increasing it back to the speed you want it at. It's much less likely to fail and if it does, it'll fix itself the next time you press the button instead of getting stuck that way.

In the Second conditional branches ELSE branch
Use a Move Route command aimed at the player.
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Decrease move speed
Increase move speed
Increase move speed
Increase move speed


That's 5 decreases and 3 increases. This will put you back to the default speed when you release the button.


And you're done.

This version has the built in speed failsafe
And it's only active when you first press or release the button, so it won't interfere with other events. (Spamming the run button rapidly may still cause issues.)
As a result, it's also much less laggy.
Even if you prefer to stick with the simpler design up above, I suggest you at least add the speed failsafe to it, because there's really no reason not to.
I feel like a coder. XD
 

Tricimir

Veteran
Veteran
Joined
Jul 17, 2017
Messages
50
Reaction score
14
First Language
English
Primarily Uses
RMMV
That means you're doing it right. :wink:
 

LightDiviner

That Guy With Lots of Ideas
Veteran
Joined
Jul 2, 2017
Messages
197
Reaction score
68
First Language
English
Primarily Uses
RM2k3
running.PNG
So like this?
 

Tricimir

Veteran
Veteran
Joined
Jul 17, 2017
Messages
50
Reaction score
14
First Language
English
Primarily Uses
RMMV
Perfect. That should do it for you.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top