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
Need help with script
afroduckie Offline
Junior Member

Posts: 35
Threads: 12
Joined: Jan 2013
Reputation: 0
#1
Need help with script

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!
(This post was last modified: 01-28-2013, 11:38 PM by afroduckie.)
01-28-2013, 11:29 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Need help with script

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

"What you think is irrelevant" - A character of our time

A Christmas Hunt
01-28-2013, 11:50 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: Need help with script

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

In Ruins [WIP]
(This post was last modified: 01-29-2013, 08:09 AM by NaxEla.)
01-29-2013, 01:25 AM
Find
afroduckie Offline
Junior Member

Posts: 35
Threads: 12
Joined: Jan 2013
Reputation: 0
#4
RE: Need help with script

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?
(This post was last modified: 01-29-2013, 02:19 AM by afroduckie.)
01-29-2013, 01:50 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Need help with script

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

TIP: when listing errors related to scripts, post your code.

Tutorials: From Noob to Pro
01-29-2013, 07:37 AM
Website Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#6
RE: Need help with script

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

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-29-2013, 09:43 AM
Find
afroduckie Offline
Junior Member

Posts: 35
Threads: 12
Joined: Jan 2013
Reputation: 0
#7
RE: Need help with 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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#8
RE: Need help with script

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

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-30-2013, 03:49 PM
Find
afroduckie Offline
Junior Member

Posts: 35
Threads: 12
Joined: Jan 2013
Reputation: 0
#9
RE: Need help with 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?
(This post was last modified: 01-30-2013, 11:49 PM by afroduckie.)
01-30-2013, 11:05 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#10
RE: Need help with script

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);
}

"What you think is irrelevant" - A character of our time

A Christmas Hunt
01-31-2013, 01:26 AM
Find




Users browsing this thread: 1 Guest(s)