BIS fnc target: Difference between revisions
| Lou Montana (talk | contribs)  (Fix arguments,) | Lou Montana (talk | contribs)   (Table test - good?) | ||
| Line 12: | Line 12: | ||
| |s1= [action, parameters] call [[BIS_fnc_target]] |SYNTAX= | |s1= [action, parameters] call [[BIS_fnc_target]] |SYNTAX= | ||
| |p1= action: [[String]]  | |p1= action: [[String]] | ||
| |p2= parameters: [[Array]]  | |p2= parameters: [[Array]] | ||
| '''initialize'''  | |||
| |p3= <nowiki/> | |||
| {{{!}} class{{=}}"wikitable" | |||
| ! Action [[String]] !! Parameters ([[Array]]) arguments | |||
| {{!}}- | |||
| {{!}} '''initialize'''<br>Initializes the target and sets it to the "up" position   | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''terminate'''  | {{!}}- | ||
| '''animate'''  | {{!}} '''terminate'''<br>Doesn't do anything {{!}}{{!}} {{n/a}} | ||
| {{!}}- | |||
| {{!}} '''animate'''<br>Animate the object to the given position ("up" or "down") | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * position: [[String]] - "up" or "down" (default) | * position: [[String]] - "up" or "down" (default) | ||
| '''getAnimationPhase''' -  | {{!}}- | ||
| {{!}} '''getAnimationPhase'''<br><br>'''Return Value:''' [[Number]] - 0 (up) or 1 (down) depending on current state | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''getAnimationPhaseString''' -  | {{!}}- | ||
| {{!}} '''getAnimationPhaseString'''<br><br>'''Return Value:''' [[String]] - "up" or "down" depending on current state | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''getAnimatedSelection''' -  | {{!}}- | ||
| {{!}}'''getAnimatedSelection'''<br><br>'''Return Value:''' [[String]] - the name of the "animatedSelection" from object config | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''hit'''  | {{!}}- | ||
| {{!}} '''hit'''<br>Handles the hit event to animate the target down and up again | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * unit: [[Object]] - Unit which shot the target | * unit: [[Object]] - Unit which shot the target | ||
| * damage: [[Number]] - Amount of damage done to the target | * damage: [[Number]] - Amount of damage done to the target | ||
| '''hitPart'''  | {{!}}- | ||
| {{!}} '''hitPart'''<br>Handles the hit event and stores the data | |||
| {{!}} | |||
| * partsList: [[Array]] - Contains list of all parts which got hit (see [[Arma 3: Event Handlers#HitPart|HitPart EH]] format) to format [target, shooter]: | * partsList: [[Array]] - Contains list of all parts which got hit (see [[Arma 3: Event Handlers#HitPart|HitPart EH]] format) to format [target, shooter]: | ||
| ** target: [[Object]] - Target object of type 'TargetBootcamp_base_F' | ** target: [[Object]] - Target object of type 'TargetBootcamp_base_F' | ||
| ** shooter: [[Object]] - Unit which shot the target | ** shooter: [[Object]] - Unit which shot the target | ||
| '''getShooterDataIndex''' -  | {{!}}- | ||
| {{!}} '''getShooterDataIndex'''<br><br>'''Return Value:''' [[Number]] - index from Shooter Data for specific unit | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| '''getShooterData''' -  | {{!}}- | ||
| {{!}} '''getShooterData'''<br><br>'''Return Value:''' [[Array]] - all data from Shooter Data for specific unit | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| '''setShooterData'''  | {{!}}- | ||
| {{!}} '''setShooterData'''<br>Set Shooter Data for specific unit | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| * data: [[Array]] - Shooter Data | * data: [[Array]] - Shooter Data | ||
| '''getShotsData'''  | {{!}}- | ||
| {{!}} '''getShotsData'''<br><br>'''Return Value:''' [[Array]] - Shots Data for specific unit | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| '''getShotsDataFromTargets''' -  | {{!}}- | ||
| {{!}} '''getShotsDataFromTargets'''<br><br>'''Return Value:''' [[Number]] - total amount of shots hit | |||
| {{!}} | |||
| * targets: [[Array]] of [[Object]] - List of target objects of type "TargetBootcamp_base_F" | * targets: [[Array]] of [[Object]] - List of target objects of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| '''getShotsDataWithFilter'''  | {{!}}- | ||
| {{!}} '''getShotsDataWithFilter'''<br><br>'''Return Value:''' [[Array]] - Shot Data after custom filter | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| Line 96: | Line 101: | ||
| * code: [[Code]] - Custom code to validate the shot. _this is the value of filtered data | * code: [[Code]] - Custom code to validate the shot. _this is the value of filtered data | ||
| '''setShotsData'''  | {{!}}- | ||
| {{!}} '''setShotsData'''<br>Set Shots Data for specific unit | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| * data: [[Array]] - Shots Data | * data: [[Array]] - Shots Data | ||
| '''getShootersData'''  | {{!}}- | ||
| {{!}} '''getShootersData'''<br><br>'''Return Value:''' [[Array]] - full Shooters Data | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''setShootersData'''  | {{!}}- | ||
| {{!}} '''setShootersData'''<br>Set full Shooters Data | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * data: [[Array]] - Shooter Data | * data: [[Array]] - Shooter Data | ||
| '''resetShootersData'''  | {{!}}- | ||
| {{!}} '''resetShootersData'''<br>Remove all data from Shooters Data array | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''getShooterTemplate'''  | {{!}}- | ||
| {{!}} '''getShooterTemplate'''<br><br>'''Return Value:''' [[Array]] - template for Shooter Data | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| '''getShotTemplate'''  | {{!}}- | ||
| {{!}} '''getShotTemplate'''<br><br>'''Return Value:''' [[Array]] - template for Shot Data (see [[Arma 3: Event Handlers#HitPart|HitPart EH]] format) | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * shooter: [[Object]] - Unit who shot the target | * shooter: [[Object]] - Unit who shot the target | ||
| Line 128: | Line 145: | ||
| * isDirect: [[Boolean]] - [[true]] if object was directly hit, [[false]] if it was hit by indirect/splash damage. | * isDirect: [[Boolean]] - [[true]] if object was directly hit, [[false]] if it was hit by indirect/splash damage. | ||
| '''getShooterByUid'''  | {{!}}- | ||
| {{!}} '''getShooterByUid'''<br><br>'''Return Value:''' [[Object]] - corresponding shooter unit | |||
| {{!}} | |||
| * uid: [[String]] - Player UID of unit who shot the target | * uid: [[String]] - Player UID of unit who shot the target | ||
| '''uiOpen'''  | {{!}}- | ||
| {{!}} '''uiOpen'''<br>Opens the Target Board display | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''uiOpenToAll'''  | {{!}}- | ||
| {{!}} '''uiOpenToAll'''<br>Opens the Target Board display for all connected players | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| '''uiOnLoad'''  | {{!}}- | ||
| {{!}} '''uiOnLoad'''<br>Triggered when display is opened (internal) | |||
| {{!}} | |||
| * display: [[Display]] | * display: [[Display]] | ||
| '''uiFillTable'''  | {{!}}- | ||
| {{!}} '''uiFillTable'''<br>Triggered when display is opened, fills UI with Shooters Data (internal) | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * control: [[Control]] - "_listBox" | * control: [[Control]] - "_listBox" | ||
| '''uiFillTableRow'''  | {{!}}- | ||
| {{!}} '''uiFillTableRow'''<br>Triggered when display is opened, fills UI with Shooter Data (internal) | |||
| {{!}} | |||
| * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | * target: [[Object]] - Target object of type "TargetBootcamp_base_F" | ||
| * control: [[Control]] - "_listBox" | * control: [[Control]] - "_listBox" | ||
| * data: [[Array]] - Shooter Data | * data: [[Array]] - Shooter Data | ||
| {{!}}} | |||
| |r1= See [[#Syntax|above table]] | |||
Revision as of 19:57, 7 January 2020
Description
- Description:
- Handles the shooting targets in the Bootcamp DLC, statistics, animation, etc. (targets such as TargetBootcampHuman_f)
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- [action, parameters] call BIS_fnc_target
- Parameters:
- action: String
- parameters: Array
- 
Action String Parameters (Array) arguments initialize 
 Initializes the target and sets it to the "up" position- target: Object - Target object of type "TargetBootcamp_base_F"
 terminate 
 Doesn't do anythingN/A animate 
 Animate the object to the given position ("up" or "down")getAnimationPhase 
 Return Value: Number - 0 (up) or 1 (down) depending on current state- target: Object - Target object of type "TargetBootcamp_base_F"
 getAnimationPhaseString 
 Return Value: String - "up" or "down" depending on current state- target: Object - Target object of type "TargetBootcamp_base_F"
 getAnimatedSelection 
 Return Value: String - the name of the "animatedSelection" from object config- target: Object - Target object of type "TargetBootcamp_base_F"
 hit 
 Handles the hit event to animate the target down and up againhitPart 
 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]:
 getShooterDataIndex 
 Return Value: Number - index from Shooter Data for specific unitgetShooterData 
 Return Value: Array - all data from Shooter Data for specific unitsetShooterData 
 Set Shooter Data for specific unitgetShotsData 
 Return Value: Array - Shots Data for specific unitgetShotsDataFromTargets 
 Return Value: Number - total amount of shots hitgetShotsDataWithFilter 
 Return Value: Array - Shot Data after custom filtersetShotsData 
 Set Shots Data for specific unitgetShootersData 
 Return Value: Array - full Shooters Data- target: Object - Target object of type "TargetBootcamp_base_F"
 setShootersData 
 Set full Shooters DataresetShootersData 
 Remove all data from Shooters Data array- target: Object - Target object of type "TargetBootcamp_base_F"
 getShooterTemplate 
 Return Value: Array - template for Shooter DatagetShotTemplate 
 Return Value: Array - template for Shot Data (see HitPart EH format)- target: Object - Target object of type "TargetBootcamp_base_F"
- shooter: Object - Unit who shot the target
- projectile: Object - ("_bullet" not used)
- position: Array format Position - ("_position" not used)
- velocity: Array - ("_velocity" not used)
- selection: Array - ("_selection" not used)
- ammo: Array - ("_ammo" not used)
- vector: Array - ("_direction" not used)
- radius: Array - ("_radius" not used)
- surfaceType: String - ("_surface" not used)
- isDirect: Boolean - true if object was directly hit, false if it was hit by indirect/splash damage.
 getShooterByUid 
 Return Value: Object - corresponding shooter unit- uid: String - Player UID of unit who shot the target
 uiOpen 
 Opens the Target Board display- target: Object - Target object of type "TargetBootcamp_base_F"
 uiOpenToAll 
 Opens the Target Board display for all connected players- target: Object - Target object of type "TargetBootcamp_base_F"
 uiOnLoad 
 Triggered when display is opened (internal)- display: Display
 uiFillTable 
 Triggered when display is opened, fills UI with Shooters Data (internal)uiFillTableRow 
 Triggered when display is opened, fills UI with Shooter Data (internal)
- Return Value:
- See above table
Examples
- Example 1:
- // open the Score Board through addAction ["uiOpen", [myTarget]] call BIS_fnc_target;
- Example 2:
- // open the Score Board for all players in MP ["uiOpenToAll", [myTarget]] call BIS_fnc_target;
- Example 3:
- // clear all data from Score Board ["resetShootersData", [myTarget]] call BIS_fnc_target;
Additional Information
- See also:
- doTarget
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
 
	
