Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Play Sound on area
gericecold Offline
Junior Member

Posts: 8
Threads: 4
Joined: Nov 2010
Reputation: 0
#1
Play Sound on area

Hello, i have made a script, for playing a sound at a piano, when i walk into an area.
But when i try it the game crashes..

what have i done wrong?
heres the script :

// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "bitch", true, 1);
}


void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
{
PlaySoundAtEntity("knuppel", "general_piano03.snt", "piano_1", 2.0f, false);
StopSound("knubbel", 5.0f);
}

i hope for help Huh
12-12-2010, 12:21 PM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#2
RE: Play Sound on area

Error information please!

Rep if like me or im helpful or you love my stories!
Stephanos house
12-12-2010, 12:22 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#3
RE: Play Sound on area

void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

should be

void bitch(string &in asParent, string &in asChild, int alState)

then it might work
12-12-2010, 12:28 PM
Website Find
gericecold Offline
Junior Member

Posts: 8
Threads: 4
Joined: Nov 2010
Reputation: 0
#4
RE: Play Sound on area

(12-12-2010, 12:28 PM)jens Wrote: void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

should be

void bitch(string &in asParent, string &in asChild, int alState)

then it might work

cool, thank you for fast answer. it works great Smile
but why was my void wrong?
(This post was last modified: 12-12-2010, 12:45 PM by gericecold.)
12-12-2010, 12:36 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#5
RE: Play Sound on area

You used the wrong syntax for CollideCallbacks.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
12-12-2010, 01:50 PM
Find




Users browsing this thread: 1 Guest(s)