Epoch/Sources/epoch_server_settings/EpochEvents/Satellite.sqf
vbawol a0e9ec0153 digest concept
-use the second set of GVARs to track adding and removing attributes.
-Epoch_player* vars moved to local vars only accessible inside the
master loop.
-TODO: finish digest system with a config entry to control digest
limits. Some extra logic is needed.

Basically, when you consume some food, it will not increase your hunger
level immediately but raise over time.

Each of these should have limits on how much you can store in the digest
and how much each tick the digest var can affect the local player var in
the master loop.
2017-09-20 09:23:46 -05:00

35 lines
1.3 KiB
Plaintext

/*
Crashed Satellite Event
by Aaron Clark - EpochMod.com
Improvements and or bugfixes and other contributions are welcome via the github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settings/EpochEvents/Satellite.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_satellite","_marker","_playersNearEpicenter","_position","_satellites"];
//[[[end]]]
_position = [epoch_centerMarkerPosition, 0, EPOCH_dynamicVehicleArea, 10, 0, 1000, 0] call BIS_fnc_findSafePos;
if ((count _position) == 2) then{
// spawn Satellite
_satellites = ["Land_Wreck_Satellite_EPOCH"];
_satellite = createVehicle[(selectRandom _satellites), _position, [], 0.0, "CAN_COLLIDE"];
// send shockwave + effects to each player in zone at time of crash
_playersNearEpicenter = _position nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 1000];
if !(_playersNearEpicenter isEqualTo[]) then{
[_satellite, -1, 0.8, false] remoteExec ['BIS_fnc_sandstorm',_playersNearEpicenter];
};
// set rads
_satellite setVariable ["EPOCH_Rads", 10, true];
if (EPOCH_showSatellites) then{
_marker = createMarker[str(_position), _position];
_marker setMarkerShape "ICON";
_marker setMarkerType "hd_warning";
// _marker setMarkerText "Satellite";
_marker setMarkerColor "ColorGreen";
};
};