Page 1 of 1

Scripting Speech fo AI

Posted: Tue Mar 04, 2003 8:33 pm
by Gen Cobra
Some one told me this works.

make 2 enemies. give one a targetname $talker1.
and the other a targetname $talker2

make a brush with a "trigger once" attached to it.

give the trigger key setthread
value speech

now in the script all u have to type in is...

speech:
$talker1 say den_m2l2_218p

$talker1 waittill saydone
wait 1
$talker2 say den_m2l2_219h

$talker2 waittill saydone
end

easy ay.

if u want to do more speech ingame jus do the same, but this time give the trigger

key setthread
value speech1 (just add a different number each time at the end of "speech")

so this time it will be....

speech1:
$talker3 say den_m2l2_249q

$talker3 waittill saydone
wait 2
$talker4 say den_m2l2_250a

$talker4 waittill saydone
end
_________________
...prepare for your finest hour...thanx

remember.

U can also get them to look at each other which is very simple to do...

just add
speech:

$talker1 lookat $talker2

$talker1 say den_m2l2_218p

$talker1 waittill saydone

(if u want the person to stop lookin after saydone, just add the line..)
$talker1 lookat NULL


I would really like to know if it does. I messed witrh it but couldn't get it to work. The bots worked fine but they never started talking. I tried the lines in several places in the script. Does anybody know cause I could have ablast with this if I could get it to work. There are so many wav files to use it's awesome, and making custom ones, well that would be the shiznit. 8)

Posted: Tue Mar 04, 2003 8:43 pm
by jv_map
Most likely this is an ubersound problem.

If prefixing 'test_' to your map's bsp name makes any difference, try the ubersound work-around tutorial.

Posted: Tue Mar 04, 2003 8:46 pm
by Gen Cobra
I prefixed test to my map a little late I had m1l1 for awhile. I'll try it again I guess. Do you pack a sp map differently then a MP map? How does a normal person launch a sp map? I do it from the chaulk board but normal people don't have that. (usually)

Posted: Wed Mar 05, 2003 3:29 pm
by jv_map
I think the maplist is the way to go. (small paper on the pillar in the main menu).

Posted: Thu Mar 06, 2003 4:48 am
by small_sumo
So how do you add uberdialog? like your ubersound workaround. For mp and the like.

Posted: Thu Mar 06, 2003 11:31 am
by Angex
Well for SP; you have to extract the character's tiki you want, and adjust the lines at the end, to something like the first section of cose.

( Just to point out these are from a test map I made called "kill_general", so you'll see the word "kill" splashed about all over the place. )

This code basically tells the game where to look for this characters animations, which leads onto where the sounds are. It also contains a line Quaked, which tells radiant to load this character.

Code: Select all

$include models/human/kill_generic_human.tik
$include models/human/animation/dialogue/kill_generic_dialogue_US.tik
//$include models/human/animation/helmet_flyoff/helmet_flyoff_ranger_private.tik

/*QUAKED ai_kill_allied_1st-ranger_private (1.0 0.5 0.0) (-16 -16 0) (16 16 96)
*/
Then make a file called kill_generic_dialogue_US.tik and place it in models\human\animation\dialogue. This tiki will contain the animations for the dialogue, I belive this to be the mouth movement, but some also cause characters to wave their arms about the place. It should look like below;

The path is where the animation file is kept. The first reference to dfr_M1L1_add05 in the animations section, is an alias to the animation called, ACTOR_m1l1_add05.skc. The first sound dfr_M1L1_add05 is a reference to a sound alias, i.e. the dfr_M1L1_add05 part.

Code: Select all

setup
{
	path models/human/animation/dialogue/M1L1/A
}

animations
{	
	dfr_M1L1_add05		ACTOR_m1l1_add05.skc
	{
		client			/// Powell, check the door
		{
			first sound dfr_M1L1_add05
		}
	}
}
Then you need a sound tiki, so in your models\sound\missionName folder make a tiki called something like dialog_us_misc. I don't fully understand this file myself, I just take it for granted that it works.

The only bit we're intrested in is the alias part (it should all be on a single line). Firstly it has the alias for the sound(should match the animation tiki).

Secondly is the full sound path. I don't remember what the sound params do so just sopy them.

"Streamed" tells the game not to preload the sound file.

Subtitle "Powel, check the door." is the subtitle displayed, in this case "Powel, check the door" is shown.

Finally, maps "mapName", is the maps the sound will work for. In this tiki place something like below;

Code: Select all

TIKI

setup
{
	path models/fx/dummy
	skelmodel dummy3.skd
}

init
{
	server
	{
	    classname ScriptModel
		rendereffects +dontdraw
		notsolid
	}
	client
	{
		settiki none
		alias dfr_M1L1_add05 sound/dialogue/M1L1/A/dfr_m1l1_add05h_01.wav soundparms 1.2 0.0 1.0 0.0 10000 10000 dialog streamed subtitle "Powell, check the door." maps "kill_general"
	}
}

animations
{
	idle     dummy3.skc
}
Then in the precahce file you need to add, cache models/sound/missionName/dialog_us_misc.tik


But as I say thats for SP, I imagine MP is something similar but since I don't do MP mapping I wouldn't know.

Posted: Fri Mar 07, 2003 4:05 pm
by LT.BARNES
i was the one who done that scripy for talkin! i got it from the level i made and it works fine..

but u have to remember to add triggers on the level and give the enermys the right names and it will all work fine

Posted: Fri Mar 07, 2003 8:31 pm
by Gen Cobra
yeah I realize it was you that posted that way back. I rtied again, and I gave them the names you said to and the trigger. Nothing happens though, My sp is a test extension so the sound should work.