Compare commits

...

4 Commits

Author SHA1 Message Date
8932876d45 removed unsued functions from Interactables 2020-10-20 18:23:31 +02:00
cd28017b9f removed unused Zeus function 2020-10-20 18:22:14 +02:00
e43bd386cc removed unused functions 2020-10-20 18:21:37 +02:00
ddf329073f added spectrum device scripts 2020-10-20 18:18:52 +02:00
14 changed files with 71 additions and 240 deletions

View File

@@ -1,43 +0,0 @@
/*
Author: Djeeberjr
Description:
Buildable barricade. If there is a object synced to it, it will use this as the "controller".
Parameter(s):
0: OBJECT - the barricade
1: STRING - barrcade group
2: NUMBER - cost
*/
params ["_obj","_group","_cost"];
_ctl = objNull;
if ((count synchronizedObjects _obj) == 1)then{
_ctl = (synchronizedObjects _obj) # 0;
}else{
//Create controller
_ctl = createVehicle ["Marker_Use_ACR", position _obj, [], 0, "CAN_COLLIDE"];
_ctl setVectorDirAndUp [vectorDir _obj, vectorUp _obj];
};
dbg = synchronizedObjects _obj;
//create action
_action = _ctl addAction ["Build barricade",{
params ["_target", "_caller", "_actionId", "_arguments"];
_obj = _arguments # 0;
_group = _arguments #1;
_cost = _arguments #2;
_target removeAction _actionId; //TODO: remoteExec
_obj hideObjectGlobal false;
deleteVehicle _target;
},[_obj,_group,_cost],2.5,true,true,"","true",2];
//Hide it
_obj hideObjectGlobal true;
_obj setVariable ["DLib_barricade",[_group,_cost,_action]];

View File

@@ -1 +0,0 @@

View File

@@ -1,26 +0,0 @@
/*
Author: Djeeberjr
Description:
Init a zeus player.
Parameter(s):
0: OBJECT - the unit
1: STRING - Conversation to play (.bikb)
2 (optonal) : CODE - code called when started (local to caller)
https://community.bistudio.com/wiki/kbAddTopic for the eventhandler
*/
params ["_unit","_voiceline","_cb"];
//TODO: img locationPosition
_unit addAction ["<img image=''/>",{
params ["_target", "_caller", "_actionId", "_arguments"];
_voiceline = _arguments select 0;
_cb = _arguments select 1;
[_target,"npc_talk","conversations.bikb","",_cb] remoteExec ["kbAddTopic"];
[_target,_caller,"npc_talk",_voiceline,"DIRECT"] remoteExec ["kbTell"];
[_target,_actionId] remoteExec ["removeAction"];
},[_voiceline,_cb],true,true,"","true",3];

View File

@@ -1,28 +0,0 @@
/*
Author: Djeeberjr
Description:
Makes an ai a Medic so injured players can heal themself a the base.
Parameter(s):
0: OBJECT - the ai unit
*/
params ["_self"];
_self setUnitTrait ["medic",1];
//TODO: make unit ace3 doctor
_self addAction ["<t color='#ff0000'>Rrequest medical attention</t>",{
params ["_target", "_caller", "_actionId", "_arguments"];
//TODO: heal player
//[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
//ace_medical_level
//https://github.com/acemod/ACE3/tree/master/addons/medical/functions
//http://www.armaholic.com/forums.php?m=posts&q=35327
},nil,1.5,true,true,"","true",2];

View File

@@ -1,91 +0,0 @@
/*
Author: Djeeberjr
Description:
Set up a C-RAM defence system
Parameter(s):
0: OBJECT - The C-RAM. must be "B_AAA_System_01_F"
1: NUMBER - the radius
Returns:
Script Handle - for the main loop
*/
params ["_self","_radius"];
{_self removeWeapon _x} forEach weapons _self;
_self addWeapon "Gatling_30mm_Plane_CAS_01_F";
_self addMagazine "1000Rnd_Gatling_30mm_Plane_CAS_01_F";
_self disableAI "TARGET";
_self disableAI "AUTOTARGET";
//start loop (see https://forums.bohemia.net/forums/topic/215598-release-c-ram-script/)
_handle = [_self,_radius,_guns] spawn {
params ["_self","_radius","_guns"];
_incoming = [];
_isEngaging = false;
while {true} do {
sleep 1;
_incoming = _incoming + ((getPos _self) nearObjects ["MissileBase",_radius]);
_incoming = _incoming + ((getPos _self) nearObjects ["RocketBase",_radius]);
_incoming = _incoming + ((getPos _self) nearObjects ["ShellBase",_radius]);
if(count _incoming > 0)then{
if(not _isEngaging)then{
_self say3D ["DLib_idf",1000];
};
_incomingRound = _incoming select 0;
_isEngaging = true;
_fromTarget = _incomingRound getDir _self;
_targetDir = direction _incomingRound;
_roundChanche = 100;
//Start shooting
while {alive _incomingRound && (getPosATL _incomingRound select 2) > 50}do{
_target = "Land_HelipadEmpty_F" createVehicle [0,0,0];
_leadPrediction = (((_self distance _incomingRound) / 4032) * (speed _incomingRound)) / (_self distance _incomingRound);
_zeroing = ((_self distance _incomingRound) / 100) * 8;
_target attachTo [_incomingRound,[0,_leadPrediction,_zeroing]];
_self doWatch _target;
if(alive _incomingRound)then{
if(_roundChanche == 100)then{
sleep 2;
};
_self fire "Gatling_30mm_Plane_CAS_01_F";
};
sleep 0.5;
deleteVehicle _target;
if(alive _incomingRound)then{
_roundChanche = _roundChanche - random[0,25,100];
if(_roundChanche <= 0)then{
"helicopterexplosmall" createVehicle getPos _incomingRound;
deleteVehicle _incomingRound;
};
};
};
_incoming deleteAt 0;
}else{
if(_isEngaging)then{
_isEngaging = false;
//No more targets
};
};
};
};
_handle;

View File

@@ -0,0 +1,66 @@
/*
Author: Djeeberjr
Description:
Points the Sectrum device to a spesific object
Parameter(s):
0: OBJECT - target of the scan
1: NUMBER - interval of update e.g. 0.3
2: NUMBER - Frequency to scan on (UI only)
3: NUMBER - Cutoff signale after angle e.g. 90
4: NUMBER - Min distance to target befor device goes 100%
5: NUMBER - Max distance the target can be detected. Signal strength relativ to max distance.
6: OBJECT - receiver object most of the time the player
*/
_this spawn {
params ["_target","_interval","_scanFreq","_angleCutoff","_minDistance","_maxDistance",["_receiverObject",player]];
missionNamespace setVariable ["#EM_FMin", _scanFreq - 3];
missionNamespace setVariable ["#EM_FMax", _scanFreq + 3];
missionNamespace setVariable ["#EM_SelMin", _scanFreq - 0.3];
missionNamespace setVariable ["#EM_SelMax", _scanFreq + 0.3];
missionNamespace setVariable ["#EM_Progress", 0];
while {alive _receiverObject} do {
// Get distance
_objectDistance = round (_receiverObject distance _target);
// Get angle difference to target range from 0 to 180
_objectRelativeDirection = round (_receiverObject getRelDir _target);
if (_objectRelativeDirection >= 180) then{
_objectRelativeDirection = (360 - _objectRelativeDirection);
}else{
_objectRelativeDirection = _objectRelativeDirection;
};
// Apply angle cutoff
if (_objectRelativeDirection > _angleCutoff) then {
_objectRelativeDirection = 180; // Set angle to max value
};
_dirSignalStrength = 1 - linearConversion [0,_angleCutoff,_objectRelativeDirection,0,1,true];
_distSignalStrength = 1 - linearConversion [0,_maxDistance,_objectDistance,0,1,true];
_absSignalStrength = _dirSignalStrength * _distSignalStrength;
if (_objectDistance < _minDistance) then {
_absSignalStrength = 1;
_distSignalStrength = 1;
};
missionNamespace setVariable ["#EM_Values", [
_scanFreq,
linearConversion [0,1,_absSignalStrength,missionNamespace getVariable "#EM_SMin",missionNamespace getVariable "#EM_SMax"]
]];
missionNamespace setVariable ["#EM_Progress", _distSignalStrength];
sleep _interval;
};
};

View File

@@ -1,35 +0,0 @@
/*
Author: Djeeberjr
Description:
Init a zeus player.
Parameter(s):
0: OBJECT - zeus unit
*/
params ["_unit"];
//Command can only be executed on the server.
if(!isServer)exitWith{};
//Check if unit is alredy a curator
if(_unit call BIS_fnc_isCurator)exitWith{};
//Create Zeus module if not created yet.
if(isNil "DLib_zeusModule")then{
_sideLogic = createCenter sidelogic;
_group_logic = createGroup _sideLogic;
DLib_zeusModule = _group_logic createUnit ["ModuleCurator_F", [0,0,0], [],0, "NONE"];
DLib_zeusModule addCuratorEditableObjects [allUnits,true];
publicVariable "DLib_zeusModule";
};
_unit assignCurator DLib_zeusModule;
//Add vision modes
[_unit,[-1,-2,0,1,2,3,4,5,6,7]] call BIS_fnc_setCuratorVisionModes;
//godmode
_unit allowDamage false;

View File

@@ -1,6 +0,0 @@
class Barricade{
file="DLib\functions\Barricade";
class barricade{};
class enableBarricade{};
class disableBarricade{};
};

View File

@@ -1,12 +1,11 @@
class DLib{
#include "Base\CfgFunctions.hpp"
#include "Arsenal\CfgFunctions.hpp"
#include "Barricade\CfgFunctions.hpp"
#include "Interactables\CfgFunctions.hpp"
#include "Orbat\CfgFunctions.hpp"
#include "PlaneJump\CfgFunctions.hpp"
#include "Radio\CfgFunctions.hpp"
#include "Util\CfgFunctions.hpp"
#include "Zeus\CfgFunctions.hpp"
#include "Other\CfgFunctions.hpp"
#include "Spectrum\CfgFunctions.hpp"
}

View File

@@ -1,9 +1,5 @@
class Interactables{
file="DLib\functions\Interactables";
class makeAiDoctor{}; //TODO
class addVoiceLine{}; //TODO
class makeCram{};
class mannequin{};
class readNews{};
class createTeleporter{};
class teleporterCallback{};

View File

@@ -0,0 +1,4 @@
class Spectrum{
file="DLib\functions\Spectrum";
class findTarget{};
};

View File

@@ -1,4 +0,0 @@
class Zeus{
file="DLib\functions\Zeus";
class initZeus{};
}