Finished sling loaded delivery (not much error checking nthat)

This commit is contained in:
Benjamin Kyd
2019-05-11 00:04:15 +01:00
parent ac8af0fc77
commit 8f74765114
7 changed files with 405 additions and 46 deletions

View File

@@ -0,0 +1,51 @@
/**
* Copyright© Benjamin Kyd 2019
* fn_endDelivery.sqf
*
* Does some checks and ends the delivery part of the mission.
*/
// Will always be passed so no need for defaults
params [
["_target", objNull, [objNull]],
["_caller", objNull, [objNull]],
["_id", 0, [0]],
["_args", [], [[]]]
];
if (!gMissionStarted) exitWith { };
private _closeObjects = nearestObjects [_target, [], 50];
if (!(gMissionDelivery in _closeObjects)) exitWith { };
// private _isFound = false;
// {
// if (_x isEqualTo gMissionDelivery) then {
// _isFound = true;
// }
// } forEach _closeObjects;
// if (!_isFound) exitWith { };
deleteVehicle gMissionDelivery;
["RR_Delivery_Task", "SUCCEEDED"] call BIS_fnc_taskSetState;
// Discustingly hardcoded coordinate for spawm again
[
player, "RR_Return_Task",
["Return helicopter too base", "Return Heli", "Deliver Here"],
[10085.967, 12044.893, 0.00141716], "ASSIGNED", 1,
true, "ASSIGNED", true
] call BIS_fnc_taskCreate;
// Remove map markers
deleteMarkerLocal "RR_Delivery_Radius";
deleteMarkerLocal "RR_Delivery_Point";
gMissionCompleted = true;
hint "Congradulations, you have delivered the package, now return the helicopter to recive your payment!";

View File

@@ -0,0 +1,42 @@
/**
* Copyright© Benjamin Kyd 2019
* fn_endDelivery.sqf
*
* Ends mission with delivery of helicopter
*/
// Will always be passed so no need for defaults
params [
["_target", objNull, [objNull]],
["_caller", objNull, [objNull]],
["_id", 0, [0]],
["_args", [], [[]]]
];
if (!gMissionStarted) exitWith { };
if (!gMissionCompleted) exitWith { };
private _closeObjects = nearestObjects [_target, [], 50];
if (!(gMissionHeli in _closeObjects)) exitWith { };
// private _isFound = false;
// {
// if (_x isEqualTo gMissionHeli) then {
// _isFound = true;
// }
// } forEach _closeObjects;
//
// if (!_isFound) exitWith { };
deleteVehicle gMissionHeli;
["RR_Return_Task", "SUCCEEDED"] call BIS_fnc_taskSetState;
hint "You have recieved £xxx for your services";
gMissionStarted = false;
gMissionCompleted = false;

View File

@@ -7,33 +7,22 @@
* TODO: Make it actually random and _only_ available to spawn on land
*/
private _numItems = 22; // Number of elements in _deliveryPointArray - microoptimization
// These are hardcoded for reasons that i forgot
// I could have easily named the objects on the map and
// Done a getPos on the object
// But whatever it is what it is
private _deliveryPointArray = [
[21770,4911.36,0.681143],
[23203.9,7446.1,0.012188],
[11704,22809,0],
[2844,20279.7,0],
[14504.4,23426.4,0.0445493],
[3030.39,10216,0.602249],
[6357,2082,0.1],
[7198,2533,0.1],
[7226,2187,0.1],
[8045,2835,0.1],
[8577,2320,0.1],
[9286,1902,0.1],
[9840,1786,0.1],
[10466,1886,0.1],
[10243,1576,0.1],
[10857,2275,0.1],
[11939,3402,0.1],
[11105,3009,0.1],
[13509,6166,0.1],
[13081,7804,0.1],
[12940,9326,0.1],
[13170,10292,0.1]
[4882.485, 20331.756, 0.0],
[12982.635, 20233.861, 0.0],
[13860.438, 15573.917, 0.0],
[14607.452, 16738.375, 0.0],
[23147.25, 18668.283, 0.0],
[21285.926, 13470.976, 0.0],
[3741.44, 13358.252, 0.0]
];
private _ret = _deliveryPointArray select floor random _numItems;
private _ret = _deliveryPointArray select floor random count _deliveryPointArray;
_ret = [10168.285, 12108.834, 0.0];
_ret;

View File

@@ -7,22 +7,20 @@
*/
// Throws missing ';' error at compiletime
// if (gMissionStarted == true) then {
// exitWith {
// hint "You have already started a mission! Complete that first!";
// };
// };
if (gMissionStarted) exitWith {
hint "You have already started a mission! Complete that first!";
};
gMissionStarted = true;
private _deliveryPoint = [] call RR_fnc_getDeliveryPoint;
private _deliveryPointMarkerR = createMarkerLocal ["Delivery Point Radius", _deliveryPoint];
private _deliveryPointMarkerR = createMarkerLocal ["RR_Delivery_Radius", _deliveryPoint];
_deliveryPointMarkerR setMarkerShapeLocal "ELLIPSE";
_deliveryPointMarkerR setMarkerSizeLocal [500, 500];
_deliveryPointMarkerR setMarkerColorLocal "ColorRed";
private _deliveryPointMarker = createMarkerLocal ["Delivery Point", _deliveryPoint];
private _deliveryPointMarker = createMarkerLocal ["RR_Delivery_Point", _deliveryPoint];
_deliveryPointMarker setMarkerTypeLocal "mil_objective";
_deliveryPointMarker setMarkerTextLocal "Delivery Point";
@@ -34,9 +32,7 @@ private _distanceToPoint = 0;
// Lookup table of available shit
private _helis = [
["B_Heli_Transport_03_unarmed_F", "Huron"],
["B_Heli_Transport_03_unarmed_green_F", "Huron"],
["O_Heli_Transport_04_box_F", "Taru"],
["O_Heli_Transport_04_covered_F", "Taru"]
["B_Heli_Transport_03_unarmed_green_F", "Huron"]
];
private _missionHeliIndex = floor random count _helis;
@@ -44,7 +40,7 @@ private _missionHeliClass = _helis select _missionHeliIndex select 0;
private _missionHeliName = _helis select _missionHeliIndex select 1;
gMissionHeli = createVehicle [_missionHeliClass, [10064.9,12045.4,0.00141716], [], 0];
gMissionHeli setVariable ["RR_Mission_Heli", true];
gMissionHeli setVariable ["RR_Mission_Heli", gMissionHeli];
// Transport Item spawm (Hard coded eewwwwwwwww) [10085.4,12076.8,0.00141335]
@@ -66,12 +62,11 @@ private _missionItemClass = _items select _missionItemIndex select 0;
private _missionItemName = _items select _missionItemIndex select 1;
gMissionDelivery = createVehicle [_missionItemClass, [10085.4,12076.8,0.00141335], [], 0];
gMissionDelivery setVariable ["RR_Mission_Item", true];
gMissionDelivery setVariable ["RR_Mission_Item", gMissionDelivery];
// Sling to vehicle
gMissionHeli setSlingLoad gMissionDelivery;
[
player, "RR_Delivery_Task",
[format ["Deliver %1 to the marker", _missionItemName], "Delivery Mission", "Deliver Here"],

View File

@@ -4,5 +4,7 @@ class RR {
file = "RR_functions";
class triggerStart {};
class getDeliveryPoint {};
class endDelivery {};
class endMission {};
};
};

View File

@@ -1,2 +1,7 @@
/**
* Copyright© Benjamin Kyd 2019
* init.sqf
*/
gMissionStarted = false;
gMissionCompleted = false;

View File

@@ -8,14 +8,14 @@ class EditorData
toggles=1;
class ItemIDProvider
{
nextID=3;
nextID=21;
};
class Camera
{
pos[]={10092.601,17.288755,12033.088};
dir[]={-0.52590108,-0.63688552,0.56386817};
up[]={-0.43440279,0.77094764,0.46576494};
aside[]={0.73134863,-5.9989907e-007,0.68211144};
pos[]={10211.702,121.95953,11959.148};
dir[]={-0.52585119,-0.56704134,0.63401073};
up[]={-0.36201367,0.82367325,0.43647406};
aside[]={0.76971513,3.8649887e-008,0.63840675};
};
};
binarizationWanted=0;
@@ -28,13 +28,14 @@ addons[]=
"A3_Weapons_F_Acc",
"A3_Weapons_F_Mark_Acc",
"A3_Weapons_F",
"A3_Weapons_F_Items"
"A3_Weapons_F_Items",
"A3_Structures_F_Mil_Helipads"
};
class AddonsMetaData
{
class List
{
items=5;
items=6;
class Item0
{
className="A3_Structures_F";
@@ -70,6 +71,13 @@ class AddonsMetaData
author="Bohemia Interactive";
url="https://www.arma3.com";
};
class Item5
{
className="A3_Structures_F_Mil";
name="Arma 3 - Military Buildings and Structures";
author="Bohemia Interactive";
url="https://www.arma3.com";
};
};
};
randomSeed=11229197;
@@ -99,7 +107,7 @@ class Mission
};
class Entities
{
items=2;
items=18;
class Item0
{
dataType="Object";
@@ -198,5 +206,272 @@ class Mission
};
id=1;
};
class Item2
{
dataType="Object";
class PositionInfo
{
position[]={4882.4043,239.56299,20339.283};
angles[]={6.2299037,6.2548909,0.0026744273};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=5;
type="Land_Noticeboard_F";
};
class Item3
{
dataType="Object";
class PositionInfo
{
position[]={4882.4854,238.4183,20331.756};
angles[]={0.012000273,0,0.043971907};
};
side="Empty";
flags=4;
class Attributes
{
};
id=6;
type="Land_HelipadCircle_F";
};
class Item4
{
dataType="Object";
class PositionInfo
{
position[]={12977.679,45.069313,20239.527};
angles[]={6.2418771,5.5469108,0.0039967569};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=7;
type="Land_Noticeboard_F";
};
class Item5
{
dataType="Object";
class PositionInfo
{
position[]={12982.635,44.036316,20233.861};
angles[]={6.2259207,5.5752101,6.2205977};
};
side="Empty";
flags=4;
class Attributes
{
};
id=8;
type="Land_HelipadCircle_F";
};
class Item6
{
dataType="Object";
class PositionInfo
{
position[]={13854.786,13.810699,15578.89};
angles[]={0.013332055,5.416317,6.2778587};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=9;
type="Land_Noticeboard_F";
atlOffset=9.5367432e-007;
};
class Item7
{
dataType="Object";
class PositionInfo
{
position[]={13860.438,13.04,15573.917};
angles[]={0.010663962,5.4446244,6.2645278};
};
side="Empty";
flags=4;
class Attributes
{
};
id=10;
type="Land_HelipadCircle_F";
};
class Item8
{
dataType="Object";
class PositionInfo
{
position[]={14602.184,18.701426,16743.752};
angles[]={-0,5.4904971,0};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=11;
type="Land_Noticeboard_F";
};
class Item9
{
dataType="Object";
class PositionInfo
{
position[]={14607.452,17.91,16738.375};
angles[]={-0,5.5188046,0};
};
side="Empty";
flags=4;
class Attributes
{
};
id=12;
type="Land_HelipadCircle_F";
};
class Item10
{
dataType="Object";
class PositionInfo
{
position[]={23146.021,3.981426,18675.709};
angles[]={-0,6.1015859,0};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=13;
type="Land_Noticeboard_F";
};
class Item11
{
dataType="Object";
class PositionInfo
{
position[]={23147.25,3.1900001,18668.283};
angles[]={-0,6.1298933,0};
};
side="Empty";
flags=4;
class Attributes
{
};
id=14;
type="Land_HelipadCircle_F";
};
class Item12
{
dataType="Object";
class PositionInfo
{
position[]={21279.881,29.919796,13475.669};
angles[]={6.2725158,5.4904971,6.2445378};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=15;
type="Land_Noticeboard_F";
atlOffset=3.8146973e-006;
};
class Item13
{
dataType="Object";
class PositionInfo
{
position[]={21285.926,28.924883,13470.976};
angles[]={6.272521,5.5188046,0.04796192};
};
side="Empty";
flags=4;
class Attributes
{
};
id=16;
type="Land_HelipadCircle_F";
};
class Item14
{
dataType="Object";
class PositionInfo
{
position[]={3747.5391,11.596859,13353.839};
angles[]={0.021331646,2.1796465,0.017332481};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=17;
type="Land_Noticeboard_F";
atlOffset=-9.5367432e-007;
};
class Item15
{
dataType="Object";
class PositionInfo
{
position[]={3741.4399,10.632298,13358.252};
angles[]={6.2765174,2.2079539,0.011995304};
};
side="Empty";
flags=4;
class Attributes
{
};
id=18;
type="Land_HelipadCircle_F";
};
class Item16
{
dataType="Object";
class PositionInfo
{
position[]={10163.419,13.825069,12114.577};
angles[]={0.0039967569,5.5627465,6.1769204};
};
side="Empty";
flags=4;
class Attributes
{
init="this addAction [" \n " ""Deliver Mission"", RR_fnc_endDelivery" \n "];";
};
id=19;
type="Land_Noticeboard_F";
};
class Item17
{
dataType="Object";
class PositionInfo
{
position[]={10168.285,12.425059,12108.834};
angles[]={6.2565165,5.5910573,6.1769123};
};
side="Empty";
flags=4;
class Attributes
{
};
id=20;
type="Land_HelipadCircle_F";
};
};
};