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
Another question that's probably syntax related >_<
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#1
Another question that's probably syntax related >_<

Okay, so the only thing I'm not so certain on is the SetLevelDoorLockedSound

This is my very first script made from scratch, so I apologize for the somewhat noobish post xP

void OnStart()
{
   AddTimer("CreepyMusic", 0, "CreepyMusic");
   AddUseItemCallback("CellarDoorKey1Func", "CellarDoorKey1", "CellarDoor1", "CellarDoorKey1Func", true);
}
void CreepyMusic(string &in asTimer)
{
   PlayMusic("06_amb.ogg", true, 7, 3, 0, true);
}
void SetLevelDoorLockedSound(CellarDoor1, "door_level_wood_locked.ogg");
{
}
void CellarDoorKey1Func(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("CellarDoor1", false);
    RemoveItem("CellarDoorKey1");
    PlaySoundAtEntity("unlocking", "unlock_door.snt", "Player", 0, true);
}

And I just got a really long error stating that it expected something at (1,2) I believe
04-01-2011, 04:16 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#2
RE: Another question that's probably syntax related >_<

Delete that and choose the level door in the editor, go to the entity tab and select the sound there. Tongue

04-01-2011, 06:15 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#3
RE: Another question that's probably syntax related >_<

You need the onenter and onleave functions there too.

You can use either the editor or your script to put the sound. It's a matter of personal choice though; I prefer script even though it's not as simple, just because I find it so easy to overlook things I put in the level editor.

Here's an example of my script I use for a locked door.

void LockedDoor2(string &in asEntity)
{
   if (GetGlobalVarInt("Lock") == 1){ SetMessage("Entryway", "LockedDoor2", 0);
                                      PlaySoundAtEntity("locked_door", "locked_door.snt", "prison_1", 0, false);
                                    }
}

I had SetGlobalVarInt("Lock", 1); in my OnStart for the variable, as well as SetEntityPlayerInteractCallback("prison_section_1", "LockedDoor", false); for the function. So yea, like the Panda Man said (I totally just made that up, sorry Big Grin) you can use level editor if you find it harder to script that stuff.
(This post was last modified: 04-01-2011, 06:48 PM by MrBigzy.)
04-01-2011, 06:46 PM
Find




Users browsing this thread: 1 Guest(s)