Bandicoot 0 Posted May 23, 2007 Hi, I'm trying to add a simple detection line in a script like a trigger in editor. "NOT Detect any East units within a particular radius of a waypoint/marker/unit". Â ? (waypoint _distance EAST) => 200 : goto "exit" No EAST units within 200 of Unit(called Waypoint) to exit script. ================= The only option I've found that works involves creating a trigger(EAST- Not Present - Once - Radius 200 -ACTIVATE:H setdamage 4 ) and H is a unit (H Invisible object). And in the script add this to exit it: ?(Alive H):goto "Cont" goto "Exit" #Cont ================ Can someone please advise if there is another way? Thanks Bandicoot Share this post Link to post Share on other sites
karantan 0 Posted May 23, 2007 ? (waypoint _distance EAST) => 200 : goto "exit" This is about the distance of/from the unit, not about a 'detection' of it, but you know that yes ? You could use a knowsabout command like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soldierOne knowsAbout soldierTwo but don't expect a miracle from it; the command is not so reliable. And why you just don't use a Detected by ,,, triggers? Share this post Link to post Share on other sites
Metal Heart 0 Posted May 23, 2007 You can use list triggername to get a pointer to the array of units which match its condition and count them with count. 1. Name trigger someTrig 2. Access it from a script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_l = list someTrig #check ~5 ?count _l<1: hint "Not detected."; goto "check" hint "Detected!" goto "check" Note that _l is a pointer to the trigger's array, not a copy of it so you don't need to refresh it. To make a copy of an array use +: newArr = +existingArr Share this post Link to post Share on other sites
Bandicoot 0 Posted May 23, 2007 1. Name trigger someTrig2. Access it from a script: _l = list someTrig #check ~5 ?count _l<1: hint "Not detected."; goto "check" hint "Detected!" goto "check" Thanks guys, one less trigger in this one. Regards Bandicoot Share this post Link to post Share on other sites