Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
I want there to be a sound of splash of water when the player walks across a river. But the sound only plays after the stepping animation has ended, which works for normal steps but is too late in this case. Is it possible to make the sound play as soon as the player starts moving?
The way I've made the current stepping sounds is by using common events that happen in certain map areas. I'm using MV.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
933
Reaction score
492
First Language
English
Primarily Uses
RMMV
We can't guess what your code looks like to suggest how you should change it :wink:

Post screenshots of your common event so we can see how it triggers and what it does.
 

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
I mean it does work, I was just wondering if it's even possible to make the sound start playing earlier than only at the end of the stepping animation. Here's what I have now:
1.png
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
933
Reaction score
492
First Language
English
Primarily Uses
RMMV
...That one screenshot still doesn't show us how you're calling that event. :rolleyes:

If you're just plastering event tiles over your map that call that event, then it can only be triggered once the player moves onto that tile.

The typical way to implement footsteps is to have a parallel event running that, every so many frames, checks the position of the player. You can then adjust the timing of those sounds by changing how many frames you wait.

You can see a few samples of that technique here
and here
 

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
Ah I'm calling the event based on which terrain tag the player is on. Grass is tagged 1, the water is 2. I've only used RPG Maker for a week so these are new things to me.

So this event I saw on that thread seems what I'm looking for I think! So how would I script it to play the sound only when the player moves on a tile that's terrain tagged 2?

1618686192320.png
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
433
Reaction score
189
First Language
PT-BR
Primarily Uses
RM2k3
I haven't tested this command via Script yet, when I did I used only events:
Code:
◆Control Variables:#0019 Steps-Last = Steps
◆If:Steps-Last ≠ Steps-Now
  ◆Play SE:Knock (100, 150, 0)
  ◆
:End
◆Control Variables:#0020 Steps-Now = Steps
That way you don't even have to check the coordinates.
It is also influenced by the frequency, that is, holding the "Shift" key will play more.

If you are going to use sounds for different "Regions" the event is something more complex:
RPGMV-Get_Location_Info.png
(I wanted to use "Terrain Tag", but it doesn't work because of the "top layer", If someone knows how to explain to me how to do this using only the bottom layer it would be of great help.)

Common Event (Parallel Process + Switch) - Check movement:
Code:
◆Control Variables:#0015 StepX-Now = Map X of Player
◆Control Variables:#0016 StepY-Now = Map Y of Player
◆Get Location Info:Loc-Info, Region ID, ({StepX-Now},{StepY-Now})
◆If:StepX-Now ≠ StepX-Last
  ◆Common Event:SFX-Step
  ◆
:End
◆If:StepY-Now ≠ StepY-Last
  ◆Common Event:SFX-Step
  ◆
:End
◆Control Variables:#0017 StepX-Last = Map X of Player
◆Control Variables:#0018 StepY-Last = Map Y of Player

Common Event - SFX-Step:
Code:
◆If:Loc-Info = 0
  ◆Comment:Normal
  ◆Play SE:Floor1 (100, 150, 0)
  ◆
:End
◆If:Loc-Info = 1
  ◆Comment:Wet ground
  ◆Play SE:SplashWater1 (100, 150, 0)
  ◆
:End
◆If:Loc-Info = 2
  ◆Comment:Water channel
  ◆Play SE:SplashWater2 (100, 150, 0)
  ◆
:End
◆If:Loc-Info = 3
  ◆Comment:Grass
  ◆Play SE:Grass1 (100, 150, 0)
  ◆
:End
◆If:Loc-Info = 4
  ◆Comment:Bush
  ◆Play SE:Grass2 (100, 150, 0)
  ◆
:End
 
Last edited:

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
Are terrain tags and Region ID different things...? Like I said I'm new and learning :] Either way I used the numbered tiles from the last tab.

Dev_With_Coffee, got it to work, the sound plays earlier now, thanks so much!!
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,164
Reaction score
14,654
First Language
English
Primarily Uses
RMMV
Are terrain tags and Region ID different things...?

Yes they are. You set up terrain tags on the Tilesets tab in the database. A tile can have any terrain id from 0 (the default) to 7, and wherever you draw with that tile, that is the terrain id.

Region ids can go from 0 (the default) up to 255, and you can draw with any region id anywhere on the map, regardless of the tile.
 

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
Yes they are. You set up terrain tags on the Tilesets tab in the database. A tile can have any terrain id from 0 (the default) to 7, and wherever you draw with that tile, that is the terrain id.

Region ids can go from 0 (the default) up to 255, and you can draw with any region id anywhere on the map, regardless of the tile.
Ah gotcha. It's the Region ID I used to tag my map then. Sorry for the misunderstanding!
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
433
Reaction score
189
First Language
PT-BR
Primarily Uses
RM2k3
It's the Region ID I used to tag my map then. Sorry for the misunderstanding!
There is no reason to apologize, this is a question that even the most experienced ones have, including me who is from the old school.

I would prefer to use "Terrain Tag", but it is something that I still don't understand how to make it work in RpgMV because of the top layer.
 
Last edited:

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
One problem with this though is that it plays the stepping sound also when a cutscene ends if the player has moved from their earlier spot. For some reason that sound is also in full volume although the sounds are set to a lower volume.

It also seems seems to break Quxios's QPathfind plugin, the player doesn't stop where the pathfinder tells anymore. I worked around it by turning off the "check movement" switch right before the pathfinder goes on, and turn it back on afterwards, so it still works I suppose!

Edit: I think it's actually that the sound plays when the "check movement" switch goes on. Just a loud thud. Makes it kinda weird.
 
Last edited:

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
433
Reaction score
189
First Language
PT-BR
Primarily Uses
RM2k3
@Neikoku I don't really do a plugin compatibility test, but I'll try to do that when I get home.
 

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
Actually it's not about the plugin, it's any movement route set for the player, they all break.
And with the solution of turning the switch off and back on again, it causes the single full volume step sound each time it's turned on. :0

Hmm maybe this would be a better way to do it, if I knew how to make it happen when player moves on a tile with Region ID 2:

1618748824146.png
M
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
433
Reaction score
189
First Language
PT-BR
Primarily Uses
RM2k3
But I showed you how to check the region by the coordinates...
Code:
◆Control Variables:#0015 StepX-Now = Map X of Player
◆Control Variables:#0016 StepY-Now = Map Y of Player
◆Get Location Info:Loc-Info, Region ID, ({StepX-Now},{StepY-Now})

if I were going to do it by Script it would be practically the same method:
Code:
If:Script: $gameMap.regionId($gamePlayer.x,$gamePlayer.y) === 0
  ◆Comment:Normal
  ◆Play SE:Floor1 (100, 150, 0)
  ◆
:End

Just a tip, there is no need for 3 "Conditional Branch", only 2 if you reverse the order:
Code:
◆if: $gamePlayer.isMoving()
  ◆if: $gamePlayer.isDashing()
    ◆Wait: 7 frames
    ◆Play SE: Splash (100, 100, 0)
    ◆
  :Else
    ◆Wait: 15 frames
    ◆Play SE: Splash (100, 100, 0)
    ◆
  :End
:End

Regarding the step count, there is already a variable that does this, as I showed in my first example:
post#6
 
Last edited:

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
8
Reaction score
1
First Language
Finnish
Primarily Uses
RMMV
Oh sorry I know very little about scripting or programming, so I was just thinking if there was a different way to see if the player is on a tagged tile, but if there's not, got it!

So I should find a solution to the problems it causes with movement routing or the sound bug, or find a whole different way that doesn't use the coordinate checking... (In my first setup I was using Yanfly's Region Events plugin to get the coordinates of the tagged tiles, but that made the sound play too late for me)
 
Last edited:

Latest Threads

Latest Profile Posts

Ami
This is the End of the Endurance,everyone are celebrating the end of their Endurance

I just wondering what Menu for Tomorrow
Two years into developing my game and I just scrolled through the BaseResource Pack that comes with MV for the first time xD I never knew how much awesome stuff was in there. Also so many names I know from the forum, like Shaz & Archeia ... and that's not the only resource pack I found in the depth of my hard drive :0 Right now I'm both confused and hyped about all the stuff I own.
Decided to start watching Naruto; and not only is it a genuinely good series, but it's also very inspiring.
I just wish Funimation got its act together and fix the missing dubbed episodes.
Decided to work on my game a little bit, made this Motel looking building. I am still on temporary hiatus though as getting Therapy is more difficult than I thought.

Forum statistics

Threads
111,288
Messages
1,059,964
Members
144,601
Latest member
Drackro023
Top