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
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#13
RE: Script help

You won't ever receive an error if you provide the wrong name for an entity in your map - it just won't work

The problem is on this line...

PlayGuiSound("unlock_door.snt", door, 0, false);

You use the name 'door' as though it is a variable - that is why it is complaining that door has not been declared, it's expecting a variable called door, and there isn't one

Regardless, that function call is incorrect

void PlayGuiSound(string& asSoundFile, float afVolume);

Plays a sound, not using 3D.
asSoundFile - the sound to play (extension is .snt)
afVolume - the volume of the sound

It looks like you want to use the PlaySoundAtEntity function, not PlayGuiSound, and provide either the name of a valid variable, in this case asEntity being the door that the key is used on, or you can use the literal name of the door "level_wood_1"

void FUNCTION(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_wood_1", false);
    PlaySoundAtEntity("unlock_door.snt", asEntity, 0, false);
    RemoveItem("key_tomb_rusty_1");
}

(This post was last modified: 05-28-2013, 05:42 PM by Adrianis.)
05-28-2013, 05:33 PM
Find


Messages In This Thread
Script help - by tezpull666 - 05-26-2013, 07:04 PM
RE: Script help - by Bridge - 05-26-2013, 07:26 PM
RE: Script help - by Romulator - 05-27-2013, 10:25 AM
RE: Script help - by tezpull666 - 05-27-2013, 03:41 PM
RE: Script help - by Bridge - 05-27-2013, 05:31 PM
RE: Script help - by tezpull666 - 05-27-2013, 06:07 PM
RE: Script help - by Bridge - 05-27-2013, 06:16 PM
RE: Script help - by tezpull666 - 05-27-2013, 06:17 PM
RE: Script help - by Bridge - 05-27-2013, 07:05 PM
RE: Script help - by Kullin - 05-27-2013, 07:15 PM
RE: Script help - by tezpull666 - 05-28-2013, 03:35 PM
RE: Script help - by Bridge - 05-28-2013, 04:45 PM
RE: Script help - by Adrianis - 05-28-2013, 05:33 PM
RE: Script help - by tezpull666 - 05-28-2013, 05:58 PM
RE: Script help - by amnesiaplayer321 - 05-28-2013, 06:00 PM
RE: Script help - by OriginalUsername - 05-28-2013, 06:21 PM
RE: Script help - by Adrianis - 05-28-2013, 06:06 PM
RE: Script help - by tezpull666 - 05-28-2013, 06:12 PM
RE: Script help - by Bridge - 05-28-2013, 06:35 PM



Users browsing this thread: 1 Guest(s)