Hello, I modified the talking script so nicely provided by BenjaminA, so credit for the original concept is all his!
Follow waypoints
display a press enter to talk hud when close enough
stop following waypoints when user press enters to talk
displays text image hud and plays audio sound
say 3 different things for 3 times approached, after the 3rd time he will start walking waypoints again.
Example approach once enter (stops walking) "Your new around here right?"
approach again press enter "bet you hate it here"
approach a third time "leave me alone already!" (then starts following waypoints again)
;Created by Benjamin Aeilkema
;Modified by mAcpo
;Header
desc = game conversation
;walk up to an character and he will display a message. Walk away and the message will dissappear.
;walk up to the character again and a different message will appear. Walk away and the message will dissappear.
;walk up to the character once more and a different message will appear. Walk away and the message will dissappear.
;Triggers
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
:nearactivatable=0:settarget,activatetarget=2,animate=1,state=0
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertotalk.png,hudname=usetalkprompt,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=80,hudimagefine=audiobank\uservoices\jumped.png,hudname=talk1,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=80,hudimagefine=audiobank\uservoices\jumped2.png,hudname=talk2,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=80,hudimagefine=audiobank\uservoices\jumped3.png,hudname=talk3,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=100:rotatetoplr,hudshow=usetalkprompt,hudfadeout=usetalkprompt
:state=10,plrdistwithin=60,plrusingaction=1:rotatetoplr,waypointstop,sound=audiobank\uservoices\chinese.wav,state=20
:state=20,plrdistwithin=60:rotatetoplr,hudshow=talk1,hudfadeout=talk1,timerstart
:state=20,timergreater=100:state=30
:state=30,plrdistwithin=120:rotatetoplr
:state=30,plrdistwithin=60,plrusingaction=1:rotatetoplr,sound=audiobank\zombie\finalmoan.wav,state=40
:state=40,plrdistwithin=60:rotatetoplr,hudshow=talk2,hudfadeout=talk2,timerstart
:state=40,timergreater=100:state=50
:state=50,plrdistwithin=120:rotatetoplr
:state=50,plrdistwithin=60,plrusingaction=1:rotatetoplr,sound=audiobank\zombie\hurt3.wav,state=60
:state=60,plrdistwithin=60:rotatetoplr,hudshow=talk3,hudfadeout=talk3,timerstart
:state=60,timergreater=100:state=2
:state=2,plrdistfurther=60:waypointstart,state=10
;End of Script
Works perfectly!
One thing I would like if anyone can help.. what can be added to the script so that when the character hits a waypoint, he actually pauses for a few seconds before walking again? This way it will look more like he is just hanging around and not like a mental patient bouncing back and forth
as a side note this script can be easily modified so that you don't have to push enter to make the character stop and talk. If anyone needs code for that, just ask.