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
Sound Help
Placeable Offline
Junior Member

Posts: 21
Threads: 2
Joined: Sep 2010
Reputation: 0
#4
RE: Sound Help

Quote:I got the "sound from a script area" working, but I couldn't get the SetEntityActive("specialSound", true); to work. I replaced the "specialsound" with the name of the sound, and set the sound to inactive.

When using placed out sound make sure you have a large enough distance/radius for it so the player can actually hear it. And the sound plays somewhat randomly in different intervals from what I've experienced. This also seem to depend on the sound being used; though not entirely sure about this one.

So naturally the sound would not be heard instantly once you activate it by code.

I've never tried the SetEntityActive(...) for placed out sound objects though, so once again not entirely sure this would work.

Quote:By the way, are there any rules for what I should place in "OnStart()", "OnEnter()" and "OnLeave" and what I shouldn't place there? And what is the specific difference between "OnStart()" and "OnEnter()"

Well, basically its like this:

OnStart() is only called once throughout the whole game, the first time the player enters the area. This is good to setup certain things like one-shot events and whatnot.

OnEnter() is called every time the player enters the area. Say you want a specific music to be played in an area, then you would put this code here.

OnLeave() is the opposite, maybe you want to add something to the area when the player leaves it and when the player returns back later something new would be there. Never used this function since I find it to be somewhat useless; you could achieve whatever the same purpose with OnEnter, just checking a variable or something.

Actually, if anything it would be good to 'clean up' the area when the player leaves. Maybe remaining monsters (if they are not removed by default), particles, or if you want to reset something (doors, levers...).

That's about it.
10-01-2010, 09:59 PM
Find


Messages In This Thread
Sound Help - by Stangi - 10-01-2010, 03:13 PM
RE: Sound Help - by Placeable - 10-01-2010, 05:47 PM
RE: Sound Help - by Stangi - 10-01-2010, 09:03 PM
RE: Sound Help - by Placeable - 10-01-2010, 09:59 PM
RE: Sound Help - by Stangi - 10-01-2010, 10:52 PM
RE: Sound Help - by Placeable - 10-01-2010, 11:25 PM
RE: Sound Help - by Stangi - 10-02-2010, 08:44 PM



Users browsing this thread: 3 Guest(s)