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
Scripting help
Nathannnnr93 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Aug 2011
Reputation: 0
#1
Scripting help

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
(This post was last modified: 08-14-2011, 10:17 PM by Nathannnnr93.)
08-14-2011, 08:32 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Scripting help

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.
08-14-2011, 08:50 PM
Find
Nathannnnr93 Offline
Junior Member

Posts: 21
Threads: 5
Joined: Aug 2011
Reputation: 0
#3
RE: Scripting help

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
(This post was last modified: 08-14-2011, 09:23 PM by Nathannnnr93.)
08-14-2011, 08:53 PM
Find




Users browsing this thread: 1 Guest(s)