Jump to content
kremator

Use of expectedDestination then setDestination in scripts

Recommended Posts

Hey guys,

 

Getting on quite well tinkering with the insurgency mission (combined with madcheese's C2 mod makes it brilliant) but I want to add further scripting to my automagic medics - they autorevive and autoheal.  When a group member gets hits (doesn't matter if it hurts or kills them) the medics are given a doMove command to the injured soldier.  However, if they were ALREADY on a move command (can check via currentCommand "MOVE") then I want them to resume to where I had already sent them!

 

I've been playing around with the coding but wrapping myself in knots - I can't code, only tinker :)  I've looked at the biki but am finding it tougher than it should be.  Anyone able to help with a code snippet or two that will help my medics get back ontrack?

Share this post


Link to post
Share on other sites

Maybe either of these..

if !( currentCommand _unit == "MOVE" ) then {
    //Do new move
};

if ( unitReady _unit ) do {
    //Do new move
};

Share this post


Link to post
Share on other sites

Thanks Larrow, but I'm trying to capture the location of where they had been sent to (before I rudely interrupt them and give them another job first :) )

Share this post


Link to post
Share on other sites

If all else fails, I would just check "stopped" and "formationLeader".
 

If your medic is stopped, then just send him back to his original location after doing his thing.

Otherwise store the "formationLeader" and then issue a "doFollow".

 

I guess that should suffice for most situations.

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

×