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
Sound on Pickup
samixxa Offline
Junior Member

Posts: 12
Threads: 3
Joined: Nov 2011
Reputation: 0
#1
Sound on Pickup

Hi everyone Im New to this so its all kinda confusing, i have a script activating a monster when i pickup a key, how do I make so it does play a sound also?
{
SetEntityCallbackFunc("key_2", "OnPickup");
}

void OnPickup(string &in asEntity, string &in type)
{
    SetEntityActive("monster_1", true);
    ShowEnemyPlayerPosition("monster_1");
}
01-25-2012, 03:44 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#2
RE: Sound on Pickup

PlaySoundAtEntity("Sound", "SoundFile.snt", "EntityForSoundToBePlayedAt", "0", true);

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
01-25-2012, 03:48 PM
Find
samixxa Offline
Junior Member

Posts: 12
Threads: 3
Joined: Nov 2011
Reputation: 0
#3
RE: Sound on Pickup

{
SetEntityCallbackFunc("key_2", "OnPickup");
}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster_1", true);
ShowEnemyPlayerPosition("monster_1");
PlaySoundAtEntity("Sound_1", "00_laugh.snt", "Player", "6", true);
}

Gives an Error?
(This post was last modified: 01-25-2012, 04:01 PM by samixxa.)
01-25-2012, 04:00 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Sound on Pickup

Capitalize "string &in astype" as:

string &in asType


Also take the quotes off 6.
(This post was last modified: 01-25-2012, 04:54 PM by Statyk.)
01-25-2012, 04:53 PM
Find
samixxa Offline
Junior Member

Posts: 12
Threads: 3
Joined: Nov 2011
Reputation: 0
#5
RE: Sound on Pickup

The sound comes instantly instead of comming when picking the key up?

Lower part of script
void OnPickup(string &in asEntity, string &in asType)
{
    SetEntityActive("monster_1", true);
    ShowEnemyPlayerPosition("monster_1");
    PlaySoundAtEntity("Sound_1", "00_laugh.snt", "Player", 6, true);
}
(This post was last modified: 01-25-2012, 05:17 PM by samixxa.)
01-25-2012, 05:14 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: Sound on Pickup

Don't place the sound in level editor btw.


01-25-2012, 05:52 PM
Find
samixxa Offline
Junior Member

Posts: 12
Threads: 3
Joined: Nov 2011
Reputation: 0
#7
RE: Sound on Pickup

I found a sollution.. I think.. Smile but thanks
(This post was last modified: 01-25-2012, 08:01 PM by samixxa.)
01-25-2012, 07:35 PM
Find




Users browsing this thread: 1 Guest(s)