Difference between revisions of "031D"

From GTAMods Wiki
Jump to navigation Jump to search
(page updates + values named)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Icon|trilogy}} '''HAS_CHAR_BEEN_DAMAGED_BY_WEAPON'''
+
{{OpCode
<hr />
+
| games      = {{Icon|t}}
'''Description'''
+
| command    = HAS_CHAR_BEEN_DAMAGED_BY_WEAPON
: Checks if the character has been damaged by the specified weapon type
+
| description = Checks if the character has been damaged by the specified [[weapon]] or environment
'''Syntax'''
+
| syntax1    = 031D: &nbsp; actor [''char handle''] hit_by_weapon [''int'']
: 031D: &nbsp; actor [''char handle''] hit_by_weapon [''int'']
+
| p1t        = [''char handle'']
'''Parameter'''
+
| p1d        = The handle of the character
: [''char handle'']
+
| p2t        = [''int'']
:: The handle of the character
+
| p2d        = [[Weapon#Lists of weapons|Weapon type]] (or environmental damage type listed below)
: [''int'']
+
| native      = [[HAS_CHAR_BEEN_DAMAGED_BY_WEAPON]]
:: Weapon type (see [[Weapon#Lists of Weapons|this]] in addition to below)
+
}}
'''Native analog'''
 
: [[HAS_CHAR_BEEN_DAMAGED_BY_WEAPON]]
 
  
This conditional opcode returns true if the character has been damaged by the specific weapon or environment. The last damage done to the character can be cleared using opcode [[0467]]. Weapon numbers for projectiles do not get recognized so other values have to be used. Values outside the range of weapon numbers are supported for a variety of environmental damage.
+
This conditional opcode returns true if the character has been damaged by the specified weapon or environment. The last damage done to the character can be cleared using opcode [[0467]]. Values outside the range of weapon types are supported for a variety of environmental damage. Weapon types for projectiles do not get recognized so environmental damage types have to be used instead.
  
Vice City:
+
== Environmental damage values ==
{| class="wikitable"
+
{|class="wikitable center-col-1 center-col-2"
! Type || Enum || Notes
+
!style="width: 2em;" |{{Icon|3}}
 +
!style="width: 2em;" |{{Icon|VC}}
 +
![[SCM language III/VC definitions#WEAPONTYPE|Enum]]
 +
!Notes
 
|-
 
|-
| 31 || WEAPONTYPE_FLAMETHROWER || fire, not just Flamethrower
+
| - ||28 ||WEAPONTYPE_SNIPERRIFLE ||opcode [[0321]] or [[0322]] (explode head)
 
|-
 
|-
| 39 || WEAPONTYPE_RAMMEDBYCAR || helicopter blades
+
|9 ||31 ||WEAPONTYPE_FLAMETHROWER ||any fire, not just Flamethrower
 
|-
 
|-
| 40 || WEAPONTYPE_RUNOVERBYCAR || vehicle collision
+
|16 ||39 ||WEAPONTYPE_RAMMEDBYCAR ||damaged but not killed by vehicle
 
|-
 
|-
| 41 || WEAPONTYPE_EXPLOSION || explosion
+
|17 ||40 ||WEAPONTYPE_RUNOVERBYCAR ||instantly killed by vehicle, includes helicopter blades
 
|-
 
|-
| 42 || WEAPONTYPE_UZI_DRIVEBY || drive-by
+
|18 ||41 ||WEAPONTYPE_EXPLOSION ||explosion
 
|-
 
|-
| 43 || WEAPONTYPE_DROWNING || water
+
|19 ||42 ||WEAPONTYPE_UZI_DRIVEBY ||drive-by
 
|-
 
|-
| 44 || WEAPONTYPE_FALL || ground collision
+
|20 ||43 ||WEAPONTYPE_DROWNING ||water
 
|-
 
|-
| 46 || WEAPONTYPE_ANYMELEE || any melee
+
|21 ||44 ||WEAPONTYPE_FALL ||ground damage
 
|-
 
|-
| 47 || WEAPONTYPE_ANYWEAPON || any weapons (melee, fire, gun, explosion)
+
| - ||46 ||WEAPONTYPE_ANYMELEE ||any melee
 +
|-
 +
| - ||47 ||WEAPONTYPE_ANYWEAPON ||any weapon (melee, fire, gun, explosion)
 
|}
 
|}
  
[[Category:OpCodes]]
+
== Keywords ==
 +
has, actor, character, been, damaged, damage, hit, by, weapon

Latest revision as of 06:43, 8 July 2017

GTA III Vice City San Andreas HAS_CHAR_BEEN_DAMAGED_BY_WEAPON


Description
Checks if the character has been damaged by the specified weapon or environment
Syntax
031D:   actor [char handle] hit_by_weapon [int]
Parameter
[char handle]
The handle of the character
[int]
Weapon type (or environmental damage type listed below)
Native analog
HAS_CHAR_BEEN_DAMAGED_BY_WEAPON

This conditional opcode returns true if the character has been damaged by the specified weapon or environment. The last damage done to the character can be cleared using opcode 0467. Values outside the range of weapon types are supported for a variety of environmental damage. Weapon types for projectiles do not get recognized so environmental damage types have to be used instead.

Environmental damage values

GTA III Vice City Enum Notes
- 28 WEAPONTYPE_SNIPERRIFLE opcode 0321 or 0322 (explode head)
9 31 WEAPONTYPE_FLAMETHROWER any fire, not just Flamethrower
16 39 WEAPONTYPE_RAMMEDBYCAR damaged but not killed by vehicle
17 40 WEAPONTYPE_RUNOVERBYCAR instantly killed by vehicle, includes helicopter blades
18 41 WEAPONTYPE_EXPLOSION explosion
19 42 WEAPONTYPE_UZI_DRIVEBY drive-by
20 43 WEAPONTYPE_DROWNING water
21 44 WEAPONTYPE_FALL ground damage
- 46 WEAPONTYPE_ANYMELEE any melee
- 47 WEAPONTYPE_ANYWEAPON any weapon (melee, fire, gun, explosion)

Keywords

has, actor, character, been, damaged, damage, hit, by, weapon