// mdf-tbd: have a patrol setup section for stuff like stance, speed that is always desired for that patrol? // Otherwise anything that interrupts patrol will have to contain duplicate code to do this. inert 1 //debugmode 0 //debugaievents 1 //debugaiflags 6 //inert 1 onevent hearnoisethreat gotolabel handlehearnoise1 setmovespeed 0.3 //----------------------------------------------------------------------------- // default patrol :beginpatrol_1 gotoactor pathnode9 gotoactor pathnode39 gotoactor pathnode38 gotoactor pathnode33 gotoactor pathnode5 gotolabel beginpatrol_1 :endpatrol_1 // temporary patrol :beginpatrol_2 gotoactor pathnode35 gotoactor pathnode37 gotoactor pathnode33 gotoactor pathnode32 gotoactor pathnode34 gotolabel beginpatrol_2 :endpatrol_2 //----------------------------------------------------------------------------- :handlehearnoise1 setstance crouching animplay duckidle 0.0 0.0 1 sleeprand 2.0 setstance standing setmovespeed 0.3 ontimer 1 15.0 0.0 gotolabel restoredefaultpatrol setmovespeed 1.5 onevent hearnoisethreat gotolabel handlehearnoise2 resumepatrol beginpatrol_2 endpatrol_2 closest message "shouldn't get here" //----------------------------------------------------------------------------- // already handling heard noise -- reset timer and duckwalk for a while :handlehearnoise2 ontimer 1 15.0 0.0 gotolabel restoredefaultpatrol savedestination setstance crouching setmovespeed 0.2 ontimer 2 4.0 0.0 gotolabel restorestance resumepatrol beginpatrol_2 endpatrol_2 saved message "shouldn't get here" //----------------------------------------------------------------------------- :restoredefaultpatrol ontimer 1 setmovespeed 0.3 onevent hearnoisethreat gotolabel handlehearnoise1 resumepatrol beginpatrol_1 endpatrol_1 best message "shouldn't get here" :restorestance onevent hearnoisethreat // disable while changing stance savedestination ontimer 2 setstance standing setmovespeed 1.5 onevent hearnoisethreat gotolabel handlehearnoise2 resumepatrol beginpatrol_2 endpatrol_2 saved message "shouldn't get here"