jammin1974 0 Posted March 24, 2017 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
kauppapekka 27 Posted March 24, 2017 _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
jammin1974 0 Posted March 24, 2017 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
kauppapekka 27 Posted March 24, 2017 https://community.bistudio.com/wiki/sideChat You need to have an object or an array on the first part of the sideChat. Had mistakenly placed a string name on the remoteExec as I just took a quick look at the syntax: unitName sideChat chatText. Share this post Link to post Share on other sites
jammin1974 0 Posted March 24, 2017 just like to say thanks again dude everything works as expected thank you Share this post Link to post Share on other sites