OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Tinky the target on 14 Feb 2004, 02:03:36

Title: talking at a distance
Post by: Tinky the target on 14 Feb 2004, 02:03:36
Hey y'all

I was wondering if there is a way to have two AIs conversing, and what they are saying will appear on the screen (as text) when the player is near them.  But as the player moves away the text goes.

Also, to make it more confusing ??? would it be possible for the AI conversation to continue, and if the player walks back toward them the text reappears carrying on the conversation from the new point (sinec some of the conversation would have been missed while not near them).

Hope you can understand me!!
Title: Re:talking at a distance
Post by: .pablo. on 14 Feb 2004, 03:15:14
if u had the conversation as a script, you could do it by having a check before printing any info:

here's an example:

Quote
#sentence1
? (player distance _p2 < 2.5): CutText["blah blah blah...","PLAIN DOWN",1] ; ~2 ; CutText["","PLAIN DOWN",1];  goto "sentence2"

~2

#sentence2
? (player distance _p2 < 2.5): CutText["blah blah blah...","PLAIN DOWN",1]; ~3; CutText["","PLAIN DOWN",1]; goto "sentence3"

~3

as u can see, the text is only shown if the player is within range, but the convo still goes on, so that if the player comes in late he will miss a part of the conversation.  the only thing im not sure about is whether the ~times between the two cuttexts work.
Title: Re:talking at a distance
Post by: Tinky the target on 14 Feb 2004, 13:20:42
thanks pablo, sounds like a good way of doing it

or temporary measures i just had a repeating detection trigger that kicked off a script which randomly chose different parts of the convo...obviously that wont work too well so I'll definately give yours a go
Title: Re:talking at a distance
Post by: General Barron on 25 Feb 2004, 02:26:47
The "say" command has an easy way to do this, built in. Here is the command:

unit say ["speech name", distance it can be heard]

speech name is defined in the description.ext
the distance is a number which is the maximum # of meters away the player/camera can be and still have the titles show.

If you aren't using sound files though, then just use pablo's method.
Title: Re:talking at a distance
Post by: Tinky the target on 25 Feb 2004, 11:34:14
thanks general....

I'll look into this