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.