initial files

This commit is contained in:
Samuele Lorefice
2025-05-24 16:17:33 +02:00
commit 9e023649ac
477 changed files with 118566 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
waitUntil {!isNil "save_is_loaded"};
waitUntil {save_is_loaded};
huron = objNull;
// Detect possible huron from loaded save data
private _savedHuron = vehicles select {(toLower (typeOf _x)) isEqualTo (toLower huron_typename)};
if !(_savedHuron isEqualTo []) then {
huron = _savedHuron select 0;
};
while {true} do {
// Spawn new huron if not loaded or destroyed
if !(alive huron) then {
huron = huron_typename createVehicle [(getposATL huronspawn) select 0, (getposATL huronspawn) select 1, ((getposATL huronspawn) select 2) + 0.2];
huron enableSimulationGlobal false;
huron allowdamage false;
huron setDir (getDir huronspawn);
huron setPosATL (getposATL huronspawn);
huron setDamage 0;
sleep 0.5;
huron enableSimulationGlobal true;
huron setDamage 0;
huron allowdamage true;
[huron] call KPLIB_fnc_addObjectInit;
};
[huron] call KPLIB_fnc_clearCargo;
huron setVariable ["ace_medical_isMedicalVehicle", true, true];
publicVariable "huron";
// Wait until huron is destroyed to respawn it
waitUntil {sleep 5; !alive huron};
stats_spartan_respawns = stats_spartan_respawns + 1;
sleep 10;
// Delete wreck, if near startbase
if (huron distance startbase < 500) then {
deletevehicle huron;
};
};

View File

@@ -0,0 +1,73 @@
waitUntil {!isNil "save_is_loaded"};
waitUntil {save_is_loaded};
// Check if there is no FOB yet (new campaign)
if (GRLIB_all_fobs isEqualTo []) then {
// Prebuild FOB (parameter setting) or spawn FOB box
if (GRLIB_build_first_fob) then {
// Only accept spawnpoints which are at least 800m away from any sector
private _y = "";
private _validPlaces = sectors_opfor select {
_y = _x;
(sectors_allSectors findIf {((markerPos _x) distance2d (markerPos _y)) < 800}) isEqualTo -1
};
// Spawn first FOB on random valid spawnpoint
[markerPos (selectRandom _validPlaces), true] remoteExec ["build_fob_remote_call", 2];
} else {
// Spawn FOB box and wait until the first FOB was built
private _fobbox = objNull;
while {GRLIB_all_fobs isEqualTo []} do {
_fobbox = ([FOB_box_typename, FOB_truck_typename] select KP_liberation_fob_vehicle) createVehicle (getposATL base_boxspawn);
_fobbox setdir getDir base_boxspawn;
_fobbox setposATL (getposATL base_boxspawn);
[_fobbox, true] call KPLIB_fnc_clearCargo;
[_fobbox] call KPLIB_fnc_addObjectInit;
// If the FOB box has fallen into the sea or is destroyed, start again with spawning a new one
waitUntil {
sleep 1;
!(alive _fobbox) || !(GRLIB_all_fobs isEqualTo []) || (((getPosASL _fobbox) select 2) < 0)
};
sleep 10;
};
deleteVehicle _fobbox;
};
// Wait a short time before paradropping the start resource crates
waitUntil {sleep 1; !(GRLIB_all_fobs isEqualTo [])};
if (KP_liberation_tutorial && {["KPLIB_Tasks_Tutorial_Fob"] call BIS_fnc_taskExists}) then {
waitUntil {sleep 1; ["KPLIB_Tasks_Tutorial_Fob_02"] call BIS_fnc_taskCompleted};
sleep 3;
} else {
sleep 10;
};
// Spawn start resource crates and attach them to parachutes
KPLIB_startCrates = [];
private _crate = objNull;
for "_i" from 1 to 6 do {
_crate = createVehicle [
(KPLIB_crates select (_i % 3)),
[((GRLIB_all_fobs select 0) select 0), ((GRLIB_all_fobs select 0) select 1), 150],
[],
80,
"FLY"
];
[_crate, true] call KPLIB_fnc_clearCargo;
_crate setVariable ["KP_liberation_crate_value", 100, true];
[_crate, 500] remoteExec ["setMass", _crate];
[objNull, _crate] call BIS_fnc_curatorObjectEdited;
if (KP_liberation_ace) then {[_crate, true, [0, 1.5, 0], 0] remoteExec ["ace_dragging_fnc_setCarryable"];};
KPLIB_startCrates pushBack _crate;
};
// Spawn green smoke on the crates short before they hit the ground
uiSleep 25;
private _smoke = objNull;
{
_smoke = "SmokeShellGreen" createVehicle (getPos _x);
_smoke attachTo [_x];
} forEach KPLIB_startCrates;
};

View File

@@ -0,0 +1,51 @@
/*
Spawning of start vehicles at placeholder objects
This file spawns the so called "start vehicles" like boats
and little birds at the starting base/carrier.
The array at the end can be used to add start vehicles
by using the variable name of the grasscutter placeholder
and the variable defined in the preset or a direct classname.
Format: [<variable name of placeholder without number>, <variable from preset or a classname>]
E.g. the variables of the grasscutter placeholder objects for the
little birds are named "littlebird_0", "littlebird_1", etc.
while the variable from the preset is KP_liberation_little_bird_classname.
This leads to the entry below.
You can also remove unwanted start vehicles by deleting the corresponding line
in the array below. Just keep the correct comma separation in mind.
Refer to: https://github.com/KillahPotatoes/KP-Liberation/wiki/EN_ImportantHints#commas-inside-an-array
*/
waitUntil {!isNil "save_is_loaded"};
waitUntil {save_is_loaded};
private _placeholder = objNull;
private _spawnPos = [];
private _veh = objNull;
{
_x params ["_id", "_classname"];
for [{_i = 0}, {!isNil ([_id, _i] joinString "")}, {_i = _i + 1}] do {
_placeholder = missionNamespace getVariable ([_id, _i] joinString "");
_spawnPos = getPosATL _placeholder;
_veh = _classname createVehicle [_spawnPos select 0, _spawnPos select 1, (_spawnPos select 2) + 0.2];
_veh enableSimulationGlobal false;
_veh allowDamage false;
_veh setDir (getDir _placeholder);
_veh setPosATL _spawnPos;
[_veh] call KPLIB_fnc_clearCargo;
sleep 0.5;
_veh enableSimulationGlobal true;
_veh setDamage 0;
_veh allowDamage true;
_veh setVariable ["KP_liberation_preplaced", true, true];
[_veh] call KPLIB_fnc_addObjectInit;
};
} forEach [
["littlebird_", KP_liberation_little_bird_classname],
["boat_", KP_liberation_boat_classname]
];