Owner

From EDukeWiki
Revision as of 18:10, 15 July 2014 by Fox (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The "owner" of the sprite. If the sprite was spawned by another sprite, then owner holds the ID number of that sprite. This also determines which player in multiplayer is awarded a frag if damage from an actor kills another player.

When a projectile is deflected by a mirror, it seems to take the ID from an "invalid" player (cooperative start positions, tag 1). That is why you don't get affected by your Shrinker blast radius, but can shrink yourself using a mirror...

WARNING: This structure member is frequently clobbered during gameplay. To maintain an accurate reading of owner's non-overloaded meaning, add this at the top of your code and use the per-actor gamevar "owner" instead of using getactor each time.

// We need this because the owner field gets clobbered during gameplay.
gamevar owner -1 2

onevent EVENT_EGS
    getactor[THISACTOR].owner owner
endevent