Frictional Games Forum (read-only)

Full Version: Let a note starting music [Solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey i already know, how to add the voice acting to a note, but i dont know how let a note start music.. I want that the music starts to play when i'm reading note, even after closing the note, the music should continue.
I think it should work with an addentitycollidecallback, shouldn't it ?

Thanks for help Smile
Just do not want to just show off the script.
why not just look a little in for example the main game its files \ scripts \ level editor.
I am not 100% sure but i think it is NOT possible to have music AND voiceacting together in a note.
Note is NOT possible to have voiceacting btw. should be in JOURNAL then.
-
I guess what you can do is this when picked up the note :
SetEntityPlayerLookAtCallback("", "", true);, when interacting add a .ogg file.
Try it out i should say.
I suggest adding a PickUp callback and run PlayMusic or possibly PlayGuiSound as you pick it up. That could work. You just need to make sure the event is actually executed before the note text appears, or else it will wait until you close it.
(04-23-2014, 06:10 PM)Mudbill Wrote: [ -> ]I suggest adding a PickUp callback and run PlayMusic or possibly PlayGuiSound as you pick it up. That could work. You just need to make sure the event is actually executed before the note text appears, or else it will wait until you close it.

Thats a good idea, i tried it with PlayGuiSound and with PlayMusic, but it gives me an error "ERR expectet Data Type" on the red marked lines

Quote:void prestige("NoteHilfe", "OnPickup")
{
PlayGuiSound("Prestige.snt", 1);
}

void OnStart()
{
SetEntityCallbackFunc("prestige", "prestige1");
}

The Callback func of the note in the editor is names as "prestige1" and the note as "NoteHilfe"
You do not modify the parameters in a constructor. Leave those as they are and only modify the calls to the different functions within your block.

I think the parameters you need here are (string &in asEntity, string &in Type).

Also change the callback in OnStart to include "prestige" in both, rather than "prestige1" in the second.
Try this;

PHP Code:
void prestige1(string &in asItem)
 {
 
PlayGuiSound("Prestige.ogg"1);//You Always use .ogg for PlayGuiSound(s).
 
}

 
void OnStart()
 {
SetEntityPlayerInteractCallback("prestige""prestige1"true);
 } 
You CAN use .snt files in PlayGuiSound, but it's not required.

And as you can see, the parameters are indeed (string &in asEntity, string &in type). (string &in asEntity) belongs to interaction callbacks rather than regular callbacks.

Quote:
PHP Code:
void SetEntityCallbackFunc(stringasNamestringasCallback); 

Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
The one i gave should work if i aint wrong..
if i am wrong i am mistaken and i want to learn why i am wrong Tongue

a Note is recigniced as a item if i aitn wrong here.
so when pick up the note it should be item?
Well, it might work, but seeing as the EntityCallback itself has a "type" of PickUp which is designed for picking up items, it's probably a better option than an EntityInteract callback, which is designed when the player interacts with an object (as in clicking on it).
(04-24-2014, 10:29 AM)DnALANGE Wrote: [ -> ]Try this;

PHP Code:
void prestige1(string &in asItem)
 {
 
PlayGuiSound("Prestige.ogg"1);//You Always use .ogg for PlayGuiSound(s).
 
}

 
void OnStart()
 {
SetEntityPlayerInteractCallback("prestige""prestige1"true);
 } 

where i have to write the item name, the script doesnt work :p, i thinkt thats the reason ? in void prestige1(string &in asItem) ?
Pages: 1 2