combat-agent 0 Posted December 20, 2005 Alright, Im making a misison using the COC CE. The player controls a platoon and is supposed to save as many civilians from the zombies on the main land via helicopter and M113. Problem #1 there are approxmatley 31 groups with a minimum of nine units per group, that needed to be targeted by the zombies (unified zombie addon v3). The zombie targeting system is extremely slow do to the excessive amount of available targets. what is a way to keep the 31 groups, and make the zombies target fast(er)? Problem #2 All 31 groups are west units. 20 of the groups are civilians (defined on west side). When one of the players 11 groups enters a 50 meter radius, I want them to be added to the Chain of Command. Problem: how do i make a trigger that uses a array of units instead of a singlular unit? I want to do something like this... ARMYUNITS = Units squad1 + Units SQUAD2... all the way to squad 11 Then i want the same effects as what this would do, although its not a real command... Condition: Units Armyunits distance squad12 <= 50 Those are my current problems, which i am currently unable to solve. I appreciate any help. Thanks CA Share this post Link to post Share on other sites
Trapper 0 Posted December 20, 2005 Creating a large scale ZOS? #1 Only use the leaders as targets, and update the targets after one has died. Depbo ZOS and have a look at the scripts. #2 I suggest slower script loops instead of a triggers. armyunits = Units squad1 + Units SQUAD2... all the way to squad 11<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #l1 {if (_x distance squad12 <= 50) then {goto "c"}} foreach armyunits ~2 goto "l1" #c add squad12 to coc now Share this post Link to post Share on other sites
combat-agent 0 Posted December 21, 2005 I appreciate the reply. I never was good with fricken variables and arrays. But, Im having problems with both of your suggestions. #1 How would you suggest to add and update the glballtargets array? I used <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop ~5 glballtargets = [leader squad1, leader squad2, Â leader squad3, leader squad4, leader squad5, leader squad6, leader squad7, leader squad8, leader squad9, leader squad10, leader squad11, leader squad12, leader squad13, leader squad14, leader squad15, leader squad16, leader squad17, leader squad18, leader squad19, leader squad20, leader squad21, Â leader squad22, leader squad23, leader squad24, leader squad25, leader squad26, leader squad27, leader squad28, leader squad29, leader squad30, leader squad31] goto "loop" but it didnt seem to work. #2 I coulnt even tell if the suggest script worked because for some reason, it drove ECP and COC ape shit. I havnt the slightest idea why, but all sort of wonderful little error messages appeared once I executed the script. Heres how I used your suggestion. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#l1 count = 0 ? count = 20: exit ? {if (_x distance leader squad12 <= 50) then {goto "1"}} foreach armyunits ? {if (_x distance leader squad13 <= 50) then {goto "2"}} foreach armyunits ? {if (_x distance leader squad14 <= 50) then {goto "3"}} foreach armyunits ? {if (_x distance leader squad15 <= 50) then {goto "4"}} foreach armyunits ? {if (_x distance leader squad16 <= 50) then {goto "5"}} foreach armyunits <<through 20>> ~2 goto "l1" #1 ["ADD_GROUP", 11, 3] exec "groupmanagement\platoonorders.sqs" count = count + 1 goto "l1" #2 ["ADD_GROUP", 12, 3] exec "groupmanagement\platoonorders.sqs" count = count + 1 goto "l1" #3 ["ADD_GROUP", 13, 3] exec "groupmanagement\platoonorders.sqs" count = count + 1 goto "l1" #4 ["ADD_GROUP", 14, 3] exec "groupmanagement\platoonorders.sqs" count = count + 1 goto "l1" #5 ["ADD_GROUP", 15, 3] exec "groupmanagement\platoonorders.sqs" count = count + 1 goto "l1" <<through 20>> Thanks in Advance CA Share this post Link to post Share on other sites
Trapper 0 Posted December 21, 2005 #1 A very simple solution, it should work in theory. What you'll notice with so many units is, that it takes up to minutes until dead group members/leaders are recognized by OFP. Maybe that's what makes this script look like it isn't working. Read the Unified Zombie Mod FAQ in this forum for more infos. gblAllTargets is an array which can always be altered by the editor, but also dead targets are removed automaticly. Proper ways to change arrays are found in the comref. I also wrote something about this on the last Page of the Zombie FAQ. My more complicated approach in ZOS is:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _group = _this #loop1 _leader = (leader _group) if !(_leader in addedToGAT) then {gblAllTargets = gblAllTargets + [_leader]; addedToGAT = addedToGAT + [_leader] if ((count units _group) == 0) then {exit} ~2 goto "loop1"Additional you need to initalize addedToGAT = [] in your mission, then execute this script with every group. It'll be best if you initalize an array with all group names, too. (ie civgroups) {_x exec "script.sqs"} foreach civgroups What happens then is that every leader is added to both arrays. The second array checks if the leader was already added to make sure it happens only once. After his death a new guy becomes leader and will be added once to the targets because he isn't found in the check array at first. (Remeber the dead leader is removed automatically from gblAllTargets) And in your init.sqs (or whereever) you only initalize the easy and stable targets. (player and the army) #2 Oh yes, at least one error message was caused by "squadx", the distance to a group can't be meassured by ofp. My bad. I would create one small script and run it for all groups.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _group = _this #l1 ? {if (_x distance leader _group <= 50) then {goto "1"}} foreach armyunits ~2 goto "l1" #1 if (_group == squad11) then {["ADD_GROUP", 11, 3] exec "groupmanagement\platoonorders.sqs"} if (_group == squad12) then {["ADD_GROUP", 12, 3] exec "groupmanagement\platoonorders.sqs"} if (_group == squad13) then {["ADD_GROUP", 13, 3] exec "groupmanagement\platoonorders.sqs"} . . . exit Again: {_x exec "script.sqs"} foreach civgroups No gurantee for the squad names/numbers. Share this post Link to post Share on other sites