Talk:Projectile

From the CreationKit Wiki
Jump to navigation Jump to search

Lobbers[edit source]

Has anybody attempted to create throwable weapons yet? --- Fowl 19:37, 22 February 2012 (EST)

Arrows with Tracers[edit source]

If you set the tracer chance to anything but 0 for projectiles fired from bows (even if you set type Missile) the arrow will actually fly in from far over your right shoulder, and just tumble through the air like it's aerodynamically challenged. --Darkconsole (talk) 2014-11-24T20:20:26 (EST)

Bug with beams getting stuck[edit source]

Sometimes, if you fire a beam spell rapidly, one of the beams will get stuck -- it won't be deleted when it's supposed to, and in fact it is often possible to select the leftover beam in the console. From that point forward, all successive attempts at firing the spell will reuse that leftover beam and its hit position, and this problem will be baked into the save. There's a reliable solution for the end user: pass through a loading screen and into another space, and then cast the spell again. However, there appears to be no way to stop the bug from happening; this is an engine-level bug.

Based on when I've seen it happening in my tests, I suspect the problem stems from the beam spell being fired too rapidly at a small area: it seems as if the problem might happen if one beam hits another beam of the same type. DavidJCobb (talk) 2016-08-27T00:16:30 (EDT)

Reverse engineering[edit source]

Behaviors common to all projectiles:

  • GetGravity - Gravity is always treated as 1.0 unless the projectile is a Missile (or arrow, given that arrows subclass missiles?).

The different projectile types override these virtual functions on the base Projectile class:

  • Arrow
    • ProcessImpacts
    • GetGravity: return fArrowWeakGravity - (this->power * (fArrowWeakGravity - Projectile::GetGravity()))). This computes to power × (gravity - weak gravity) + weak gravity. Of course, the projectile's type is "arrow;" if that doesn't count as being a missile, then gravity should always be 1.0, so this would work out to weak gravity - (power × weak gravity).
    • ShouldBeLimited: True if the internal kProcessedImpacts flag is set on the projectile instance.
    • AddImpact: Among other things, tests whether the actor can be hit by the given projectile (e.g. they're not flagged as a "ghost"), and handles the Mod Shield Deflect Arrow Chance and Apply Combat Hit Spell perk entry points.
  • Barrier
    • ProcessImpacts
    • GetKillOnCollision: Always false. (The default is "always true.")
  • Beam
    • GetKillOnCollision: Always false.
    • AddImpact
  • Cone
    • ProcessImpacts: No-op if the projectile has faded out or traveled past its range.
    • GetKillOnCollision: Always false.
    • AddImpact
    • HandleHits
  • Flame
    • RunTargetPick: Alternate logic; differences unknown. Modifies the fFlameProjectileLength animation graph variable on the projectile.
    • AddImpact: Avoids adding an impact if one already exists for the specified target.
  • Grenade
    • ReportHavokDeactivation
    • AddImpact
    • OnTriggerEnter
  • Missile
    • ProcessImpacts
    • GetKillOnCollision: True if the projectile's internal "result" value is set to "destroy."
    • AddImpact: If an impact is successfully added, sets the projectile's "result" value to the impact's own result value if it's non-"none," or to "destroy" otherwise.

Out of energy to keep digging, for now.

DavidJCobb (talk) 19:25, 16 August 2026 (EDT)