BIS_fnc_initIntelObject

From Bohemia Interactive Community
Jump to navigation Jump to search
Introduced with Arma 3 version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
1.00

Description

Description:
The function sets up an object as intel retrievable by the players by adding a "Take Intel" addAction to it.
When a player uses the action, they will play an animation to pick the object up and the object will be deleted from the mission.
The player and any defined recipients will then receive a diary entry which can contain a title, description and picture.
The diary entry will also contain a marker shortcut showing where the intel was found.

This function is similar to when placing an Intel object as Zeus, whose interface provides settings for some of the extra options like..
  • Which sides can interact with the action
  • The picture, title and description used in the diary entry

However when using this function from script there are several variables that need to be set up to acquire the same results and can be seen in the examples below.
Without this extra setup the functionality provided is minimal and only includes..
  • The "Take Intel" action on the object
  • The object can be picked up by a player from any side
  • When picked up will have no title or description and the picture will be a default exclamation mark
  • Diary entry will only be given to the person who picked it up

There are some optional features of intel objects that can be used..
  • The diary entries description can be further enhanced by using any of the supported tags as found on the createDiaryRecord page.
  • There is also a scripted eventhandler that can be registered too called "IntelObjectFound" on the intel object. The event provides the parameters [ object, caller ] where object is the intel object and caller the person who picked it up.
  • A Zeus who has the intel object registered as an curator editable object can also receive feedback that the intel has been picked up via registering too the scripted eventhandler called "intelObjectFound" on the curator module. The event provides the parameters [ zeus, caller, object ] where zeus is the curator module, caller the person who picked it up and object is the intel object
The usage of scripted eventhandlers is shown in Example 3
All the code examples provide comments ( // ) to describe each setting, please make sure you remove each commented line when copying to object inits otherwise you will receive errors

Syntax

Syntax:
[ object ] call BIS_fnc_initIntelObject;
Parameters:
object: Object - Object to place intel action on
Return Value:
true

Examples

Example 1:
Setup an object as intel from its init attribute in the editor.
Basic version including picture, title, description, recipients and which sides can interact with it.
[ this ] call BIS_fnc_initIntelObject; if (isServer) then { //Diary picture this setVariable [ "RscAttributeDiaryRecord_texture", //Path to picture "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true ]; //Diary Title and Description [ this, "RscAttributeDiaryRecord", //[ Title, Description, "" ] ["Top Secret Docs","These Docs outline the enemies defenses",""] ] call BIS_fnc_setServerVariable; //Diary entry shared with.. follows BIS_fnc_MP target rules this setVariable ["recipients", west, true]; //Sides that can interact with intelObject this setVariable ["RscAttributeOwners", [west], true]; };
Example 2:
Setup an object as intel from its init attribute in the editor with custom addAction title
Replace the first line of Example 1 with..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:
Setup an object as intel from its init attribute in the editor.
Basic version plus curator and object scripted eventhandlers.
[ this ] call BIS_fnc_initIntelObject; if (isServer) then { //Diary picture this setVariable [ "RscAttributeDiaryRecord_texture", //Path to picture "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true ]; //Diary Title and Description [ this, "RscAttributeDiaryRecord", //[ Title, Description, "" ] ["Top Secret Docs","These Docs outline the enemies defenses",""] ] call BIS_fnc_setServerVariable; //Diary entry shared with.. follows BIS_fnc_MP target rules this setVariable ["recipients", west, true]; //Sides that can interact with intelObject this setVariable ["RscAttributeOwners", [west], true]; //Optional scripted event handlers //Register intel object with Zeus as curator editable, Where _zeus is the curator module _zeus addCuratorEditableObjects [ [ this ], false ]; //Add Zeus scripted event, Where _zeus is the curator module [ _zeus, "IntelObjectFound", { hint "Intel found" } ] call BIS_fnc_addScriptedEventHandler; //Add intel object scripted event that systemchats to all clients when found and by who [ this, "IntelObjectFound", { params[ "", "_foundBy" ]; private _msg = format[ "Intel Found by %1", name _foundBy ]; _msg remoteExec[ "systemChat" ]; } ] call BIS_fnc_addScriptedEventHandler; }; Although both scripted eventhandlers supply a reference to the intel object it is deleted from the mission almost immediately so could possibly be null when queried.

Additional Information

Execution:
call
Multiplayer:
-
See also:
See also needed

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section