Need some quick guidance on eventing.

Status
Not open for further replies.

GraySorrow

Veteran
Veteran
Joined
Feb 18, 2016
Messages
32
Reaction score
5
First Language
English
Primarily Uses
This is my common event for footsteps. It works perfectly except for one issue, when i hold down shift ($gamePlayer.isDashing() ) even if im not moving it will make the Footstep SE. How do i prevent this? even when i add $gamePlayer.isMoving() it doesnt really help either. Im just trying to make it so that when i hold shift no audio comes out until i ACTUALLY start moving.
 

Attachments

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
480
Reaction score
1,468
First Language
Indonesia
Primarily Uses
RMMV
Ughhh, first please don't use else when you are checking same variable... it's not like the variable will change in the middle of event and it hurts both my eyes and feeling.
Do it like this.
1583909939603.png
I already tested. It will only make sounds when you are holding shift while moving.
 

GraySorrow

Veteran
Veteran
Joined
Feb 18, 2016
Messages
32
Reaction score
5
First Language
English
Primarily Uses
Ughhh, first please don't use else when you are checking same variable... it's not like the variable will change in the middle of event and it hurts both my eyes and feeling.
Do it like this.
View attachment 136496
I already tested. It will only make sounds when you are holding shift while moving.
roger captain. And sorry for all the "else" i copy and pasted the check variables so they all ended up with else xD. Thanks for the help good sir.
 

GraySorrow

Veteran
Veteran
Joined
Feb 18, 2016
Messages
32
Reaction score
5
First Language
English
Primarily Uses
Worked like a charm. Thanks Kuro-san. Mod can close the post since its solved <3
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
first please don't use else when you are checking same variable
Actually, in many cases, the variable can, and does change within the loop, so not having the conditions nested can cause issues. Doing separate checks the way you have is also inefficient. If you have 4 conditions and the first one is true, it's still going to check the other 3. Having them nested, if the first one is true, it's going to skip the remaining ones. So it's actually better to have the Else.

OP, to have a thread closed, you need to report your first post and let the mods know it's solved.
 

GraySorrow

Veteran
Veteran
Joined
Feb 18, 2016
Messages
32
Reaction score
5
First Language
English
Primarily Uses
Actually, in many cases, the variable can, and does change within the loop, so not having the conditions nested can cause issues. Doing separate checks the way you have is also inefficient. If you have 4 conditions and the first one is true, it's still going to check the other 3. Having them nested, if the first one is true, it's going to skip the remaining ones. So it's actually better to have the Else.

OP, to have a thread closed, you need to report your first post and let the mods know it's solved.
Oh sorry about that. Not really good with forums. Thank you.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
don't worry about it - we all start somewhere :)
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,381
Reaction score
8,537
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top