I have a level I created and as I walk into a room, a guard turns to face me. As I get close, he begins to speak. If I move away and come back, he responds with different text. I move away and come back to him and he responds with a third message.
Here is the code I use for this:
;Artificial Intelligence Script
;Header
desc = game conversation
;walk up to a character and he will display a message. Walk away and the message will disappear.
;walk up to the character again and a different message will appear. Walk away and the message will disappear.
;walk up to the character once more and a different message will appear. Walk away and the message will disappear.
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\huds\ww2_bf\ww2_bf_l6objhud04a.tga,hudname=talk1,hudhide=1,hudmake=display :state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\huds\ww2_bf\ww2_bf_l6objhud04b.tga,hudname=talk2,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\huds\ww2_bf\ww2_bf_l6objhud04c.tga,hudname=talk3,hudhide=1,hudmake=display,state=10 :state=10,plrdistwithin=160:rotatetoplr
:state=10,plrdistwithin=60:rotatetoplr,sound=audiobank\voices\axis\curious\den_curious2_03d.wav,state=20
:state=20,plrdistwithin=60:rotatetoplr,hudshow=talk1,hudfadeout=talk1,timerstart
:state=20,timergreater=100:state=30
:state=30,plrdistwithin=160:rotatetoplr
:state=30,plrdistwithin=60:rotatetoplr,sound=audiobank\voices\axis\fear\den_fear_20a.wav,state=40
:state=40,plrdistwithin=60:rotatetoplr,hudshow=talk2,hudfadeout=talk2,timerstart
:state=40,timergreater=100:state=50
:state=50,plrdistwithin=160:rotatetoplr
:state=50,plrdistwithin=60:rotatetoplr,sound=audiobank\voices\axis\sighted\den_alarm_01e.wav,state=60
:state=60,plrdistwithin=60:rotatetoplr,hudshow=talk3,hudfadeout=talk3,timerstart
:state=60,timergreater=100:state=2
:state=2,plrdistfurther=60:state=50
;End of Script
Where you see the huds in the script I am showing-
(ex: hudimagefine=gamecore\huds\ww2_bf\ww2_bf_l6objhud04a.tga)
You just need to modify to your structure and name the hud what you want.
I believe I got this from the following link, so I hope it suits your needs:
http://forum.thegamecreators.com/?m=forum_view&t=65207&b=23
Hope that helps.
Cheers