Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 1 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help How to add scripted sound
Author Message
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #1
How to add scripted sound

how do i add scripted sound as i enter a certain area i can use scripted sound on like a door but how do i pt just to say in the middle of a dark room
04-01-2012 02:19 AM
Find all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 318
Joined: Mar 2012
Reputation: 8
Post: #2
RE: How to add scripted sound

AddEntityCollideCallback("Player", "DarkRoomScript_1", "ScarySound", true, 1);

void ScarySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "SOUNDNAME.snt", "EntityPlayedOn", 0, false);

GiveSanityDamage(5.0f);
}

04-01-2012 03:26 AM
Find all posts by this user Quote this message in a reply
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #3
RE: How to add scripted sound

(04-01-2012 03:26 AM)Xanthos Wrote:  AddEntityCollideCallback("Player", "DarkRoomScript_1", "ScarySound", true, 1);

void ScarySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "SOUNDNAME.snt", "EntityPlayedOn", 0, false);

GiveSanityDamage(5.0f);
}
wow thanks it works but i had to delete the sanitydamage thing it caused my game to crash but the sound works thanks heeps Smile
04-01-2012 03:34 AM
Find all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 318
Joined: Mar 2012
Reputation: 8
Post: #4
RE: How to add scripted sound

GiveSanityDamage(5.0f, true);
oops

04-01-2012 03:36 AM
Find all posts by this user Quote this message in a reply
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #5
RE: How to add scripted sound

(04-01-2012 03:36 AM)Xanthos Wrote:  GiveSanityDamage(5.0f, true);
oops

haha now it works thanks Smile
04-01-2012 03:37 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)