Owner: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
Fox (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
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.
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...
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.
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.
  // We need this because the owner field gets clobbered during gameplay.
  gamevar owner 0 2
  gamevar owner -1 2
onevent EVENT_SPAWN
    getactor[THISACTOR].owner owner
endevent
   
   
  onevent EVENT_EGS
  onevent EVENT_EGS

Latest revision as of 17:10, 15 July 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 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