Owner: Difference between revisions
Jump to navigation
Jump to search
Hendricks266 (talk | contribs) No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
// We need this because the owner field gets clobbered during gameplay. | // We need this because the owner field gets clobbered during gameplay. | ||
gamevar owner | gamevar owner -1 2 | ||
onevent EVENT_EGS | onevent EVENT_EGS |
Revision as of 18:53, 9 January 2014
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 a random 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