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
Request I want toactivate a sound when i pickup a note below is a script HELP!!
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#1
I want toactivate a sound when i pickup a note below is a script HELP!!

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, 03:59 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#2
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

Wroong section for this.You should post this in the support section.
Also its SetEntityCallbackFunc("ITEMS NAME", "FUNCTION");

(This post was last modified: 04-18-2012, 04:03 PM by Datguy5.)
04-18-2012, 04:00 PM
Find
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#3
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

(04-18-2012, 04:00 PM)Datguy5 Wrote: Wroong section for this.You should post this in the support section.
Also its SetEntityCallbackFunc("ITEMS NAME", "FUNCTION");
i called the note Letterone the same name like ine ditor and lang file
04-18-2012, 04:25 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#4
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

(04-18-2012, 04:25 PM)meneadeszz Wrote:
(04-18-2012, 04:00 PM)Datguy5 Wrote: Wroong section for this.You should post this in the support section.
Also its SetEntityCallbackFunc("ITEMS NAME", "FUNCTION");
i called the note Letterone the same name like ine ditor and lang file

Umm so?You just replace those i put with your items name and the function can be anything.JUST MAKE SURE ITS THE SAME AS IT IS IN THE VOID!!


04-18-2012, 05:05 PM
Find
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#5
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

(04-18-2012, 05:05 PM)Datguy5 Wrote:
(04-18-2012, 04:25 PM)meneadeszz Wrote:
(04-18-2012, 04:00 PM)Datguy5 Wrote: Wroong section for this.You should post this in the support section.
Also its SetEntityCallbackFunc("ITEMS NAME", "FUNCTION");
i called the note Letterone the same name like ine ditor and lang file

Umm so?You just replace those i put with your items name and the function can be anything.JUST MAKE SURE ITS THE SAME AS IT IS IN THE VOID!!
I dont'understand what you mean.

if in the void the name of the item is the same like in the editor and the .lang file then it's good?
04-18-2012, 05:12 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#6
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

{
SetEntityCallbackFunc("ITEMS NAME", "PickUpNote1");
}
void PickUpNote1(string &in asEntity)
{
PlaySoundAtEntity("NoteRoar", "insanity_monster_roar03.snt", "Note1Roar", 0, false);
}
The FUNCTION is the functions name after the void.Then rename the ITEMS NAME with your notes name.

04-18-2012, 05:37 PM
Find
meneadeszz Offline
Junior Member

Posts: 20
Threads: 9
Joined: Apr 2012
Reputation: 0
#7
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

(04-18-2012, 05:37 PM)Datguy5 Wrote: {
SetEntityCallbackFunc("ITEMS NAME", "PickUpNote1");
}
void PickUpNote1(string &in asEntity)
{
PlaySoundAtEntity("NoteRoar", "insanity_monster_roar03.snt", "Note1Roar", 0, false);
}
The FUNCTION is the functions name after the void.Then rename the ITEMS NAME with your notes name.
it's Still not working i will show you .

SetEntityCallbackFunc("Letterone", "PickUpNote1");
}

void PickUpNote1(string &in asEntity)
{
PlaySoundAtEntity("Letterone", "insanity_monster_roar03.snt", "Note1Roar", 0, false);
}

Here is a picture of the hps and editor..on the General tab the name is the same as entity

[Image: note1k.jpg]

Uploaded with ImageShack.us


04-18-2012, 06:12 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#8
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

You have to name the customsubitemtype too.Just name it the same as the textentry.

04-18-2012, 06:23 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#9
RE: I want toactivate a sound when i pickup a note below is a script HELP!!

(04-18-2012, 03:59 PM)meneadeszz Wrote: 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
i allways use this
"
void OnStart()
{
SetEntityPlayerInteractCallback("THE ENTITY NAME", "the func", false);


}

void the func (string &in asEntity)

{

PlaySoundAtEntity("", "insanity_monster_roar03.snt", "Note1Roar", 0, false);

}

Smile try that out!

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-18-2012, 06:48 PM
Website Find




Users browsing this thread: 1 Guest(s)