Calling Anyone Who Has Experience with Using Sounds
LadySnowflake
26 Aug 2016, 06:43I asked about this, along with some other questions, on another thread, but I'm now starting a new one specifically for my sound-related questions, since I am still having difficulty.
First, I have a door that opens to reveal an exit, then closes to hide that exit. I want a sound to play when the door is opened, and another sound to play when it is closed. As of right now, the sound plays when the door is opened, just like I want it to, but I get nothing when it's closed.
Here is what my code looks like. Maybe I have things in the wrong order, or something is missing?
HelperOpenObject (metal door)
play sound ("open_metal_fence_gate.mp3", false, false)
MakeExitVisible (Exit to Warehouse)
play sound ("close_metal_fence_gate.mp3", false, false)
MakeExitInvisible (Exit to Warehouse)
HelperCloseObject (metal door)
Second, I want to do the same thing as above, but on the opposite side of the exit. In other words, I have a door object in the next room that I also want to open and close and play sounds, because I want to give the player the impression that they are now dealing with the same door, just on the other side of it, in the next room. I'm not sure that is a very clear explanation, so please ask if you're not following.
Anyway, that doesn't work at all. The door does nothing whatsoever, and I don't know why, because I set it up exactly the same way as the first openable/closable door object.
Third, one of the locations in my game is a nightclub, so I want music to play when the player is in that room. I wasn't quite sure on how to set this up, so I took a guess, and it didn't work. I chose to run a script for the room description, added an "if" command, selected "player is in room" for the expression, chose "play a sound" and uploaded my .mp3 file, then printed a message to describe the room. Clearly that wasn't the way to do it, but hey, I tried.
Any help with any of these three issues would be very much appreciated, and I thank you in advance.
The Pixie
26 Aug 2016, 07:12I have no experience of sound but...
The code looks good. What happens if you swap around the names of the mp3 files? If this is a problem with the files or their names, the sound will then play for closing the door, but not opening. If it is an issue with code, it will stay the same.
For the second, what is the name of the door in the other room? Did you use that name in the HelperOpenObject
? What is the name of the exit out of the warehouse? Did you use that in the MakeExitVisible
function?
LadySnowflake
26 Aug 2016, 08:26I switched the file names around, and the closing sound played when I opened the door, but the opening sound did not play when I closed it.
I double checked everything on the second (opposite side of) the door, and everything is the same as the first except that the first door is called "metal door" and the second is called "metal door1." The exit is called "exit to alleyway," and yes, that is the name in the "make exit visible" function.
I'm completely stumped. I know I'm new at this, but when I look at what I have it looks like it should make sense.
Pertex
26 Aug 2016, 10:43could you upload your mp3s anywhere? There could be differences in the encoding settings
Jay Nabonne
26 Aug 2016, 11:09Might be a silly question: For the closing case, are you sure any of the closing code is kicking in? It might be worth dropping an "msg" in there and make sure that piece of script is executing at all. (Also, just to be totally clear, can you confirm that the two blocks of script above are actually called in two different places? I've seen weirder things.)
XanMag
27 Aug 2016, 02:57Second, I want to do the same thing as above, but on the opposite side of the exit. In other words, I have a door object in the next room that I also want to open and close and play sounds, because I want to give the player the impression that they are now dealing with the same door, just on the other side of it, in the next room. I'm not sure that is a very clear explanation, so please ask if you're not following.
Anyway, that doesn't work at all. The door does nothing whatsoever, and I don't know why, because I set it up exactly the same way as the first openable/closable door object.
I created another door object in the adjoining room and it has the name door1. On the 'when opening door' script, I opened both door and door1. I also played the creaking door sound and unlocked both exits from the room and back to the room. I did the opposite of these scripts under the 'when closing door' script. Everything worked fine on this end. The sounds played, and exits were unlocked. If you need me to take a look, see me at Discord.
Third, one of the locations in my game is a nightclub, so I want music to play when the player is in that room. I wasn't quite sure on how to set this up, so I took a guess, and it didn't work.
Go to the scripts tab for the nightclub room. Add the sound you want to play under the 'after entering room' section. In the 'after leaving room' section add a 'stop sound' script.
XanMag
27 Aug 2016, 03:04Here is the link to the sample game I created with the scenarios you were asking about. http://textadventures.co.uk/games/view/xfvjqa4dwu2r-da_8ljoxa/sample-game
Not sure it will be of much help but I am looking for a way to share online files. Hopefully it is possible so you can look at the GUI side of things.