AI Speaking

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Guest

AI Speaking

Post by Guest »

Ok, I'm trying to get started on a map... but I would like to know if there is a way that I could make it so that when the player crosses a trigger, the friendly AI says something.
Sputnik
Colour Sergeant
Posts: 85
Joined: Thu Jul 04, 2002 12:36 am
Location: V.A.

Post by Sputnik »

Darnit that was me!
Image
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post by Angex »

Setup a trigger to go off when walked through, give it a key: setthread and corresponfing value: speech

In you script add a thread, called speech, and add in code like below:

speech:
$friendlyAItargetname say soundalias
end

$friendlyAItargetname - This is the target name you have given to the friendly AI character.

say - This is a script command which will make the targeted character speak.

soundalias - This is an alias from uberdialog, this is what will be spoken.

For example:

speech:
sgt_barnes say dfr_M1L1_104k_1
end

You may also find the following commands useful:
lookat
turnto
waittill saydone
Sputnik
Colour Sergeant
Posts: 85
Joined: Thu Jul 04, 2002 12:36 am
Location: V.A.

Post by Sputnik »

So, if I wanted my AI named 'friendly1' to say something I would write


// Speech Thread

speech:

$friendly1 say dfr_M1L1_104k_1

end

And thats it??

Also: How do I find the speech sounds?? Which pk3 are they in??
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Yes, but you need to add:

$friendly1 say dfr_M1L1_104k_1
$friendly1 wattill saydone

The dialogues are in mohaa\main\sound\dialogue, not a pk3, just a folder.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Sputnik
Colour Sergeant
Posts: 85
Joined: Thu Jul 04, 2002 12:36 am
Location: V.A.

Post by Sputnik »

Thanks, I'll try it. 8)
Image
phalanx

Post by phalanx »

Cool, does this all work in multiplayer?
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

It should work if you do it correctly. :wink:
Live to map, not map to live.
-mohaa_rox, .map
moderator
Post Reply