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
Script Help No sound playing in script area
LDOriginal Offline
Junior Member

Posts: 35
Threads: 7
Joined: Oct 2014
Reputation: 0
#16
RE: No sound playing in script area

(10-08-2014, 07:10 AM)FlawlessHappiness Wrote: You have no function for the script area.

You only have a function for unlocking doors. And in that, you put the sound 25_strain_wood, which is exactly what you told it to.

If you want something to happen, when you collide with a script area, you need to make a function, so that something can actually happen.

What you want is both to have a function for the door and for the area. Looks like this:
PHP Code: (Select All)
void OnStart()
{ 

AddEntityCollideCallback("Player", "Ljud", "start", true, 1);
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true);
AddUseItemCallback("", "Tillskåp", "Skåp", "UseKeyOnDoor", true);
}

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

void start(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "25_strain_wood.snt", "Player", 0.0f, false);
} 

Also, can I just compliment your unlock-door-script? It looks very nice, and if you made that yourself, you already know a lot...

It works Smile Thank you very much! No need to compliment me, i snatched it of some youtube-tutorial.
10-08-2014, 08:21 AM
Find


Messages In This Thread
No sound playing in script area - by LDOriginal - 10-07-2014, 07:03 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 07:43 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 07:59 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 08:10 PM
RE: No sound playing in script area - by LDOriginal - 10-08-2014, 08:21 AM



Users browsing this thread: 1 Guest(s)