getAllHitPointsDamage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (return format)
m (Text replacement - " |r1=[[" to " |r1= [[")
(33 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
{{RV|type=command


{{Command|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.50
|arg= global


| arma3|= Game name
|gr1= Object Manipulation
|1.50|= Game version
|arg= global|= Arguments in MP
____________________________________________________________________________________________


| Returns 3 arrays for easy cross reference: 1st - array of hit point names, 2nd - array of hit selection names, 3rd - array of damage values. All values in all arrays are ordered accordingly to hit part index for convenience and for use in [[setHitIndex]] and [[getHitIndex]]. Levels of damage are:
|descr= Returns 3 arrays for easy cross reference: 1st - array of hit point names, 2nd - array of hit selection names, 3rd - array of damage values. All values in all arrays are ordered accordingly to hit part index for convenience and for use in [[setHitIndex]] and [[getHitIndex]]. Levels of damage are:
* 0: no damage
* 0: no damage
* 1: full damage |= Description
* 1: full damage
____________________________________________________________________________________________


| '''getAllHitPointsDamage''' vehicle|= Syntax
|s1= [[getAllHitPointsDamage]] entity


|p1= vehicle : [[Object]] - vehicle to be queried |= Parameter 1
|p1= entity: [[Object]] - object to be queried


| [[Array]] - [] if object is null or has no shape, otherwise [hitpointsNamesArray, selectionsNamesArray, damageValuesArray]|= Return value
|r1= [[Array]] - [] if entity is null or has no shape, otherwise [hitpointsNamesArray, selectionsNamesArray, damageValuesArray]
____________________________________________________________________________________________


|x1= <code>[[getAllHitPointsDamage]] [[player]];
|x1= <code>[[getAllHitPointsDamage]] [[player]];
//[
//[
// ["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"],
//["hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"],
// ["","neck","head","pelvis","spine1","spine2","spine3","body","","hands","legs"],
//["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"],
// [0,0.0939002,0.0319932,0.0858595,0.174491,1,1,0.168495,1,0.5,0.195907]
//[0,0,0,0,0,0,0,0,0,0,0,0]
//]</code> |=
//]
</code>


| [[setHitPointDamage]], [[getHitPointDamage]], [[setHitIndex]], [[getHitIndex]], [[setHit]], [[getHit]], [[setDamage]], [[damage]] |= See also
|x2= <code>[[getAllHitPointsDamage]] ([[vehicle]] [[player]]);
//[
  //["hithull","hitengine","hitengine2","hitavionics","hitfuel","hitfuel2","hitglass1","hitlaileron","hitraileron","hitlcrudder","hitrrudder","hitlcelevator","hitrelevator","#gear_f_lights"],
  //["hithull","hitengine","hitengine2","hitavionics","hitfuel","hitfuel2","hitglass1","hitlaileron","hitraileron","hitlcrudder","hitrrudder","hitlcelevator","hitrelevator"," "],
  //[0,0,0,0,0,0,0,0,0,0,0,0,0,0]
//]
</code>


|seealso= [[setHitPointDamage]], [[getHitPointDamage]], [[setHitIndex]], [[getHitIndex]], [[setHit]], [[getHit]], [[setDamage]], [[damage]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on September 27, 2015 - 00:42 (UTC)</dd>
<dt class="note">[[User:PabstMirror|PabstMirror]]</dt>
<dd class="note">Will only return '''[]''' instead of '''[[],[],[]]''' if object has no hitpoints
</dd>
</dl>
<dl class="command_description">
<dd class="notedate">Posted on April 22, 2016 - 23:40 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">To implement the PabstMirror's note, for example, cursorTarget (or cursorobject) pointing at sky returns [], but, pointing at a building like "Land_dp_smallFactory_F" returns [[],[],[]]. Hard to manage if you want to script something with the figures in third array. Try an intermediate value like _intermediate = if (getAllHitPointsDamage cursorObject isEqualTo [] or getAllHitPointsDamage cursorObject isEqualTo [[],[],[]]) then [{[[""],[""],[0]]},{getAllHitPointsDamage cursorObject}];
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 00:48, 8 August 2021

Hover & click on the images for description

Description

Description:
Returns 3 arrays for easy cross reference: 1st - array of hit point names, 2nd - array of hit selection names, 3rd - array of damage values. All values in all arrays are ordered accordingly to hit part index for convenience and for use in setHitIndex and getHitIndex. Levels of damage are:
  • 0: no damage
  • 1: full damage
Groups:
Object Manipulation

Syntax

Syntax:
getAllHitPointsDamage entity
Parameters:
entity: Object - object to be queried
Return Value:
Array - [] if entity is null or has no shape, otherwise [hitpointsNamesArray, selectionsNamesArray, damageValuesArray]

Examples

Example 1:
getAllHitPointsDamage player; //[ //["hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"], //["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"], //[0,0,0,0,0,0,0,0,0,0,0,0] //]
Example 2:
getAllHitPointsDamage (vehicle player); //[ //["hithull","hitengine","hitengine2","hitavionics","hitfuel","hitfuel2","hitglass1","hitlaileron","hitraileron","hitlcrudder","hitrrudder","hitlcelevator","hitrelevator","#gear_f_lights"], //["hithull","hitengine","hitengine2","hitavionics","hitfuel","hitfuel2","hitglass1","hitlaileron","hitraileron","hitlcrudder","hitrrudder","hitlcelevator","hitrelevator"," "], //[0,0,0,0,0,0,0,0,0,0,0,0,0,0] //]

Additional Information

See also:
setHitPointDamagegetHitPointDamagesetHitIndexgetHitIndexsetHitgetHitsetDamagedamage

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