Frictional Games Forum (read-only)

Full Version: Scripting help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need help, im new to scripting and all i know is the basics. I made an area on my map and i want it to trigger a sound. The cry of an enemy to be exact, Is there anyone thats willing to help me?
ALSO while im here, how do i switch off ambient lights so i know what my map will look like? thanks
Code:
void OnStart
{
AddEntityCollideCallback("Player", "AREA", "FUNC", true, 1);
}

void FUNC(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "enabled.snt, or other sound you want to use", "Entity you want sound at", 3, false);
}
That should do it. In the level editor, you'll want to look at the bottom bar and click the A and P boxes to disable the ambient light.
Ok so im obviously going to replace the sound to the one i want but do i make different script files for different areas on my map? how does it know what area i want it to collide with to make the sound? im confused.. If you can point me in the direction of an "understandable" tutorial or something would be of much help Wink Thanks for the script snippett aswell Big Grin