The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I script this sound so it plays correctly?
genmills Offline
Junior Member

Posts: 47
Threads: 7
Joined: Mar 2011
Reputation: 0
#1
How can I script this sound so it plays correctly?

Hi guys,
if you have seen the other problems I have been talking about on the forum, then you know that I have been making a large, outdoor map which entails so much, and brings up a lot of things you might not have to script in other maps.

Here is today's problem:

I play ambient nighttime outside sounds (at the player so they always hear it) and I loop it. I put the function under OnEnter() because I always wanted to hear it when I went in and out of the different buildings (which are different levels).

Today I made the first map for one of the buildings and was testing things, when I realized, that each time I exited the building (and thus, "entered" the outdoor map) my ambient night sounds would start playing again on top of itself from the exact point it left off. The more you visit a building, the more times the sound plays on top of itself and it gets louder and sounds weird.

I know, right now you're thinking, "just put the sound under OnStart()!" but here's the thing--I have a cave the player can fall into (still part of the outdoor map technically), and I made a function so that the ambient noise fades out, and the cave is silent when you go in deeper. However, later the player will find their way back to the outdoor map (after going through several other maps), and I will want the ambient noise to resume.

Hopefully, you see my problem. Playing the sound in OnStart() works great, but only until I have to go into the cave and come back to that map later. Sorry if this was way too lengthy. Tongue

Also, I'm really good at searching for these types of things I don't know, but I keep running into weird scripting things I can't find any info on, and I feel like starting new threads is clogging up the boards. Think I should find another way to ask these questions?

Anyway, thanks so much for your help everyone! Can't wait to show off my map!
04-11-2011, 01:49 AM
Find


Messages In This Thread
How can I script this sound so it plays correctly? - by genmills - 04-11-2011, 01:49 AM



Users browsing this thread: 1 Guest(s)