Hello all!
I recently re-discovered the magical program known as OHRRPGCE, and have been working on a game. Its fairly simple, and I'm beginning to dabble in plotscripting.
I was wondering If there was a way to trigger a sound effect to play in conjunction to using a door. say, if I wanted to have a vortex sound for a portal, or add the footsteps sound effect when the player steps on a stairway. Or perhaps even link the sound effect to a map coordinate.
If there is a way to do this (via plotscripting, or otherwise) I'd appreciate any help on the subject.
Your best bet would be to assign zones to your doors and use an each-step script to identify when you're standing in that zone (will probably make more sense to put the zone on your exit door since that will be the next step when the script is triggered), and assign a sound effect via scripting if the "read zone" condition is met.
Place Obligatory Signature Here
Place Obligatory Signature Here
That's pretty much exactly what I did. The zones that is. Specifically, I used four zones, one for just above the door, one for the top half of the door, one for the bottom half of the door, and one for just below the door. That way, I can track if the player is opening the door from the front (going north) or from behind (going south). I also tied a script to it that opened and closed the door (write map tile) in addition to the open and close sound effect.
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Welcome!
Actually, I believe that using a zone on the same tile as the door and an each-step script won't work, while using a step-on NPC linked to a script will work. The reason is that when the player completes a step, the engine first checks whether there's an NPC there to be triggered, then whether there's a door (and if so immediately loads the next map). The each-step script runs later (and only sees the new map).
However, if the destination map happens to also have the zone on the door tile then the each-step script (from the previous map) can see it and play a sound effect.
Actually, I believe that using a zone on the same tile as the door and an each-step script won't work, while using a step-on NPC linked to a script will work. The reason is that when the player completes a step, the engine first checks whether there's an NPC there to be triggered, then whether there's a door (and if so immediately loads the next map). The each-step script runs later (and only sees the new map).
However, if the destination map happens to also have the zone on the door tile then the each-step script (from the previous map) can see it and play a sound effect.
I second Nathan's way of doing this. I personally have used the step-on NPC with sound clip all over Triangle's Adventure and it works great.
Check out Red Triangle Games!
Check out Red Triangle Games!
RedMaverickZero wrote:
I second Nathan's way of doing this. I personally have used the step-on NPC with sound clip all over Triangle's Adventure and it works great.
I would recomend the same thing, I used the same principle to turn a layer on and off to remove the roof and show the interiors of a house in Reign of Grelok.
"I can't buy food with glory"
Wow, thank you all for your speedy, insightful, and friendly replies! My scripting skills regarding zones are a bit lacking, so I had trouble with that method.
I had tried using a step on NPC with an invisible text box to play a sound before I started attempting to use scripting and it worked aside from the fact that you had to press space to make progress from the invisible text box :P
I'm attempting to link the play sound script to a step on NPC now...
...
SUCCESS! Thank you all very much for your help. I may return periodically with further questions depending on how ambitious I get with this game, haha. Thanks again!
I had tried using a step on NPC with an invisible text box to play a sound before I started attempting to use scripting and it worked aside from the fact that you had to press space to make progress from the invisible text box :P
I'm attempting to link the play sound script to a step on NPC now...
...
SUCCESS! Thank you all very much for your help. I may return periodically with further questions depending on how ambitious I get with this game, haha. Thanks again!



