User Tools

Site Tools


modding:function:objdamage

Discuss this page on this pages TalkPage

objDamage

Syntax (objDamage obj weaponType objSource [pos] [options]) → result
Arguments obj: The SpaceObject to damage
weaponType: unid of weapon to use to damage the object
objSource: the source of the damage
[pos]: Position vector of the damage on the receiving object
[options]: ?
Returns result: String code representing the result of the damage
Category spaceObject functions
Description Use to damage an object directly through a function. Used on Pteravores.

objSource

  • Nil
  • SpaceObject
  • (name flags)
    • name: The string name of the cause
    • flags:
  • (obj [cause] [secondaryObj] [noun] [nounFlags])
    • obj: The source of the damage
    • cause: A destroyReason
    • secondaryObj: Unused
    • noun:
    • nounFlags:

options

  • 'fullResult
  • 'noHitEffect

result

  • 'noDamage
  • 'absorbedByShields
  • 'armorHit
  • 'structuralHit (same as armorHit, but for stations)
  • 'destroyed
  • 'passthrough
  • 'passthroughDestroyed (obj was destroyed AND the shot passed through)
  • 'destroyedAbandoned (station was destroyed)
  • “noDamageNoPassthrough”,

Example

 (objDamage gPlayership &itLaserCannon; overlayObj) 

Causes the overlayObj to damage the playership with the same damage as a laser cannon, at the center of the ship with a hit effect. In this case, you could use objGetOverlayPos to retrieve a value for the [pos] field.

Return to Space Object functions list

Return to functions list

References

modding/function/objdamage.txt · Last modified: 2017/06/26 03:40 by 0xabcdef