Skip to content

Projectile proxy (self.projectile)

Bound on script tables as self.projectile. Only these members are available; unknown names are rejected.

Source: Utils/Lua/LuaProjectileApi.cs.

Properties

Name Lua type Access Notes
BaseSpriteVisible boolean Read/write Whether the loaded projectile draws its base sprite. Reads true and ignores writes on unsupported hosts.
HarmsItems boolean Read/write Allow automatic collisions with world items that accept projectile collisions. Item collision policy for this local simulation. Does not affect terrain or structure collisions. Reads false and ignores writes when absent. Changes are not automatically replicated.
HarmsMobs boolean Read/write Allow automatic collisions with creatures. Creature collision policy for this local simulation. HarmsOwner must also be true to hit a creature owner; native family and protected-creature exclusions still apply. Does not restrict explicit DealDamage calls or affect terrain collisions. Reads false and ignores writes when absent. Changes are not automatically replicated.
HarmsOwner boolean Read/write Allow automatic collisions with the living owner when its player or creature category is enabled. Living-owner collision policy for this local simulation. Requires HarmsPlayers or HarmsMobs as appropriate; other native collision exclusions still apply. Does not restrict explicit DealDamage calls. Reads false and ignores writes when absent. Changes are not automatically replicated.
HarmsPlayers boolean Read/write Allow automatic collisions with players. Player collision policy for this local simulation. HarmsOwner must also be true to hit a player owner. Does not restrict explicit DealDamage calls or affect terrain collisions. Reads false and ignores writes when absent. Changes are not automatically replicated.
IsDead boolean Read/write Whether the projectile is marked for removal. Reads false and ignores writes when the projectile is absent.
LifeTime integer Read/write Remaining lifetime in milliseconds. Positive values count down; non-positive values do not expire through the lifetime countdown. Reads 0 and ignores writes when the projectile is absent.
MaxDamage number Read/write Maximum damage before the target's damage reduction and applicable native weapon modifiers. Damage points in this local simulation. Requires a finite nonnegative value; invalid values are ignored without changing damage. Lowering this below MinDamage also lowers MinDamage. Reads 0 and ignores writes when absent. Changes are not automatically replicated.
MaxLifeTime integer Read/write Configured maximum lifetime in milliseconds. Changing this does not reset LifeTime. Reads 0 and ignores writes when the projectile is absent.
MinDamage number Read/write Minimum damage before the target's damage reduction and applicable native weapon modifiers. Damage points in this local simulation. Requires a finite nonnegative value; invalid values are ignored without changing damage. Raising this above MaxDamage also raises MaxDamage. Reads 0 and ignores writes when absent. Changes are not automatically replicated.
Owner Player or EntityView or Creature or Item or Projectile or OwnerToken or nil Read/write Allowlisted entity that fired or owns the projectile. Getters return Player, EntityView, Item, Projectile, an opaque OwnerToken, or nil; living non-player owners become EntityView. Setters also accept Creature, or nil to clear ownership. Other values unwrap to nil. Writes are ignored when the projectile is absent.
Pos Vector2 Read/write Position in world pixels. Returns a Vector2 value copy; assign the whole vector to move the projectile. Reads (0, 0) and ignores writes when the projectile is absent.
VelX number Read/write Horizontal velocity in pixels per simulation update. Reads 0 and ignores writes when the projectile is absent.
VelY number Read/write Vertical velocity in pixels per simulation update. Reads 0 and ignores writes when the projectile is absent.

Methods

Lua call Arguments Returns Notes
self.projectile:DealDamage(target, piercePercent) target: Player or EntityView or Creature or nil — Living Player, EntityView, or Creature. Nil does nothing; non-living values are ignored.
piercePercent: number — Armor-piercing fraction from 0 to 1. The current direct-damage pipeline ignores this argument.
no return value Deal projectile damage to a living target in this simulation, bypassing the automatic HarmsPlayers, HarmsMobs, and HarmsOwner collision policies. Nil and non-living values do nothing, as does an absent projectile.
self.projectile:HasTag(tag) tag: string — Authored tag string. boolean — False when the host is absent or does not support this operation. Check an authored loaded projectile tag.
self.projectile:IsProjectileSettled() None boolean — False when the host is absent or does not support this operation. Check whether a loaded projectile has settled.
self.projectile:LoadSoundEffect(label, path) label: string — Authored sound or light label.
path: string — Content sound asset path.
no return value Load a named loaded projectile sound clip. Unsupported hosts do nothing.
self.projectile:PlaySoundEffect(label, volume, pitch) label: string — Authored sound or light label.
volume: number (optional); default 1 — Volume multiplier from 0 to 1. Defaults to 1.
pitch: number (optional); default 0 — Pitch adjustment from -1 to 1; 0 is unchanged. Defaults to 0.
no return value Play a named loaded projectile sound clip. Unsupported hosts do nothing.
self.projectile:TriggerContinuousPFX(key, offsetX, offsetY) key: string — Authored particle-effect key.
offsetX: number (optional); default 0 — Horizontal pixel offset. Defaults to 0.
offsetY: number (optional); default 0 — Vertical pixel offset. Defaults to 0.
no return value Trigger an authored continuous loaded projectile effect with pixel offsets. Unsupported hosts do nothing.
self.projectile:TriggerOneShotPFX(key) key: string — Authored particle-effect key. no return value Trigger an authored loaded projectile particle-effect key once. Unsupported hosts do nothing.
CLR declaration reference

These names identify the backing engine source declarations.

  • Boolean BaseSpriteVisible
  • Boolean HarmsItems
  • Boolean HarmsMobs
  • Boolean HarmsOwner
  • Boolean HarmsPlayers
  • Boolean IsDead
  • int LifeTime
  • float MaxDamage
  • int MaxLifeTime
  • float MinDamage
  • object Owner
  • Vector2 Pos
  • float VelX
  • float VelY
  • void DealDamage(object target, float piercePercent)
  • Boolean HasTag(String tag)
  • Boolean IsProjectileSettled()
  • void LoadSoundEffect(String label, String path)
  • void PlaySoundEffect(String label, float volume = 1, float pitch = 0)
  • void TriggerContinuousPFX(String key, float offsetX = 0, float offsetY = 0)
  • void TriggerOneShotPFX(String key)

Generated 2026-10-02T21:05:27.5090099Z · b8c9ae78 · 21 members.

Official modding overview · Signs of Life on Steam