Nutzgo 15 Posted October 17, 2018 I have a trigger in a mission that when activated, spawns 6 UGVs at a specified location on the map using markers (UGV1, UGV2 and so on). The problem is, when they've spawned, I can't use them, can't connect to them with at UAV terminal. I've learned that the UGV needs an assigned crew for this to work, but I don't know how to do this. I've tried the following: Trigger 1, spawns the UGVs: _vehicleObject = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv1");_vehicleObject setPos getMarkerPos "ugv1";_vehicleObject setDir 205.552; _vehicleObject = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv2");_vehicleObject setPos getMarkerPos "ugv2";_vehicleObject setDir 205.552; _vehicleObject = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv3");_vehicleObject setPos getMarkerPos "ugv3";_vehicleObject setDir 205.552; _vehicleObject = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv4");_vehicleObject setPos getMarkerPos "ugv4";_vehicleObject setDir 205.552; _vehicleObject = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv5");_vehicleObject setPos getMarkerPos "ugv5";_vehicleObject setDir 205.552; _vehicleObject = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv6");_vehicleObject setPos getMarkerPos "ugv6";_vehicleObject setDir 205.552; Trigger 2, intended to spawn the crew, calls a script I've placed in the mission file called "uav.sqf": _uav = ["B_UGV_01_rcws_F"]; if (typeOf _vehicle in _uav) then { createVehicleCrew _vehicle; { diag_log [_x, faction _x, side _x, side group _x]; } forEach crew _vehicle; }; The problem is, when the trigger fires, I get this error message: Quote '... _uav = ["B_UGV_01_rcws_F"]; if (typeOf _vehicle in _uav) then { createVehicleCr...' Error Undefined variable in expression: _vehicle What have I done wrong? Share this post Link to post Share on other sites
stanhope 411 Posted October 17, 2018 Change your first trigger to: UAV1 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv1");UAV1 setPos getMarkerPos "ugv1";UAV1 setDir 205.552; UAV2 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv2");UAV2 setPos getMarkerPos "ugv2";UAV2 setDir 205.552; UAV3 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv3");UAV3 setPos getMarkerPos "ugv3";UAV3 setDir 205.552; UAV4 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv4");UAV4 setPos getMarkerPos "ugv4";UAV4 setDir 205.552; UAV5 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv5");UAV5 setPos getMarkerPos "ugv5";UAV5 setDir 205.552; UAV6 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv6");UAV6 setPos getMarkerPos "ugv6";UAV6 setDir 205.552; And your second trigger to: private _logFunc = { { diag_log [_x, faction _x, side _x, side group _x]; } forEach (crew (_this select 0)) }; { createVehicleCrew _x; [_x] call _logFunc; } forEach [UAV1, UAV2, UAV3, UAV5, UAV6]; EDIT: forgot to mention: untested 1 Share this post Link to post Share on other sites
Nutzgo 15 Posted October 17, 2018 Cheers, I'll try it! Share this post Link to post Share on other sites
Siil 2 Posted October 17, 2018 I have the same problem. Trying to spawn a UAV. _type = "B_UAV_02_F"; uav = createVehicle [_type, position uavlog, [],0,"fly"]; createVehicleCrew uav; I can't connect to the spawned UAV and after spawning the UAV I also can't connect to any other UAVs placed in the editor. The log function posted by stanhope returns as follows: 16:32:07 [B Alpha 2-4:1,"BLU_F",WEST,WEST] 16:32:07 [B Alpha 2-4:2,"BLU_F",WEST,WEST] Share this post Link to post Share on other sites
lexx 1391 Posted October 17, 2018 8 minutes ago, Siil said: I also can't connect to any other UAVs placed in the editor. You sure you got the UAV terminal in your inventory? Also you can only connect to UAVs of your own faction. Share this post Link to post Share on other sites
Siil 2 Posted October 17, 2018 3 minutes ago, lexx said: You sure you got the UAV terminal in your inventory? Also you can only connect to UAVs of your own faction. Yes, I have the correct faction terminal. I can connect to editor placed UAVs correctly but after I spawn a UAV by Radio Alpha, all UAVs dissapear from the terminal menu. Share this post Link to post Share on other sites
stanhope 411 Posted October 17, 2018 4 hours ago, Siil said: I have the same problem. Trying to spawn a UAV. _type = "B_UAV_02_F"; uav = createVehicle [_type, position uavlog, [],0,"fly"]; createVehicleCrew uav; I can't connect to the spawned UAV and after spawning the UAV I also can't connect to any other UAVs placed in the editor. The log function posted by stanhope returns as follows: 16:32:07 [B Alpha 2-4:1,"BLU_F",WEST,WEST] 16:32:07 [B Alpha 2-4:2,"BLU_F",WEST,WEST] Not my log function. Code I took from OP and put into a separate function to not have to nest forEach loops. Share this post Link to post Share on other sites
Siil 2 Posted October 17, 2018 My problem was caused by player setcaptive true You can still connect with drones while setcaptive true if you right click on the map UAV marker. Share this post Link to post Share on other sites
Nutzgo 15 Posted October 17, 2018 8 hours ago, stanhope said: Change your first trigger to: UAV1 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv1");UAV1 setPos getMarkerPos "ugv1";UAV1 setDir 205.552; UAV2 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv2");UAV2 setPos getMarkerPos "ugv2";UAV2 setDir 205.552; UAV3 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv3");UAV3 setPos getMarkerPos "ugv3";UAV3 setDir 205.552; UAV4 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv4");UAV4 setPos getMarkerPos "ugv4";UAV4 setDir 205.552; UAV5 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv5");UAV5 setPos getMarkerPos "ugv5";UAV5 setDir 205.552; UAV6 = "B_UGV_01_rcws_F" createVehicle (getMarkerPos "ugv6");UAV6 setPos getMarkerPos "ugv6";UAV6 setDir 205.552; And your second trigger to: private _logFunc = { { diag_log [_x, faction _x, side _x, side group _x]; } forEach (crew (_this select 0)) }; { createVehicleCrew _x; [_x] call _logFunc; } forEach [UAV1, UAV2, UAV3, UAV5, UAV6]; EDIT: forgot to mention: untested This did the trick. Thanks! 1 Share this post Link to post Share on other sites
Nutzgo 15 Posted October 22, 2018 New problem happened here. When trigger is fired, it seems to multiply per player connected to server. Sorry for bad english. This is what happens: When I play alone on the server, 6 UGVs spawns according to trigger. When I play with 1 other guy on my server, 12 UGV spawns With 2 other guys, 18 UGV spawns and so on. Why?? Share this post Link to post Share on other sites
pierremgi 4905 Posted October 22, 2018 Make it server only. createVehicle is a global effect command ( ). 1 Share this post Link to post Share on other sites