Jump to content
Sign in to follow this  
jammin1974

Hostage rescue problems

Recommended Posts

i have a small hostage script that is called in the civilian groups (2 civs)  init which works perfect. The problem I'm having is I want a side chat message to pop up when all the hostages have been set free I cant for the life of me work out how to do it. I have been trying things via a trigger , setting it to detect if my civs set captive state has changed(doesn't work for me). Could someone point me in the right direction please thanks.

_civilians = [civ1,civ2];

{
    _x setVariable ["hostageFree", false, true];
    _x playMove "Acts_AidlPsitMstpSsurWnonDnon01";
    _x disableAI "MOVE";
    _x disableAI "TARGET";

    [
    _x,
        [
            "Free Hostage",
            {
                params ["_object", "_caller", "_id"];
                _object removeAction _id;
                _object enableAI "MOVE";
                _object enableAI "TARGET";
                _object switchMove "";
                _object setVariable ["hostageFree", true, true];
            }
        ]
    ] remoteExec ["addAction"];

    _positions = nearestBuilding _x buildingPos -1;
    _x setPos (selectRandom _positions);
} forEach _civilians;

 

Share this post


Link to post
Share on other sites
_civilians spawn {
	waitUntil {sleep 3; {_x getVariable ["hostageFree", false]} count _this isEqualTo count _this};

	[sayerObject, "text"] remoteExec ["sideChat"];
	//or possibly just (don't know if the effect local counts on this)
	[west, "HQ"] sideChat "Hi there";
};

 

Share this post


Link to post
Share on other sites

Thanks for the help Kauppapekka I pasted this into the bottom of my script replacing sender name with Base and tested to see if it works, but I got an error (_this select 0) sidechat (_this select 1)>Error position: <sidechat (_this select 1)> Error sidechat: Type String, expected Array,Object. I can get the hint function to pop up fine if I use that tough, have I done something wrong?.

Share this post


Link to post
Share on other sites

just like to say thanks again dude everything works as expected thank you

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  

×