{"name":"BIS_fnc_target","operator":null,"title":"BIS fnc target","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_target","revid":337301,"updated":"2023-01-13T10:27:53Z","groups":["Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Handles the shooting targets in the Bootcamp DLC, statistics, animation, etc. (targets such as `TargetBootcampHuman_f`)\n\n|  |  |  |\n|---|---|---|\n| + Action/Parameter Table | Action (String) | Parameters (Array) arguments |\n| **initialize**<br>Initializes the target and sets it to the \"up\" position | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **terminate**<br>Doesn't do anything | N/A |  |\n| **animate**<br>Animate the object to the given position (\"up\" or \"down\") | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- position: String - \"up\" or \"down\" (default) |  |\n| **getAnimationPhase**<br>**Return Value:** Number - 0 (up) or 1 (down) depending on current state | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **getAnimationPhaseString**<br>**Return Value:** String - \"up\" or \"down\" depending on current state | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **getAnimatedSelection**<br>**Return Value:** String - the name of the \"animatedSelection\" from object config | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **hit**<br>Handles the hit event to animate the target down and up again | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- unit: Object - Unit which shot the target<br>- damage: Number - Amount of damage done to the target |  |\n| **hitPart**<br>Handles the hit event and stores the data | - partsList: Array - Contains list of all parts which got hit (see HitPart EH format) to format [target, shooter]:<br>  - target: Object - Target object of type 'TargetBootcamp_base_F'<br>  - shooter: Object - Unit which shot the target |  |\n| **getShooterDataIndex**<br>**Return Value:** Number - index from Shooter Data for specific unit | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target |  |\n| **getShooterData**<br>**Return Value:** Array - all data from Shooter Data for specific unit<br>Format: `[[\"uid\", \"\"], [\"name\", \"\"], [\"shots\", [[[\"time\", 0], [\"distance\", 0], [\"weapon\", \"\"], [\"direct\", 0]]]]]` | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target |  |\n| **setShooterData**<br>Set Shooter Data for specific unit | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target<br>- data: Array - Shooter Data |  |\n| **getShotsData**<br>**Return Value:** Array - Shots Data for specific unit | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target |  |\n| **getShotsDataFromTargets**<br>**Return Value:** Number - total amount of shots hit | - targets: Array of Object - List of target objects of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target |  |\n| **getShotsDataWithFilter**<br>**Return Value:** Array - Shot Data after custom filter | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target<br>- filter: String - One of \"time\", \"distance\", \"weapon\" or \"direct\"<br>- code: Code - Custom code to validate the shot. _this is the value of filtered data |  |\n| **setShotsData**<br>Set Shots Data for specific unit | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target<br>- data: Array - Shots Data |  |\n| **getShootersData**<br>**Return Value:** Array - full Shooters Data | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **setShootersData**<br>Set full Shooters Data | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- data: Array - Shooter Data |  |\n| **resetShootersData**<br>Remove all data from Shooters Data array | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **getShooterTemplate**<br>**Return Value:** Array - template for Shooter Data | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- uid: String - Player UID of unit who shot the target |  |\n| **getShotTemplate**<br>**Return Value:** Array - template for Shot Data (see HitPart EH format) | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- shooter: Object - Unit who shot the target<br>- projectile: Object - (\"_bullet\" not used)<br>- position: Array format Position - (\"_position\" not used)<br>- velocity: Array - (\"_velocity\" not used)<br>- selection: Array - (\"_selection\" not used)<br>- ammo: Array - (\"_ammo\" not used)<br>- vector: Array - (\"_direction\" not used)<br>- radius: Array - (\"_radius\" not used)<br>- surfaceType: String - (\"_surface\" not used)<br>- isDirect: Boolean - true if object was directly hit, false if it was hit by indirect/splash damage. |  |\n| **getShooterByUid**<br>**Return Value:** Object - corresponding shooter unit | - uid: String - Player UID of unit who shot the target |  |\n| **uiOpen**<br>Opens the Target Board display | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **uiOpenToAll**<br>Opens the Target Board display for all connected players | - target: Object - Target object of type \"TargetBootcamp_base_F\" |  |\n| **uiOnLoad**<br>Triggered when display is opened (internal) | - display: Display |  |\n| **uiFillTable**<br>Triggered when display is opened, fills UI with Shooters Data (internal) | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- control: Control - \"_listBox\" |  |\n| **uiFillTableRow**<br>Triggered when display is opened, fills UI with Shooter Data (internal) | - target: Object - Target object of type \"TargetBootcamp_base_F\"<br>- control: Control - \"_listBox\"<br>- data: Array - Shooter Data |  |","syntaxes":[{"syntax":"[action, parameters] call BIS_fnc_target","since":null,"effect":null,"exec":null,"params":[{"name":"action","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"action: String"},{"name":"parameters","type":"Array","optional":false,"default":null,"description":null,"types":["Array"],"since":null,"text":"parameters: Array"}],"returns":{"type":"See above table","types":["above table"],"description":null,"text":"See above table"}}],"examples":[{"text":"```sqf\n// open the Score Board\n[\"uiOpen\", [myTarget]] call BIS_fnc_target;\n```","code":["// open the Score Board\n[\"uiOpen\", [myTarget]] call BIS_fnc_target;"]},{"text":"```sqf\n// open the Score Board for all players in MP\n[\"uiOpenToAll\", [myTarget]] call BIS_fnc_target;\n```","code":["// open the Score Board for all players in MP\n[\"uiOpenToAll\", [myTarget]] call BIS_fnc_target;"]},{"text":"```sqf\n// clear all data from Score Board\n[\"resetShootersData\", [myTarget]] call BIS_fnc_target;\n```","code":["// clear all data from Score Board\n[\"resetShootersData\", [myTarget]] call BIS_fnc_target;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["doTarget"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Interaction","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}