Luk 0 Posted January 25, 2004 In some area under a normal trigger that is checking if there are any live civilians I have placed some civilians. Objectiv is to kill them. But when there is some empty vehicle in the area the trigger doesn't goes off. I know that i just could give thoes civilians some names and check if they are alive by the names, but i wanted them to appear randomly and set the "probability of presence bar" (or what ever it is called in english) on 50% and the "name way" does not work with this. So is this normal that the trigger thinks that the empty vehicle is a live civilian? Is there some other way to indicate if they are all dead? Thanks for any help... Share this post Link to post Share on other sites
Bart.Jan 0 Posted January 25, 2004 Try to change condition of that trigger to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(count thislist) - ("car" counttype thislist) <= 0 Share this post Link to post Share on other sites
Luk 0 Posted January 25, 2004 Hmm... i gues not, this is a multiplayer mission there is quite a lot of vehicles, and any one just can drive in there get out of car/heli, kill em all and the objecive still gona be undone. Share this post Link to post Share on other sites
TheMcDeth 0 Posted January 26, 2004 Trigger with activation "civilian not present" does not work? Strange... Anyway you can name the units and make an array of the names. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> (?!local server):exit #loop _units=[c1,c2...cn] ~10 _i=0 "if (alive _x) then {_i = _i + 1}" foreach _units ?_i > 0 : goto "loop" var=1 publicvariable "var1" exit This script is run only on server. So add gamelogic and name it "server" and run this script from init.sqs. Then add a trigger to check the status of var1 and execute whatever you want. It does not matter if some of the units in the _units array are there or not. It will work anyway. Share this post Link to post Share on other sites
Bart.Jan 0 Posted January 26, 2004 Hmm... i gues not, this is a multiplayer mission there is quite a lot of vehicles, and any one just can drive in there get out of car/heli, kill em all and the objecive still gona be undone. Why not? Try it. It works in SP. I can't see why it shoud not work in MP. All the cars are simply excluded from the list of civilan units presented inside the trigger area (the trigger must be activated by civilians). Another way is to "name" all civilan units automatically on the start of mission via trigger and then check their status: trigger activated by civilians present repeatly and named trig1, on activation field: [thislist] exec "check.sqs" check.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~1 _array=+_this select 0 deletevehicle trig1 _i=count _array _a=[] #loop1 ~0.1 _i=_i-1 _x=_array select _i ?"man" counttype [_x]==0:_a=_a+[_x] ?_i>0:goto "loop1" _array=_array-_a _a=nil #check ~5 ?{alive _x} count _array >0:goto "check" hint "cleared" Change this script to MP (local things etc.) Or there is problem that civilians can be in their cars and can drive in and out of the area? Share this post Link to post Share on other sites
Luk 0 Posted January 26, 2004 Ok I think I'll just reduce the number of vehicles in the mission and use the first method. But I'm not too good in scripting, will it work if i just write all the vehicles names in the quotes, where in your example was "car" so it would be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(count thislist) - ("car,truck,car2,car3" counttype thislist) <= 0 Â ? Thanks for your help! Share this post Link to post Share on other sites
Bart.Jan 0 Posted January 26, 2004 Ok I think I'll just reduce the number of vehicles in the mission and use the first method.But I'm not too good in scripting, will it work if i just write all the vehicles names in the quotes, where in your example was "car" so it would be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(count thislist) - ("car,truck,car2,car3" counttype thislist) <= 0 Â ?Thanks for your help! It's not necessary to reduce the number of vehicles because <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(count thislist) - ("car" countType thislist) <= 0 is the entire condition you need. "car" is not substitute for anything. Simply put that line into the condition field of the trigger and it will be ignoring any cars in its area. But if there can be even other types of vehicles in the area (helis, armor) use rather this condition: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"man" countType thislist == 0 It's shorter but it has the same efect. It counts only human civilians in the area. And again it's the whole condition. The trigger must be activated by civilans. Share this post Link to post Share on other sites
TKorho 0 Posted January 26, 2004 I had this same condition but even worse: any "empty" class object (like barrels) were considered civilians. And I had to have the end condition that some civilians were attending a meeting with... erm, barrels (believe me, there is a storyline here). It was kind of tricky to get the end condition to not explode before time. :-/ Share this post Link to post Share on other sites