Difference between revisions of "GetCurrentHitPoints"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =GetCurrentHitPoints(object)= Determines the number of hit points someone currently has. int  GetCurrentHitPoints(      object  oO...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{{DISPLAYTITLE:GetCurrentHitPoints(object)}}__NOTOC__
 
 
 
 
 
 
=GetCurrentHitPoints(object)=
 
 
 
 
Determines the number of hit points someone currently has.
 
Determines the number of hit points someone currently has.
 
+
<nwscript>
[[int | int ]] GetCurrentHitPoints(
+
int GetCurrentHitPoints(
    [[object | object ]] oObject = OBJECT_SELF
+
    object oObject = OBJECT_SELF
);
+
);
 +
</nwscript>
  
 
====Parameters====
 
====Parameters====
  
''oObject''
+
;oObject
 +
:The object whose hitpoints we are to retrieve. (Default: OBJECT_SELF)
  
The object whose hitpoints we are to retrieve. (Default: OBJECT_SELF)
 
 
<br />
 
  
 
====Description====
 
====Description====
Line 23: Line 17:
 
Returns the number of hitpoints oObject has and 0 if oObject is invalid.
 
Returns the number of hitpoints oObject has and 0 if oObject is invalid.
  
<br /><br />
 
  
 
====Remarks====
 
====Remarks====
  
This can be called upon any object with hit points - Doors, Placeables and so on therefore have values for this. <br /><br /> It can also be negative, if dying or dead.
+
This can be called upon any object with hit points - Doors, Placeables and so on therefore have values for this.
 +
 
 +
It can also be negative, if dying or dead.
 +
 
 +
[[GetMaxHitPoints]] can be used to get the objects maximum hitpoints; it ignores temporary effects so may actually be less than the current hitpoints a creature has.
 +
 
 +
==== Known Bugs ====
 +
 
 +
The maximum hit points of an object is 32,767 as noted in the GFF field for a creature or object (a "short" type). Going over this (eg; by using [[EffectTemporaryHitpoints]] will overflow and bug the health of a creature out. It is recommended to use this in combination with a check before applying very large values of [[EffectTemporaryHitpoints]].
  
<br />
 
  
 
====Version====
 
====Version====
Line 40: Line 40:
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
|
 
|
[[  GetPercentageHPLoss  | GetPercentageHPLoss ]]
+
[[  GetPercentageHPLoss  | GetPercentageHPLoss ]] [[GetMaxHitPoints]]
 
|-
 
|-
 
|}
 
|}

Latest revision as of 21:37, 16 September 2020

Determines the number of hit points someone currently has.

int GetCurrentHitPoints(
    object oObject = OBJECT_SELF
);

Parameters

oObject
The object whose hitpoints we are to retrieve. (Default: OBJECT_SELF)


Description

Returns the number of hitpoints oObject has and 0 if oObject is invalid.


Remarks

This can be called upon any object with hit points - Doors, Placeables and so on therefore have values for this.

It can also be negative, if dying or dead.

GetMaxHitPoints can be used to get the objects maximum hitpoints; it ignores temporary effects so may actually be less than the current hitpoints a creature has.

Known Bugs

The maximum hit points of an object is 32,767 as noted in the GFF field for a creature or object (a "short" type). Going over this (eg; by using EffectTemporaryHitpoints will overflow and bug the health of a creature out. It is recommended to use this in combination with a check before applying very large values of EffectTemporaryHitpoints.


Version

1.22

See Also

functions: 

GetPercentageHPLoss GetMaxHitPoints



 author: Tom Cassiotis, editor: Jasperre, additional contributor(s): Jasperre