Frictional Games Forum (read-only)
[REQUEST] I want toactivate a sound when i pickup a note below is a script HELP!! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+--- Thread: [REQUEST] I want toactivate a sound when i pickup a note below is a script HELP!! (/thread-14895.html)



I want toactivate a sound when i pickup a note below is a script HELP!! - meneadeszz - 04-18-2012

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


RE: I want toactivate a sound when i pickup a note below is a script HELP!! - Datguy5 - 04-18-2012

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


RE: I want toactivate a sound when i pickup a note below is a script HELP!! - meneadeszz - 04-18-2012

(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


RE: I want toactivate a sound when i pickup a note below is a script HELP!! - Datguy5 - 04-18-2012

(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!!




RE: I want toactivate a sound when i pickup a note below is a script HELP!! - meneadeszz - 04-18-2012

(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?


RE: I want toactivate a sound when i pickup a note below is a script HELP!! - Datguy5 - 04-18-2012

{
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.



RE: I want toactivate a sound when i pickup a note below is a script HELP!! - meneadeszz - 04-18-2012

(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





RE: I want toactivate a sound when i pickup a note below is a script HELP!! - Datguy5 - 04-18-2012

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


RE: I want toactivate a sound when i pickup a note below is a script HELP!! - jessehmusic - 04-18-2012

(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!