ShipinShen
Junior Member
Posts: 23
Threads: 7
Joined: Apr 2014
Reputation:
0
|
Let a note starting music [Solved]
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
(This post was last modified: 04-25-2014, 10:39 PM by ShipinShen.)
|
|
04-23-2014, 05:53 PM |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
RE: Let a note starting music
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.
(This post was last modified: 04-23-2014, 06:01 PM by DnALANGE.)
|
|
04-23-2014, 05:59 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Let a note starting music
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 |
|
ShipinShen
Junior Member
Posts: 23
Threads: 7
Joined: Apr 2014
Reputation:
0
|
RE: Let a note starting music
(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"
|
|
04-23-2014, 09:42 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Let a note starting music
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.
(This post was last modified: 04-24-2014, 12:23 AM by Mudbill.)
|
|
04-24-2014, 12:22 AM |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
RE: Let a note starting music
Try this;
void prestige1(string &in asItem) { PlayGuiSound("Prestige.ogg", 1);//You Always use .ogg for PlayGuiSound(s). }
void OnStart() { SetEntityPlayerInteractCallback("prestige", "prestige1", true); }
(This post was last modified: 04-24-2014, 10:33 AM by DnALANGE.)
|
|
04-24-2014, 10:29 AM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Let a note starting music
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:void SetEntityCallbackFunc(string& asName, string& asCallback);
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
(This post was last modified: 04-24-2014, 10:52 AM by Mudbill.)
|
|
04-24-2014, 10:52 AM |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
RE: Let a note starting music
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
a Note is recigniced as a item if i aitn wrong here.
so when pick up the note it should be item?
(This post was last modified: 04-24-2014, 04:54 PM by DnALANGE.)
|
|
04-24-2014, 04:52 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Let a note starting music
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).
(This post was last modified: 04-24-2014, 05:07 PM by Mudbill.)
|
|
04-24-2014, 05:07 PM |
|
ShipinShen
Junior Member
Posts: 23
Threads: 7
Joined: Apr 2014
Reputation:
0
|
RE: Let a note starting music
(04-24-2014, 10:29 AM)DnALANGE Wrote: Try this;
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) ?
(This post was last modified: 04-25-2014, 06:08 PM by ShipinShen.)
|
|
04-25-2014, 04:26 PM |
|
|