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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script which activates a sound when you pick up something. Help please
Author Message
meneadeszz Offline
Junior Member

Posts: 20
Joined: Apr 2012
Reputation: 0
Post: #1
Script which activates a sound when you pick up something. Help please
hello.

i would like to have a script when you pickup an item music or a sounds starts playing.

im thinking something like this

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

SetEntityPlayerInteractCallback("Letterone", "PickUpNote1", false);

asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity



void MyFunc(string &in asEntity)


void PickUpNote1(string &in asEntity)
{
PlaySoundAtEntity("NoteRoar", "insanity_monster_roar03.snt", "Note1Roar", 0, false);
}
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

Could somebody help me i don't see a problem i don't see a erro when i start the story but when i pick up Letterone.
The soundsdoesn't start
04-18-2012 04:26 PM
Find all posts by this user Quote this message in a reply
i3670 Offline
Senior Member

Posts: 432
Joined: Oct 2011
Reputation: 11
Post: #2
RE: Script which activates a sound when you pick up something. Help please
*Answer in the other thread, created by you*

"There is but one philosophical problem. Suicide." - Camus

The Dreamstride WIP
04-18-2012 07:55 PM
Find all posts by this user Quote this message in a reply
LulleBulle Offline
Member

Posts: 102
Joined: Feb 2012
Reputation: 0
Post: #3
RE: Script which activates a sound when you pick up something. Help please
void OnStart()
{
void SetEntityCallbackFunc("letterone", "PickUp");
}

void PickUp(string &asEntity, string &in type)
{
PlaySoundAtEntity("Play", "SoundFileHere", "Player", 0, false);
}
(This post was last modified: 04-18-2012 10:42 PM by LulleBulle.)
04-18-2012 10:39 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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