BIS fnc initIntelObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Function " to "{{RV|type=function ")
m (Text replacement - " <nowiki>[</nowiki>[" to " [<nowiki/>[")
Line 57: Line 57:
{{cc|Sides that can interact with the intel object:}}
{{cc|Sides that can interact with the intel object:}}
this [[setVariable]] ["RscAttributeOwners", <nowiki>[</nowiki>[[west]]<nowiki>]</nowiki>, [[true]]];
this [[setVariable]] ["RscAttributeOwners", [<nowiki/>[[west]]<nowiki>]</nowiki>, [[true]]];
};</code>
};</code>
<br>
<br>
Line 72: Line 72:
"",
"",
"[[isPlayer]] _this && {_this [[distance]] _target < 2} &&
"[[isPlayer]] _this && {_this [[distance]] _target < 2} &&
{([[side]] [[group]] _this) [[in]] (_target [[getVariable]] ['RscAttributeOwners', <nowiki>[</nowiki>[[west]], [[east]], [[resistance]], [[civilian]]]])}"
{([[side]] [[group]] _this) [[in]] (_target [[getVariable]] ['RscAttributeOwners', [<nowiki/>[[west]], [[east]], [[resistance]], [[civilian]]]])}"
];
];
};</code>
};</code>
Line 98: Line 98:
{{cc|Sides that can interact with the intel object:}}
{{cc|Sides that can interact with the intel object:}}
this [[setVariable]] ["RscAttributeOwners", <nowiki>[</nowiki>[[west]]<nowiki>]</nowiki>, [[true]]];
this [[setVariable]] ["RscAttributeOwners", [<nowiki/>[[west]]<nowiki>]</nowiki>, [[true]]];


{{cc|Register intel object with Zeus as curator editable (_zeus is the curator module):}}
{{cc|Register intel object with Zeus as curator editable (_zeus is the curator module):}}

Revision as of 21:13, 29 January 2021

Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
Interaction

Syntax

Syntax:
Syntax needed
Parameters:
object: Object - Object to place intel action on
Return Value:
Return value needed

Examples

Example 1:
Setup an object as intel from its init attribute in the editor.
Basic version including picture, title, description, recipients and sides that can interact with it:
[this] call BIS_fnc_initIntelObject; if (isServer) then { // Diary picture: this setVariable [ "RscAttributeDiaryRecord_texture", "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", // Path to picture true ]; // Diary Title and Description: [ this, "RscAttributeDiaryRecord", ["New Intel", "The enemies have a cave troll!"] // Array in format [Title, Description] ] call BIS_fnc_setServerVariable; // Diary entry shared with (follows BIS_fnc_MP target rules): this setVariable ["recipients", west, true]; // Sides that can interact with the intel object: this setVariable ["RscAttributeOwners", [west], true]; };
Example 2:
To set up an object as intel from its init attribute in the editor with a custom addAction title, replace the first line of Example 1 with the following: if (hasInterface) then { this addAction [ // Custom addAction Title: "Pick up laptop", {[_this, "action"] spawn BIS_fnc_initIntelObject;}, [], 10, true, true, "", "isPlayer _this && {_this distance _target < 2} && {(side group _this) in (_target getVariable ['RscAttributeOwners', [west, east, resistance, civilian]])}" ]; };
Example 3:
Set up an object as intel from its init attribute in the editor.
Basic version plus curator and scripted event handlers: [this] call BIS_fnc_initIntelObject; if (isServer) then { // Diary picture: this setVariable [ "RscAttributeDiaryRecord_texture", "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", // Path to picture true ]; // Diary Title and Description: [ this, "RscAttributeDiaryRecord", ["New Intel", "The enemies have a cave troll!"] // Array in format [Title, Description] ] call BIS_fnc_setServerVariable; // Diary entry shared with (follows BIS_fnc_MP target rules): this setVariable ["recipients", west, true]; // Sides that can interact with the intel object: this setVariable ["RscAttributeOwners", [west], true]; // Register intel object with Zeus as curator editable (_zeus is the curator module): _zeus addCuratorEditableObjects [[this], false]; // Add Zeus scripted event: [_zeus, "IntelObjectFound", {hint "Intel found"}] call BIS_fnc_addScriptedEventHandler; // Add a scripted event that notifies all clients via systemChat when the intel is found: [ this, "IntelObjectFound", { params ["", "_foundBy"]; private _msg = format ["Intel found by %1", name _foundBy]; _msg remoteExec ["systemChat", 0]; } ] call BIS_fnc_addScriptedEventHandler; }; Although both scripted event handlers supply a reference to the intel object, it is deleted from the mission almost immediately, so it could already be null when queried.

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note