Vm player

From EDukeWiki
Revision as of 05:55, 19 February 2020 by Fox (talk | contribs) (Created page with "This is used to determine the ID of the current player. This is what "THISACTOR" returns when using setplayer, etc. Changing this value is useful for commands that only a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is used to determine the ID of the current player. This is what "THISACTOR" returns when using setplayer, etc.

Changing this value is useful for commands that only affect the current player, such as resetplayer, etc.

In most cases, vm_sprite should also be set to reflect the player sprite (i).

It can also be used for when making a loop through all players. Example:

appendevent EVENT_WORLD
  for My_Player range MULTIMODE
  {
    setuserdef[].vm_sprite player[My_Player].i
    setuserdef[].vm_player My_Player

    [...]
  }
endevent

See also vm_sprite and vm_distance.