BIS fnc target: Difference between revisions
Lou Montana (talk | contribs) (Add description) |
Lou Montana (talk | contribs) (Add temp description, formatting to come by. Thanks Grezvany13 for all the data) |
||
Line 1: | Line 1: | ||
{{wip}} | |||
{{Function|Comments= | {{Function|Comments= | ||
Line 5: | Line 6: | ||
|version1= 1.00 | |version1= 1.00 | ||
|descr= | |descr= Handles the shooting targets in the Bootcamp DLC, statistics, animation, etc. (targets such as <tt>TargetBootcampHuman_f</tt>) | ||
|s1= [action, parameters] call [[BIS_fnc_target]] |SYNTAX= | |s1= [target, action, parameters] call [[BIS_fnc_target]] |SYNTAX= | ||
|p1= | |p1= target: [[Object]] | ||
|x1= | | |p2= action: [[String]] - one of:<br> | ||
'''initialize''' - Initializes the target and sets it to the "up" position | |||
<syntaxhighlight lang="cpp">params ["_target"];</syntaxhighlight> | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
'''terminate''' - Doesn't do anything | |||
'''animate''' - Animate the object to the given position ("up" or "down") | |||
<syntaxhighlight lang="cpp">params ["_target", "_position"];</syntaxhighlight> | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* position: [[String]] - "up" or "down" (default) | |||
'''getAnimationPhase''' - Returns (Integer) 0 (up) or 1 (down) depending on current state | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
'''getAnimationPhaseString''' - Returns (String)"up" or "down" depending on current state | |||
<syntaxhighlight lang="cpp">params ["_target"];</syntaxhighlight> | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
'''getAnimatedSelection''' - Returns (String) the name of the "animatedSelection" from object config | |||
<syntaxhighlight lang="cpp">params ["_target"];</syntaxhighlight> | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
'''hit''' - Handles the hit event to animate the target down and up again | |||
<syntaxhighlight lang="cpp">params ["_target", "_unit", "_damage"];</syntaxhighlight> | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* unit: [[Object]] - Unit which shot the target | |||
* damage: [[Number]] - Amount of damage done to the target | |||
'''hitPart''' - Handles the hit event and stores the data | |||
0: Array - Contains list of all parts which got hit (see HitPart EH) | |||
0: Object - Target object of type 'TargetBootcamp_base_F' | |||
1: Object - Unit which shot the target | |||
'''getShooterDataIndex''' - Get (Integer) index from Shooter Data for specific unit | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
'''getShooterData''' - Get (Array) all data from Shooter Data for specific unit | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
'''setShooterData''' - Set Shooter Data for specific unit | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
* data: [[Array]] - Shooter Data | |||
'''getShotsData''' - Return (Array) Shots Data for specific unit | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
'''getShotsDataFromTargets''' - Return (Integer) total amount of shots hit | |||
* targets: [[Array]] of [[Object]] - List of target objects of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
'''getShotsDataWithFilter''' - Return (Array) Shot Data after custom filter | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
2: String - Filter name: "time", "distance", "weapon", "direct" | |||
3: Code - Custom code to validate the shot. _this is the value of filtered data | |||
'''setShotsData''' - Set Shots Data for specific unit | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
* data: [[Array]] - Shots Data | |||
'''getShootersData''' - Return (Array) full Shooters Data | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
'''setShootersData''' - Set full Shooters Data | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* data: [[Array]] - Shooter Data | |||
'''resetShootersData''' - Remove all data from Shooters Data array | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
'''getShooterTemplate''' - Return (Array) template for Shooter Data | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* uid: [[String]] - Player UID of unit who shot the target | |||
'''getShotTemplate''' - Return (Array) template for Shot Data (see HitPart EH) | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
1: Object - Unit who shot the target | |||
2: Object - ("_bullet" not used) | |||
3: Position3D - ("_position" not used) | |||
4: Vector3D - ("_velocity" not used) | |||
5: Array - ("_selection" not used) | |||
6: Array - ("_ammo" not used) | |||
7: Vector3D - ("_direction" not used) | |||
8: Array - ("_radius" not used) | |||
9: String - ("_surface" not used) | |||
10: Boolean - True if object was directly hit, false if it was hit by indirect/splash damage. | |||
'''getShooterByUid''' - Return (Object) 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) | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* control: [[Control]] - "_listBox" | |||
'''uiFillTableRow''' - Triggered when display is opened, fills UI with Shooter Data (internal) | |||
* target: [[Object]] - Target object of type "TargetBootcamp_base_F" | |||
* control: [[Control]] - "_listBox" | |||
* data: [[Array]] - Shooter Data | |||
|p3= parameters: [[Array]] - see above | |||
|x1= <code>{{cc|open the Score Board through addAction}} | |||
["uiOpen", [myTarget]] [[call]] [[BIS_fnc_target]];</code> | |||
|x2= <code>{{cc|open the Score Board for all players in MP}} | |||
["uiOpenToAll", [myTarget]] [[call]] [[BIS_fnc_target]];</code> | |||
|x3= <code>{{cc|clear all data from Score Board}} | |||
["resetShootersData", [myTarget]] [[call]] [[BIS_fnc_target]];</code> | |||
|seealso= [[doTarget]] | |seealso= [[doTarget]] |
Revision as of 11:19, 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:
- [target, action, parameters] call BIS_fnc_target
- Parameters:
- target: Object
- action: String - one of:
initialize - Initializes the target and sets it to the "up" positionparams ["_target"];
- target: Object - Target object of type "TargetBootcamp_base_F"
terminate - Doesn't do anything animate - Animate the object to the given position ("up" or "down")
params ["_target", "_position"];
- target: Object - Target object of type "TargetBootcamp_base_F"
- position: String - "up" or "down" (default)
getAnimationPhase - Returns (Integer) 0 (up) or 1 (down) depending on current state
- target: Object - Target object of type "TargetBootcamp_base_F"
getAnimationPhaseString - Returns (String)"up" or "down" depending on current state
params ["_target"];
- target: Object - Target object of type "TargetBootcamp_base_F"
getAnimatedSelection - Returns (String) the name of the "animatedSelection" from object config
params ["_target"];
- target: Object - Target object of type "TargetBootcamp_base_F"
hit - Handles the hit event to animate the target down and up again
params ["_target", "_unit", "_damage"];
- target: Object - Target object of type "TargetBootcamp_base_F"
- unit: Object - Unit which shot the target
- damage: Number - Amount of damage done to the target
hitPart - Handles the hit event and stores the data
0: Array - Contains list of all parts which got hit (see HitPart EH) 0: Object - Target object of type 'TargetBootcamp_base_F' 1: Object - Unit which shot the target
getShooterDataIndex - Get (Integer) index from Shooter Data for specific unit
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
getShooterData - Get (Array) all data from Shooter Data for specific unit
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
setShooterData - Set Shooter Data for specific unit
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
- data: Array - Shooter Data
getShotsData - Return (Array) Shots Data for specific unit
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
getShotsDataFromTargets - Return (Integer) total amount of shots hit
- targets: Array of Object - List of target objects of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
getShotsDataWithFilter - Return (Array) Shot Data after custom filter
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
2: String - Filter name: "time", "distance", "weapon", "direct" 3: Code - Custom code to validate the shot. _this is the value of filtered data
setShotsData - Set Shots Data for specific unit
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
- data: Array - Shots Data
getShootersData - Return (Array) full Shooters Data
- target: Object - Target object of type "TargetBootcamp_base_F"
setShootersData - Set full Shooters Data
resetShootersData - Remove all data from Shooters Data array
- target: Object - Target object of type "TargetBootcamp_base_F"
getShooterTemplate - Return (Array) template for Shooter Data
- target: Object - Target object of type "TargetBootcamp_base_F"
- uid: String - Player UID of unit who shot the target
getShotTemplate - Return (Array) template for Shot Data (see HitPart EH)
- target: Object - Target object of type "TargetBootcamp_base_F"
1: Object - Unit who shot the target 2: Object - ("_bullet" not used) 3: Position3D - ("_position" not used) 4: Vector3D - ("_velocity" not used) 5: Array - ("_selection" not used) 6: Array - ("_ammo" not used) 7: Vector3D - ("_direction" not used) 8: Array - ("_radius" not used) 9: String - ("_surface" not used) 10: Boolean - True if object was directly hit, false if it was hit by indirect/splash damage.
getShooterByUid - Return (Object) 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)
- parameters: Array - see above
- Return Value:
- Return value needed
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