;Artificial Intelligence Script
;Triggers
desc = Walk, Attack on sight
;Triggers
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
;start follow waypoints
:state=0:waypointstart,state=1
;if npc see you (from a far distance too)
;delete the ';' so your npc see you earlier when no walls are in the field of view
;:state=1,plrcanbeseen:settarget,rotatetotarget,state=2
;notice player if he is 3 segements away
:state=1,plrdistwithin=300:settarget,rotatetotarget,state=2
;notice player if he shoot on the npc
:state=1,shotdamage=10:settarget,animate=1,rotatetotarget,state=2
:state=2:waypointstop,movetotarget,state=3
:state=3,plrdistfurther=90:rotatetoplr,movefore=200,animate=5
:state=3,plrdistfurther=500:animate=1,state=0
:state=3,plrdistwithin=90,rateoffire:rotatetoplr,setframe=8,state=4
:state=4,framebeyond=8 60,plrdistwithin=100:plraddhealth=-10,sound=audiobank\misc\,state=5
:state=4:incframe=8,rotatetoplr
:state=4,frameatend=8:state=1
:state=5:incframe=8
:state=5,frameatend=8:state=1
;End of Script
My next try
I change this script with this knowledge:
MOVEFORE=X
Description: This moves the entity forward at the rate of X where X is defined as
a percentage of the entity’s speed (i.e. if X=50, movement is 50% of entity’s
speed). Is the percentage results in less than 2 units of movement, the entity is
moved 2 units.
Range: X = Any value.
Example: :state=0:movefore=50
Corno_1