RPG Maker Forums

So I ran into a problem not too long ago, and I've looked around on the web but didn't see any solution to my problem (I think).

I made a map recently with a waterfall, and I'd like to have the waterfall play a waterfall sound, but I only want it to be hearable when you're close to the waterfall. For that I am using this volume distance script:
# Version 1.01# Date : Nov 15, 2013
#------------------------------------------------------------------------------
# Parameters:
# eventID : ID of the event that produces the SE
# md : maximum distance up to which you can hear the SE
# mv : maximum volume of the SE
# return : actual volume depending on the actual distance
#
# Example:
# RPG::SE.new("Cat", volume(@event_id,20,50), 100).play
#------------------------------------------------------------------------------

def volume(eventID, md, mv)

x1 = $game_player.x

y1 = $game_player.y

x2 = $game_map.events[eventID].x

y2 = $game_map.events[eventID].y

d = Math.sqrt((x2-x1)**2 + (y2-y1)**2).round

v = mv-(mv*d/md).round

if v < 0 then

v = 0

end

return(v)

end

I've tried this script before on another map to play a hammer sound when you get close to the forge, and I already found that when you put the event to a parallel process (because to my knowledge the sound doesn't run otherwise) the sound starts infinitely looping over itself which creates a terrible sound and a certain amount of lag. I fixed that issue by simply putting a wait command after the script line to only play the sound every 2 seconds or so, but now that I'm trying it here again that doesn't seem to be a solution.

The SE I use for the Waterfall is quite lengthy (63 seconds) but it is a nice loop and I'd like to stick with it. Now, when I try to run the script through an event, it again starts to infinitely loop over itself, which I do not want. But when I try to add a wait command the command needs to be long enough to stop the sound from looping until it is finished (so 63 seconds), but I found that the sound somehow doesn't play anymore after a wait time of 600 frames/10 seconds.

What I'd basically like to know is if it is possible to run the event when the player enters the map, only play the SE once, wait until the SE is finished and only then start to play it again whilst still using the script so the sound is only hearable in some parts of the map?

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top