Pappy60 10 Posted September 28, 2009 I am trying to setup a ai extraction with a player pilot, it works fine when I assignascargo for a specific helo but I don't know which helo will go for them. How can I specify triggername thisList instead of a helo name for assignascargo? I put this in one of the units init and it works: { _x assignascargo Jolly61 } foreach units group this but this fails { _x assignascargo (Jolly61 or Jolly62) } foreach units group this I need something like this instead of helo name but I am bit lost.... { _x assignascargo (triggername thisList) } foreach units group this Share this post Link to post Share on other sites
kylania 568 Posted September 28, 2009 { _x assignascargo vehicle player } foreach units group this maybe? Is this a single player or multiplayer mission? If it's single player, why is there more than one helo? If it's multiplayer, why are players picking up AI via trigger? Shouldn't the player just tell his AI to get in? If it's not his AI... well, we're back to why again. :) Share this post Link to post Share on other sites
Pappy60 10 Posted September 28, 2009 Let me clarify, it is MP and its an extraction training mission, player goes to LZ of extraction area, ai pops smoke, player must land in tight hot LZ and AI will board helo automatically. Since it is mp and we do have multiple choppers, there will be 2 transport helos that can be used for this mission. So the AI must automatically board regardless of which of the 2 helos arrives (fires trigger at lz) Make a bit more sense now? ---------- Post added at 03:27 PM ---------- Previous post was at 03:24 PM ---------- a bit more, player must use either Jolly61 or Jolly62 for the task, but there are other helos that will not fire the trigger. I will try the "vehicle player" and see what happens.... Share this post Link to post Share on other sites
kylania 568 Posted September 28, 2009 Since it's training the easiest method is simply declare that Jolly61 is the extract helo, test for it's presence and initiate the whole extraction thing. Short of that, if you really wanted to get into the complexity of making this work with any vehicle, test for a vehicle entering the trigger area, make sure it's a helo then have the AI board that I guess? Share this post Link to post Share on other sites
Pappy60 10 Posted September 28, 2009 Yes, right now I have the trigger set to only fire for Jolly61 or Jolly62 , the ai have a getin waypoint that is synced to the trigger, this all works well on the trigger side of things. The issue is getting the ai assignedascargo to either of the 2 helos instead of only one. ---------- Post added at 03:31 PM ---------- Previous post was at 03:29 PM ---------- I am currently using the fireteam leader init to assignascargo...now I am wondering if I can use the trigger to perform the assignascargo using thisList ? Share this post Link to post Share on other sites
Bon 12 Posted September 28, 2009 Call a script out of the init line of one of the to extracting units, which could look like this: if(not isServer) exitWith{}; _unit = _this; _helis = []; while{count _helis == 0} do{ _helis = nearestObjects[_unit,["MH60S","UH1Y","whatever choppers u use"],100]; sleep 3; }; { _x assignascargo (_helis select 0); [_x] orderGetIn true; } foreach units group _unit; Didn't try it out yet, just written out-of-the-fingers, but I think the idea is clear. Share this post Link to post Share on other sites
Pappy60 10 Posted September 28, 2009 I will try that approach but it seems like it should be easier and I am just not thinking correctly... Share this post Link to post Share on other sites
Pappy60 10 Posted September 28, 2009 Okay so I tried a trigger version that is working in SP, hav'nt tested it in MP yet . It works but is a bit convoluted .... I gave each member of the ai unit their own name, razor2 razor3 etc. Then my LZ trigger is this : Cond: ((vehicle Jolly61 in thisList) or (vehicle jolly61 in thisList)) Activation: razor2 assignascargo vehicle (thisList select 0); razor3 assignascargo vehicle (thisList select 0); razor4 assignascargo vehicle (thisList select 0); razor5 assignascargo vehicle (thisList select 0); Now when either helo arrives and fires the trigger, the ai come and enter the helo... It would be easier to do it as a group, but I could not seem to figure out how to code it for a group instead of individuals. Now I need to figure out how to tell the pilot that all ai is onboard .... Share this post Link to post Share on other sites
shuko 59 Posted September 28, 2009 {_x assignascargo (thislist select 0)} foreach units (group razor1orWhatEverTheLeadersNameIs); Share this post Link to post Share on other sites
Pappy60 10 Posted September 28, 2009 shk you rock ! Thank you! ---------- Post added at 07:31 PM ---------- Previous post was at 07:23 PM ---------- Hmmm, something not quite right... I have this and the editor is rejecting but not giving me a reason: {_x assignascargo (thisList select 0) } foreach units (group razor2); ---------- Post added at 07:34 PM ---------- Previous post was at 07:31 PM ---------- My bad, forgot to init the group first :) ---------- Post added at 07:42 PM ---------- Previous post was at 07:34 PM ---------- Sadly that is not working, the ai just come to the getin waypoint and stand there..... Share this post Link to post Share on other sites
franze 196 Posted September 28, 2009 (edited) You need to grab your infantry group and your helicopter dynamically. There's several ways to do this; the most simple one would be to have a looping script that checks for the nearest helicopter to the group leader, then assign each soldier in the group to it. If you have static helis (that is, you don't use createvehicle) and groups, you can do this: _grouplead = leader mygroup; while {(alive heli1) && (alive heli2) && !((_grouplead in heli1) || (_grouplead in heli2))} do { _grouplead = leader mygroup; _myhelis = nearestObjects [_grouplead, ["MH60S","UH1Y"], 100]; { if (count _myhelis > 0) then { _x assignascargo (_myhelis select 0); [_x] ordergetin true; }; } foreach units _grouplead; sleep 1; }; _groupveh = vehicle _grouplead; (group (driver _groupveh)) addwaypoint [[0,0,0],5]; EDIT: Adding a waypoint to the helicopter's WP list works better than domove. :) Edited September 28, 2009 by Franze Share this post Link to post Share on other sites
shuko 59 Posted September 28, 2009 razor2 is the unit name not group name, if you use razor2 as group name do: {_x assignascargo (thisList select 0) } foreach units razor2; Share this post Link to post Share on other sites
Pappy60 10 Posted September 28, 2009 Thanks to both, I will learn this :) , got past the assignascargo , ai is popping smoke but is way too little smoke, can barely see it from the air...time to starting searching smoke posts :) thanks guys Share this post Link to post Share on other sites