matte54 10 Posted October 14, 2013 Im trying to make a (enemy) high alltitude patroling UAV to spot enemy forces that respawns after killed. and im having hell trying to find figure out how to spawn a UAV and put a crew in it and still have the vehicle variable and have them all in a group. Have tried bis_fnc_spawnvehicle wich seemed like the logical choice but uav instantly crashes wich dosent seem to get any crew (even if i have an enemy unit already on the map). Have tried just to spawn the uav at alltitude and then just createunit 2 crew or helipilots to moveindriver and gunner , uav still instantly crashes. Looked thru the cfgvehicles to get a hint of what controls it, seems like there is something called "O_UAV_AI" tried spawning it and adding it as a driver, no dice. The only thing that works and adds a crew and makes the uav fly is createVehicleCrew, but i cant really figure out how to make the crew into a group for later use in the script. Help anyone? Share this post Link to post Share on other sites
Varanon 892 Posted October 14, 2013 The UAV can be created with createVehicle, and the crew added with addVehcileCrew: _pos = [getMarkerPos "spawnpoint" select 0, getMarkerPost "spawnpoint" select 1, 200]; _uav = [b]createVehicle[/b] [i]["[/i]B_UAV_02_F"[i], _pos, [], 0, "FLY"]; createVehcileCrew _uaw; [/i] I don't think the crew can be grouped, though. Share this post Link to post Share on other sites
matte54 10 Posted October 14, 2013 (edited) I don't think the crew can be grouped, though. That's the main thing i want to do here. I can't see how i can make a vehicle follow a waypoint without adding it to a group i can control. After 4 hours of medling i finaly managed to solve my own problem. posting the code if anyones intrested. _uav = "O_UAV_02_F" createVehicle [_trueStart select 0,_trueStart select 1,600]; waitUntil{!isNull _uav}; createVehicleCrew _uav; {[_x] joinSilent _uavGroup} forEach units _uav; Edited October 14, 2013 by Matte54 Share this post Link to post Share on other sites
Varanon 892 Posted October 15, 2013 I can't see how i can make a vehicle follow a waypoint without adding it to a group i can control. Couldn't you take the uav crew's group directly ? I don't think any unit can exist without being in a group of it's own to begin with, so if you createVehicleCrew, it should have a crew to begin with ? so _grp = group _uav; _grp addWaypoint [getMarkerPos "markTarget", 0]; allows you to set a waypoint. No need to create another group. Even joining that group works (with the player, for example) Share this post Link to post Share on other sites