initial commit
This commit is contained in:
26
functions/Interactables/fn_addVoiceLine.sqf
Normal file
26
functions/Interactables/fn_addVoiceLine.sqf
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
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];
|
||||
56
functions/Interactables/fn_createTeleporter.sqf
Normal file
56
functions/Interactables/fn_createTeleporter.sqf
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
Author: Djeeberjr
|
||||
|
||||
Description:
|
||||
Makes object a teleporter
|
||||
|
||||
Effect: Local
|
||||
|
||||
Parameter(s):
|
||||
0: OBJECT - the gamelogic
|
||||
1 (optional): STRING - Teleport name
|
||||
*/
|
||||
|
||||
params ["_gl",["_name",""]];
|
||||
|
||||
if(_name == "")then{
|
||||
_name = (getPos _gl) call BIS_fnc_locationDescription;
|
||||
};
|
||||
|
||||
_pushArray = [
|
||||
getPos _gl, //Pos
|
||||
DLib_fnc_teleporterCallback, //code
|
||||
_name, //name
|
||||
"", //description
|
||||
"", //mission's player ???
|
||||
"", //Path to overview image
|
||||
1, //Size multiplier for overview image
|
||||
[_gl] //Params
|
||||
];
|
||||
|
||||
if(isNil "DLIB_teleport")then{
|
||||
DLIB_teleport = [_pushArray];
|
||||
}else{
|
||||
DLIB_teleport pushBack _pushArray;
|
||||
};
|
||||
|
||||
{
|
||||
|
||||
_x addAction ["Open map",{
|
||||
params ['_target', '_caller', '_actionId', '_arguments'];
|
||||
[
|
||||
findDisplay 46,
|
||||
getPos _target,
|
||||
DLIB_teleport,
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
0,
|
||||
false,
|
||||
1,
|
||||
false,
|
||||
"Teleport to location"
|
||||
] call BIS_fnc_StrategicMapOpen;
|
||||
},[],5,true,true,"","true",5];
|
||||
|
||||
} forEach (synchronizedObjects _gl);
|
||||
28
functions/Interactables/fn_makeAiDoctor.sqf
Normal file
28
functions/Interactables/fn_makeAiDoctor.sqf
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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];
|
||||
|
||||
|
||||
91
functions/Interactables/fn_makeCram.sqf
Normal file
91
functions/Interactables/fn_makeCram.sqf
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
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;
|
||||
|
||||
|
||||
0
functions/Interactables/fn_mannequin.sqf
Normal file
0
functions/Interactables/fn_mannequin.sqf
Normal file
23
functions/Interactables/fn_readNews.sqf
Normal file
23
functions/Interactables/fn_readNews.sqf
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Author: Djeeberjr
|
||||
|
||||
Description:
|
||||
Adds an action to read a AAN news report. See https://community.bistudio.com/wiki/BIS_fnc_showAANArticle
|
||||
|
||||
Parameter(s):
|
||||
0: OBJECT - to add the action to
|
||||
1: ARRAY - The article
|
||||
|
||||
Returns:
|
||||
actionID
|
||||
*/
|
||||
|
||||
params ["_obj","_acticle"];
|
||||
|
||||
_obj setObjectTextureGlobal [0,"DLib\res\AAN.paa"];
|
||||
_obj addAction ["Read news",{
|
||||
params ["_target", "_caller", "_actionId", "_arguments"];
|
||||
[_arguments] call bis_fnc_showAANArticle;
|
||||
|
||||
},_acticle,6,true,true,"","true",2];
|
||||
|
||||
2
functions/Interactables/fn_teleporterCallback.sqf
Normal file
2
functions/Interactables/fn_teleporterCallback.sqf
Normal file
@@ -0,0 +1,2 @@
|
||||
_gl = (_this#9)#0;
|
||||
player setPosATL (getPosATL _gl);
|
||||
Reference in New Issue
Block a user