Jump to content
Sign in to follow this  
Pexxx

Make AI hurt so it must be dragged around

Recommended Posts

I´m finishing a rescue-type mission and would be really interesting if the AI could not walk, so I can force the players to drag/carry him to the helicopter while avoiding enemy fire.

I´m using the first aid modules and it´s working fine, but i want to prevent the players from healing him... (like his leg was amputed during the crash :eek: )

Any ideas?

Ps:First post here...

Share this post


Link to post
Share on other sites

- Link it to the AIS and BC module

- setdammage between 0.6 and 0.9

- unit setunconscious true

Share this post


Link to post
Share on other sites

I was already using setdamage....

Dont know if setunconscious work in multiplayer coop,

But Ill try setHit.

Thx.

Share this post


Link to post
Share on other sites

The problem is that they are healable, you wanted them not to be healable right?

I'm sure there's a variable somewhere that sets that on or off, but with absolutely no useful documentation about the First Aid modules, I have no idea what it is.

Found a thread last night that had some nice variables listed, from Noxxy or someone, but nothing that would turn off the heal me prompt. You could probably rip open the modules and check the code to see if you find anything though.

Share this post


Link to post
Share on other sites

Okay, so I do exactly this in my second mission. Thanks to Big Dawg KS for this too! Here is the script I use, I think this is all of it. Haven't touched it in a while so let me know if it doesn't work and I'll check if I use anything else related to this.

Just replace sarPilot with the name of the unit you want to be crippled. Also synchronize the unit to a Battlefield Clearance module, but not a First Aid. You can either put all this in the init field or call on it with a script, as I do.

sarPilot setCaptive true; sarPilot disableAI "ANIM";
sarPilot setHit ["body",0.7]; sarPilot setHit ["legs",0.9];
sarPilot setHit ["arms",0.6]; sarPilot setHit ["head_hit",0.3];
sarPilot setVariable ["BIS_noCoreConversations", true, true];

injuredAnim = sarPilot spawn {
  _this switchMove "AinjPpneMstpSnonWnonDnon";
 // waitUntil{!medicTreatingCaptive};
  _this setVariable ["BIS_IS_inAgony",true];
  _this setVariable ["BIS_IS_agonyDam",0,true];
  waitUntil{
     if(_this getVariable "BIS_IS_inAgony")then{_this setVariable ["BIS_IS_inAgony",true]};
     !(alive _this)
  };
  _this setVariable ["BIS_IS_inAgony",false,true];
};
captiveShowSignsOfLife = sarPilot spawn {
  _gestures = ["GestureSpasm0Weak","GestureSpasm1Weak","GestureSpasm2Weak","GestureSpasm3Weak","GestureSpasm4Weak","GestureSpasm6Weak"];
  _timer = 0;
  waitUntil{
     if(animationState _this != "AinjPpneMstpSnonWnonDnon")then{
        _this playActionNow "GestureNod";
        waitUntil{!(alive _this) || (animationState _this == "AinjPpneMstpSnonWnonDnon") || (animationState _this == "AinjPfalMstpSnonWnonDnon_carried_down")};
        if(animationState _this == "AinjPfalMstpSnonWnonDnon_carried_down")then{
           _this playMoveNow "AinjPpneMstpSnonWnonDnon";
           waitUntil{animationState _this == "AinjPpneMstpSnonWnonDnon"}
        };
        _timer = 0
     };
     if(_timer <= 0 && alive _this)then{
        _gesture = _gestures select (floor random 6);
        _this playAction _gesture;
        _timer = 120
     }; 
     sleep 0.5; 
     _timer = _timer - 0.5; 
     !(alive _this)
  };
  _this playActionNow "GestureNod";
  _this setHit ["head_hit",1];
};

If you want to see my original post asking for this, here it is: http://forums.bistudio.com/showthread.php?t=82597

Edited by JDog

Share this post


Link to post
Share on other sites

Well thanks for the anwsers, but I did this way:

Put a trigger that activates repeatedly with:

Cond:

pilot damage < 0.5

On act:

pilot setdamage 0.6; pilot sethit ["legs",1];

And a groupchat explaining that theres nothing they could do 'cuse his leg is shattered...

This way he´s always hurt, but alive.

This turn out to be a pretty simple and effective solution. I guess this will even work with the other two first aid modules synched.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×