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
Item pickup trigger sound help
Xallikk Offline
Junior Member

Posts: 35
Threads: 7
Joined: Jun 2016
Reputation: 0
#3
RE: Item pickup trigger sound help

When I run the game, it crashes and says expected data type. I'm pretty sure my code is wrong, I'll put it here:

void OnStart()
{

AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("OpenDoor", "LevelKey1", "LevelDoor1", "UseKeyOnLevelDoor", true);
AddEntityCollideCallback("Player", "SpawnScare", "SoundCheck2", true, 1);
AddEntityCollideCallback("Player", "OpenScare", "SoundCheck", true, 1);
SetEntityCallbackFunc("Key", PickUp);
}



void PickUp("Key", "OnPickup")
{
PlaySoundAtEntity("pickupsound", "21_screams.snt", "PickupSound", 0.01f, false);
}


void SoundCheck2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("ambientsound", "ambience_wind_eerie.snt", "SpawnScare", 0.01f, true);
}

void SoundCheck(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scaresound", "notice.snt", "Player", 0.01f, false);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void UseKeyOnLevelDoor(string &in asItem, string &in asEntity)
{

SetLevelDoorLocked(asEntity, false);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
void OnLeave()
{
SetupLoadScreen("Loading", "LoadScreen1", 0, "LoadingScreen1.jpg");
}

The ones at the front always die first...
06-05-2016, 11:27 PM
Find


Messages In This Thread
Item pickup trigger sound help - by Xallikk - 06-05-2016, 08:53 PM
RE: Item pickup trigger sound help - by Mudbill - 06-05-2016, 09:47 PM
RE: Item pickup trigger sound help - by Xallikk - 06-05-2016, 11:27 PM
RE: Item pickup trigger sound help - by Mudbill - 06-06-2016, 12:47 AM
RE: Item pickup trigger sound help - by Xallikk - 06-06-2016, 01:13 AM
RE: Item pickup trigger sound help - by Mudbill - 06-06-2016, 08:06 AM
RE: Item pickup trigger sound help - by Xallikk - 06-07-2016, 01:32 AM



Users browsing this thread: 1 Guest(s)