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
problems with sound script (solved)
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: problems with sound script

Your problem is that you have 2 void OnStart. You can only have 1 void OnStart 1 void OnEnter and 1 OnLeave.

This is how it should look like Smile

PHP Code: (Select All)
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player""RoomTwoArea""CollideRoomTwo"true1);
AddEntityCollideCallback("Player""Music_1""start"true1);
AddUseItemCallback("mansion_1""awesomekey_1""mansion_1""KeyOnDoor"true);
}

void CollideRoomTwo(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("mansion_1"truetrue);
}

void KeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("mansion_1"falsetrue); 
PlaySoundAtEntity("02_puzzle.ogg""unlock_door""mansion_1"1false);
RemoveItem("awesomekey_1");
}

void start(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""amd_idle03.ogg""Player"0false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{



Also OnEnter is for scripts that you want to be called every time the player enters the map. OnStart is the one you will use most since you usually only want scares and other events to happen first time the player enters the map Smile

OnEnter is most used for playing music and preload stuff

(This post was last modified: 05-20-2012, 10:03 PM by SilentStriker.)
05-20-2012, 10:03 PM
Find


Messages In This Thread
problems with sound script (solved) - by Nice - 05-20-2012, 09:27 PM
RE: problems with sound script - by SilentStriker - 05-20-2012, 09:37 PM
RE: problems with sound script - by Nice - 05-20-2012, 09:44 PM
RE: problems with sound script - by SilentStriker - 05-20-2012, 09:50 PM
RE: problems with sound script - by Nice - 05-20-2012, 09:52 PM
RE: problems with sound script - by SilentStriker - 05-20-2012, 10:03 PM
RE: problems with sound script - by Nice - 05-20-2012, 10:05 PM
RE: problems with sound script - by SilentStriker - 05-21-2012, 06:45 AM
RE: problems with sound script - by Adny - 05-20-2012, 10:23 PM



Users browsing this thread: 1 Guest(s)