UAV Connection

UAV Connection

« posted: Aug 15, 2016, 03:08 PM »
We just released 2 new missions. But they do not work as wanted.

Here's the mission picture ..


There's an equal mission, called CAS Bandit. We think, it's one of the only missions of this kind. Cause both factions (yes, we offer only BLUFOR & Indy) do not fight for the same goal at these missions.

CAS Gendarmerie: Blufor tries to get the UAV, Indy (Bandits) try to prevent.
CAS Bandits: Indys try to complete, but now Blufor has to prevent this.

Because: Blufor has only use for Greyhawk and Bandits only for the Ababil. After completing the mission, a box drops by parachute. There in an UAV Terminal, fitting to Indy or Blufor UAV.

And here's the problem: the player cannot connect after equipped with UAV Terminal.

When bought in Vehicle Store, everythings fine.

The code of the shown mission:

Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.0
// @file Name: mission_CASGendar.sqf
// @file Author: [404] Deadbeat, [404] Costlyy, AgentRev
// @file Created: 08/12/2012 15:19
// @file Tanoa Edition: GriffinZS

if (!isServer) exitwith {};
#include "specialMissionDefines.sqf"

private ["_nbUnits", "_vehicleClass", "_vehicle", "_randomBox", "_randomCase", "_box1", "_para", "_geoPos"];

_setupVars =
{
_missionType = "CAS Gendarmerie";
_locationsArray = MissionSpawnMarkers;
_nbUnits = if (missionDifficultyHard) then { AI_GROUP_LARGE } else { AI_GROUP_MEDIUM };
};

_setupObjects =
{
_missionPos = markerPos _missionLocation;
_geoPos = _missionPos vectorAdd ([[25 + random 20, 0, 0], random 360] call BIS_fnc_rotateVector2D);

_vehicleClass =
[
"B_UAV_02_F",
"B_UAV_02_CAS_F"
] call BIS_fnc_selectRandom;

// Class, Position, Fuel, Ammo, Damage, Special
_vehicle = [_vehicleClass, _missionPos] call createMissionVehicle;
_vehicle call fn_refilltruck;

_aiGroup = createGroup CIVILIAN;
[_aiGroup, _missionPos, _nbUnits] call createCustomGroup;

_missionPicture = getText (configFile >> "CfgVehicles" >> _vehicleClass >> "picture");
_vehicleName = getText (configFile >> "CfgVehicles" >> _vehicleClass >> "displayName");

_missionHintText = format ["<br/>The Gendarmerie has the chance to get <t color='%2'>%1</t>! Only condition: kill the guards and await the paradrop!<br/><t color='%2'>Bandits! Prevent the Gendarmerie to get this vehicle!!</t><br/> Destroy it or kill any approaching Gendarme!", _vehicleName, specialMissionColor];
};

_waitUntilMarkerPos = nil;
_waitUntilExec = nil;
_waitUntilCondition = {!alive _vehicle};

_failedExec =
{
// Mission failed
deleteVehicle _vehicle;
_failedHintMessage = format ["<br/>The Greyhawk has been destroyed .."];
};

_successExec =
{
// Mission completed
_vehicle lock 1;
_vehicle setVariable ["R3F_LOG_disabled", false, true];

_randomBox = ["mission_USLaunchers","mission_USSpecial","mission_Main_A3snipers"] call BIS_fnc_selectRandom;
_randomCase = ["Box_FIA_Support_F","Box_FIA_Wps_F","Box_FIA_Ammo_F","Box_NATO_WpsSpecial_F","Box_East_WpsSpecial_F","Box_NATO_Ammo_F","Box_East_Ammo_F"] call BIS_fnc_selectRandom;

_box1 = createVehicle [_randomCase,[(_geoPos select 0), (_geoPos select 1),200],[], 0, "NONE"];
_box1 setDir random 360;
_box1 addItemCargoGlobal ["B_UavTerminal",1];
_box1 allowdamage false;
{ _x setVariable ["R3F_LOG_disabled", false, true] } forEach [_box1];

playSound3D ["A3\data_f_curator\sound\cfgsounds\air_raid.wss", _box1, false, _box1, 15, 1, 1500];

_para = createVehicle [format ["I_parachute_02_F"], [0,0,999999], [], 0, ""];

_para setDir getDir _box1;
_para setPosATL getPosATL _box1;

_para attachTo [_box1, [0, 0, 0]];
uiSleep 2;

detach _para;
_box1 attachTo [_para, [0, 0, 0]];

while {(getPos _box1) select 2 > 3 && attachedTo _box1 == _para} do
{
_para setVectorUp [0,0,1];
_para setVelocity [0, 0, (velocity _para) select 2];
uiSleep 0.1;
};

_successHintMessage = "The guards of the Greyhawk has been eliminated.<br/>Gendarmerie, are you there!?";
};

_this call specialMissionProcessor;

Please correct me: is it right, only NATO Terminals can connect to Greyhawks and only Blufor Player can equip NATO Terminals?
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2490

Re: UAV Connection

« Reply #1 posted: Aug 15, 2016, 06:15 PM »
Anyone can equip and use any terminal, it is merely cosmetic. You can only connect to a UAV containing friendly AI gnomes. A Greyhawk contains Blufor AI by default so only other Blufor units can connect to it. The store script changes the AI side using "joinSilent" to match the player's before connection.

Re: UAV Connection

« Reply #2 posted: Aug 15, 2016, 07:07 PM »
Hmm .. okay.

Is there a way to "fix" this in this mission, so Blu can connect this captured Greyhawk? (and Bandits the Abi)

Code: [Select]
[_unitOne, _unitTwo] joinSilent player;
With this? So only the player, who completed the mission, can connect (and if he's the same faction)?

*headscratch
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2490

Re: UAV Connection

« Reply #3 posted: Aug 15, 2016, 07:20 PM »
oh uh you need to call createVehicleCrew on mission success, UAVs cannot fly without gnomes.

Re: UAV Connection

« Reply #4 posted: Aug 15, 2016, 07:31 PM »
Like this?

Code: [Select]
// Class, Position, Fuel, Ammo, Damage, Special
_vehicle = [_vehicleClass, _missionPos] call createMissionVehicle;
_vehicle call fn_refilltruck;
        _vehicle = createVehicle ["B_UAV_02_F", position player, [], 0, "NONE"];
        createVehicleCrew _vehicle;
{
diag_log [_x, faction _x, side _x, side group _x];
} forEach crew _vehicle;

I can reduce the vehicle to only one, so theres no random anymore.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2490

Re: UAV Connection

« Reply #5 posted: Aug 15, 2016, 07:51 PM »
I said on success.

Re: UAV Connection

« Reply #6 posted: Aug 15, 2016, 07:53 PM »
*harrumph

Code: [Select]
// Mission completed
_vehicle lock 1;
_vehicle setVariable ["R3F_LOG_disabled", false, true];
        _vehicle = createVehicle ["B_UAV_02_F", position player, [], 0, "NONE"];
        createVehicleCrew _vehicle;
{
diag_log [_x, faction _x, side _x, side group _x];
} forEach crew _vehicle;

 ::)?

solved

we just edited the mission. now u get an uav terminal in the box (and not available in genstore anymore) and the Greyhawk disappears, when completed.  8)