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 which activates a sound when you pick up something. Help please
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#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
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Script which activates a sound when you pick up something. Help please

*Answer in the other thread, created by you*

"What you think is irrelevant" - A character of our time

A Christmas Hunt
04-18-2012, 07:55 PM
Find
LulleBulle Offline
Member

Posts: 101
Threads: 33
Joined: Feb 2012
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)