Frictional Games Forum (read-only)

Full Version: Need help with script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am Afroduckie and I am currently working on a Custom Story. I am new to angel script, and I dont know how to write a script for narration (meaning the kind like when Alexander is talking to you and captions show up at the bottom). I would very much appreciate some help on this.

UPDATE!
To be more specific, I need a script to add the narration after a person reads a note. Please and thank you!
AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);

This adds a voice and an effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.

asVoiceFile - the voice to play
asEffectFile - the effect to play
asTextCat - the category in the .lang file
asTextEntry - the text entry in the .lang file
abUsePosition - plays using 3D from the entity, or without 3D
asPosEntity - the entity at which the effect appears
afMinDistance - minimum distance to see the effect
afMaxDistance - maximum distance to see the effect

http://wiki.frictionalgames.com/hpl2/amn...ns#journal
Remember, afroduckie, when scripting, the wiki is your best friend.

http://wiki.frictionalgames.com/hpl2/amn..._functions

If you're unsure about how to script something, check the page. Sometimes you can just search what you're looking for. For example in this situation, you could just try searching the word 'voice' on the page, and you would have found what your looking for Tongue
Thanks much amigos!

Okay, when I tried the script, the brackets screwed with my hps and it failed. Should it start with "void"?

Also what is the category which the caption would be under?

UPDATE: Im stupid. I forgot a parenthesis.

Fixed it then this came up:

FATAL ERROR: Could not load script file 'custom_stories/Rise of the Fallen/maps/fallen/one.hps'
Main (9, 15) : ERR :Expected identifier.

At line 9 column 15 is the AddEffectVoice thing. Column 15 is at the end of VOICE.

What is the issue? Any clue?
(01-29-2013, 01:50 AM)afroduckie Wrote: [ -> ]What is the issue? Any clue?

TIP: when listing errors related to scripts, post your code.
(01-29-2013, 01:50 AM)afroduckie Wrote: [ -> ]Fixed it then this came up:

FATAL ERROR: Could not load script file 'custom_stories/Rise of the Fallen/maps/fallen/one.hps'
Main (9, 15) : ERR :Expected identifier.

At line 9 column 15 is the AddEffectVoice thing. Column 15 is at the end of VOICE.

What is the issue? Any clue?

Can you post your script ?
This is all I had so far:

{
AddEffectVoice(string(& voice01.ogg)), string& asEffectFile, string& caption, string& voice01, bool abUsePosition, string& intro_note, float afMinDistance, float afMaxDistance);
}

I didnt know what lang category it needed, so I went to look it up. Apparently the error is before that though...
(01-30-2013, 01:56 PM)afroduckie Wrote: [ -> ]This is all I had so far:

{
AddEffectVoice(string(& voice01.ogg)), string& asEffectFile, string& caption, string& voice01, bool abUsePosition, string& intro_note, float afMinDistance, float afMaxDistance);
}

I didnt know what lang category it needed, so I went to look it up. Apparently the error is before that though...

Is that your full script ?
(01-30-2013, 03:49 PM)No Author Wrote: [ -> ]
(01-30-2013, 01:56 PM)afroduckie Wrote: [ -> ]This is all I had so far:

{
AddEffectVoice(string(& voice01.ogg)), string& asEffectFile, string& caption, string& voice01, bool abUsePosition, string& intro_note, float afMinDistance, float afMaxDistance);
}

I didnt know what lang category it needed, so I went to look it up. Apparently the error is before that though...

Is that your full script ?

That is just the part that didnt work right. Im gonna pull a script from the original game and rename everything... see if that works

Okay, this script works:

{
AddEffectVoice("voice01", "", "Voice", "invoice", false, "intro_note", 0, 0);

}

It just played it as soon as I spawned.
But how do I make it play AFTER reading the note?
Under the "Entity" tab when you click on the note in the leveleditor there is box named PlayerInteractCallback. Type in the name of a callback, can be anything.

Then go to your script and type in:

void NAMEOFCALLBACK(string &in asEntity)
{
AddEffectVoice("voice01", "", "Voice", "invoice", false, "intro_note", 0, 0);
}
Pages: 1 2