Home   Help Search Login Register  

Author Topic: Idle guards breaking immersion  (Read 2163 times)

0 Members and 1 Guest are viewing this topic.

Offline cheesus

  • Members
  • *
Idle guards breaking immersion
« on: 13 Feb 2010, 16:39:58 »
After searching through the ofpec & bis forums to my suprise I've not been able to solve a fairly typical situation i want to create.

I've got a bunch of units standing around performing idle & talking animations looking like a nice target for the opfor using the following code (should look familiar).

Code: [Select]
_unit = _this select 0;
_animation = _this select 1;

while {damage _unit <= 0.1} do {
_unit switchMove _animation;
waitUntil {!(animationState _unit == _animation)};

};

So the units are looping their animations while in their inits i have:
Code: [Select]
this addEventHandler ["hit",{unitname switchmove "";}];So if they get hit they stop doing their animation and start acting like units again.

Now what i'd like to have next is to use a "detected by" trigger to break their animation loop when the opfor turns up - otherwise they just stand there looping animations while their buddys get shot & breaking the immersion of the scene.

I've tried a bunch of stuff - mainly playing with a global 'stopscript=true' boolean in the trigger & the 'waituntil' & 'while' statements but arma2 rejects all syntax I've tried (or 'borrowed' :)). I'd be very grateful to put this issue to rest & get back to creating gameplay  ???