Commit 473dd7b2 authored by Ryan Grupp's avatar Ryan Grupp 💀
Browse files

Intel System

parents
class RscStructuredText {
colorText[] = {1,1,1,1};
deletable = 0;
fade = 0;
h = 0.035;
idc = -1;
shadow = 1;
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
style = 0;
text = "";
type = 13;
w = 0.1;
x = 0;
y = 0;
class Attributes {
align = "left";
color = "#ffffff";
colorLink = "#D09B43";
font = "RobotoCondensed";
shadow = 1;
};
};
class RscText {
colorBackground[] = {0,0,0,0};
colorShadow[] = {0,0,0,0.5};
colorText[] = {1,1,1,1};
fade = 0;
fixedWidth = 0;
font = "RobotoCondensed";
h = 0.037;
idc = -1;
linespacing = 1;
shadow = 1;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
style = 0;
text = "";
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
tooltipColorText[] = {1,1,1,1};
type = 0;
w = 0.3;
x = 0;
y = 0;
};
class RscPicture {
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
fade = 0;
fixedWidth = 0;
font = "TahomaB";
h = 0.15;
idc = -1;
lineSpacing = 0;
shadow = 0;
sizeEx = 0;
style = 48;
text = "";
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
tooltipColorText[] = {1,1,1,1};
type = 0;
w = 0.2;
x = 0;
y = 0;
};
class RscPictureKeepAspect : RscPicture {
style = "0x30 + 0x800";
};
\ No newline at end of file
##### Setup
Copy this folder (parent folder included) into a mission folder so that the file structure looks like `mission\intel_system\scripts\XEH_PreInit.sqf`.
Insert the follow snippet into the `Extended_PreInit_EventHandlers` class in `description.ext`:
```javascript
class mission {
init = "call compile preprocessfilelinenumbers 'mission\intel_system\scripts\XEH_PreInit.sqf';";
}
```
Add the following to your object init line for each piece if intel.
```javascript
[
this, // Object to add actions to
"class_of_inventory_item", // Class of item to be added to players inventory on pickup
"UNIQUE_TASK_ID", // Unique ID for task, not show to players, MUST BE UNIQUE
"Task Name", // Name of task
"Task Description", // Description of task
[0,0,0] // (Optional) Interaction node position offset (ACE3 Only)
] call msn_fnc_intel_system_init;
```
\ No newline at end of file
call compile preprocessFileLineNumbers 'mission\intel_system\scripts\config.sqf';
msn_fnc_intel_system_init = compile preprocessFileLineNumbers 'mission\intel_system\scripts\fnc_init.sqf';
msn_fnc_intel_system_action_type_ace = compile preprocessFileLineNumbers 'mission\intel_system\scripts\action_type\fnc_ace.sqf';
msn_fnc_intel_system_action_type_addAction = compile preprocessFileLineNumbers 'mission\intel_system\scripts\action_type\fnc_addAction.sqf';
\ No newline at end of file
params [
'_worldItem',
'_invItem',
'_taskId',
'_taskName',
'_taskDescription',
['_interactPosition',[0,0,0]]
];
_intel_action = [
'CBB_INTEL_ACTION',
'Grab Intel',
"\z\ace\addons\dragging\ui\icons\box_carry.paa",
{
params ['_obj','_caller','_args'];
_args params ['_invItem','_taskId','_taskName','_taskDescription'];
_caller setVariable ['@FindIntel',(simpleTasks _caller) select 0];
missionNamespace setVariable ['@FindIntel.0','FindIntel'];
if( _caller canAdd _invItem ) then {
deleteVehicle _obj;
_caller addItem _invItem;
hint parseText format['<t color="#00ff00">You put "%1" in your ruck!<br />Don''t lose it!<br /><br />Check the tasks list and report it up the chain of command!</t>',_taskName];
[
[_taskId,"FindIntel"],
true,
[_taskDescription,_taskName,""],
[0,0,0],
"SUCCEEDED",
0,
true,
false,
"Intel",
false
] call BIS_fnc_setTask;
} else {
hint parseText '<t color="#ff0000">You don''t have any remove in your inventory for the intel, call someone else over or get rid of some stuff!</t>';
};
},
{true},
{},
[_invItem,_taskId,_taskName,_taskDescription],
_interactPosition
] call ace_interact_menu_fnc_createAction;
[_worldItem, 0, [], _intel_action] call ace_interact_menu_fnc_addActionToObject;
\ No newline at end of file
params [
'_worldItem',
'_invItem',
'_taskId',
'_taskName',
'_taskDescription',
['_interactPosition',[0,0,0]]
];
_worldItem addAction [
'<t size="1.5" color="#ffd700" shadow="2">Grab Intel</t>',
{
params ['_obj','_caller','_actionId','_args'];
_args params ['_invItem','_taskId','_taskName','_taskDescription'];
_caller setVariable ['@FindIntel',(simpleTasks _caller) select 0];
missionNamespace setVariable ['@FindIntel.0','FindIntel'];
if( _caller canAdd _invItem ) then {
_obj removeAction _actionId;
deleteVehicle _obj;
_caller addItem _invItem;
hint parseText format['<t color="#00ff00">You put "%1" in your ruck!<br />Don''t lose it!<br /><br />Check the tasks list and report it up the chain of command!</t>',_taskName];
[
[_taskId,"FindIntel"],
true,
[_taskDescription,_taskName,""],
[0,0,0],
"SUCCEEDED",
0,
true,
false,
"Intel",
false
] call BIS_fnc_setTask;
} else {
hint parseText '<t color="#ff0000">You don''t have any remove in your inventory for the intel, call someone else over or get rid of some stuff!</t>';
};
},
[_invItem,_taskId,_taskName,_taskDescription],
9999999
];
\ No newline at end of file
// Uncomment which ones you want to use.
msn_var_intel_system_actionTypes = [
'addAction'
//,'ace'
];
\ No newline at end of file
if(hasInterface) then {
{
private _func = call compile format ['msn_fnc_intel_system_action_type_%1',_x];
_this call _func;
} forEach msn_var_intel_system_actionTypes;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment