Heres the code with some stuff which is not working stripped out so you can see what I am talking about :
Code :
;Artificial Intelligence Script
;Header
desc = West1 Tropper1
;Triggers
:state=0,random=20:rotateheadrandom=65
:state=0,shotdamage=10:settarget,rotatetotarget,resethead,rotatetoplr
:state=0,noiseheard=50:settarget,rotatetotarget,resethead,rotatetoplr
:state=0,plrcanbeseen=200:settarget,rotatetotarget,resethead,rotatetoplr,state=1
:state=1,random=20:rotateheadrandom=65
:state=1,shotdamage=10:settarget,rotatetotarget,resethead,rotatetoplr
:state=1,noiseheard=50:settarget,rotatetotarget,resethead,rotatetoplr
:state=1,plrcanbeseen=200:settarget,rotatetotarget,
:state=1,plrdistwithin=200:rotatetoplr
:state=1,plrdistwithin=75:settarget,animate=3,rotatetoplr,sound=audiobank\user\people\goin.ogg,state=2
:state=2,plrdistfurther=1100:settartget,destroy
:state=2,random=20:rotateheadrandom=65
:state=2,shotdamage=10:settarget,rotatetotarget,resethead,rotatetoplr
:state=2,noiseheard=50:settarget,rotatetotarget,resethead,rotatetoplr
:state=2,plrcanbeseen=200:settarget,rotatetotarget
:state=2,plrdistwithin=200:rotatetoplr
;End of Script
*************
Character animations are not default as he has my own animation sets.
State 0 is OK character at idle - animate=1.
State 1 Character should animate and play sound (talk to player) - animate=3 and sound all is OK
Now characeter goes to State 2 and as the script is - he continues to play animate=3 (no sound of course) which is not what I want.
If I insert an animate=1 (idle) command in State 2 then the prevoius State 1 animation becomes animate=1 too ignoring the animate=3 command playing the sound but going straight to the next State 2 and showing the animate=1 animation set.
What I need do is get state 1 to play animate=3 whilst the sound plays once the sound has finished it should move to state 2 immediately end animate=3 command and play animate=1. Which I have not yet been able to achieve and still have state 1 behave correctly.
I have tried now stipped out timer function in state 1 and commands such as setframe=(myendframe) and various other conmmands before moving to state 2 with no success
Hope someone can make sense perhaps of what I am trying to achieve and provide some help.
Thanks