Ice_Rhino 3 Posted September 19, 2014 I am creating a mission where at the beginning there is up to 5 lookouts. These lookouts are named opf_lookout_1 to _5. Two of these have the Probability of 50% of being present at mission start. I have a trigger that contains the following condition !alive opf_lookout_1 && !alive opf_lookout_2 && !alive opf_lookout_3 && !alive opf_lookout_4 && !alive opf_lookout_5 However, When I kill all present, the trigger does not fire the hint message that I have. Is this something to do with the ones that do not spawn? Any assistance appreciated as always Toni Ice Rhino Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 19, 2014 (edited) However, When I kill all present, the trigger does not fire the hint message that I have. Is this something to do with the ones that do not spawn? I haven't tried it, but it may be as "alive someUnit" may not work if someUnit is undefined. So what you could do for these two units is initialize them as "ofp_lookout_... = objNull" and formulate your condition like this: ... && {isNull opf_lookout_1 || {!alive opf_lookout_1}} && ... That way, the condition returns true if the unit is undefined OR if it is dead. Edited September 19, 2014 by waltenberg Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 19, 2014 Hi W, What is the syntax I need for "ofp_lookout_... = objNull" part Thanks for your help so far Toni IR ---------- Post added at 16:27 ---------- Previous post was at 16:25 ---------- Oh I think I know what you mean. I will try it Thanks IR Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 19, 2014 OK. Let us know if it worked and if not, what the issue is. Share this post Link to post Share on other sites
Larrow 2794 Posted September 19, 2014 { !isNil {_x} && {!alive _x} }count [opf_lookout_1, opf_lookout_2, opf_lookout_3, opf_lookout_4, opf_lookout_5] == { !isNil {_x} }count [opf_lookout_1, opf_lookout_2, opf_lookout_3, opf_lookout_4, opf_lookout_5] count how many exist and are dead == how many exist isNil checks whether the variable exist, if one of the lookouts has not spawned then the variable will be Nil. The {} around alive make sure alive is not checked if the variable is Nil, otherwise it would throw an error. Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 19, 2014 I have this in the init field for the 2 maybe present units. Units in question are named opf_lookout_4 & _5; this setCaptive true; this addWeapon "Binocular"; this setCombatMode "BLUE"; this disableAI "ANIM"; 0 = this spawn {waitUntil {time > 0}; _this switchMove "AmovPknlMstpSoptWbinDnon"};opf_lookout_4 = objNull; this setCaptive true; this addWeapon "Binocular"; this setCombatMode "BLUE"; this disableAI "ANIM"; 0 = this spawn {waitUntil {time > 0}; _this switchMove "AmovPknlMstpSoptWbinDnon"};opf_lookout_5 = objNull; I then have in the trigger; !alive opf_lookout_1 && !alive opf_lookout_2 && !alive opf_lookout_3 && {isNull opf_lookout_4 || {!alive opf_lookout_4}} && {isNull opf_lookout_5 || {!alive opf_lookout_5}} However, it does not fire the hint when the three static and if present optionals are dead or not present Any Ideas? Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 19, 2014 Start you ArmA 3 with the startup parameter "-showScriptErrors" and run your script again. If you see a box popping up on the top half of your screen, make a screenshot and post it here OR go into ArmA 3 folder somewhere at "C:\Users\[yourName]\AppData\Local\Arma3" (I guess, not at my PC atm) and open the latest "...RPT" file, which is the logfile. Scroll to the bottom until you read something like "error at position..." and copy paste the lines, so we can see the errors if there are some. Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 19, 2014 I will do that right now and report back Thanks T IR Share this post Link to post Share on other sites
2nd ranger 282 Posted September 19, 2014 Larrow's solution works, did you try it? Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 19, 2014 Started it up with the scripts switch on load of ARMA 3. Loaded the editor, loaded mission, ran mission, killed all visible that relevant to the script but there was nothing was displayed and nothing appeared in the .RPT file anywhere that I could tell. What now? ---------- Post added at 18:36 ---------- Previous post was at 18:35 ---------- I am going to try Larrow's suggestion now ---------- Post added at 18:37 ---------- Previous post was at 18:36 ---------- In the trigger I guess I put this code?? Share this post Link to post Share on other sites
2nd ranger 282 Posted September 19, 2014 (edited) Larrow, where do I put this PHP code? It's a trigger condition. Edited September 19, 2014 by 2nd Ranger Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 19, 2014 (edited) Thanks Larrow, that seems to work now Again, thanks to all T IR Edited September 19, 2014 by Ice_Rhino Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 19, 2014 Oooh, please don't tell me, the only reason my first suggestion does not work, was the "isNull" which would have had to be an "isNil"? XD Share this post Link to post Share on other sites