Eventloadactor: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Plugwash (talk | contribs)
No edit summary
No edit summary
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[eventloadactor]] runs when an actor is loaded into the map. Despite the name it is not a game event but an entirely seperate type of block ended with enda. It is most usefull for moving settings out of hitags and lotags and into [[gamevar]]s before they have unwanted hardcoded effects.
'''eventloadactor'''


  gamevar ZERO 0 0
Blocks run when an actor is loaded into the map — despite the name, it is not a game event but rather an entirely separate type of block ended with enda. It is most often used for moving settings out of a [[sprite]]'s hitag or lotag and into a [[gamevar]] before they have undesirable hardcoded effects.
  gamevar HITAGSAVED 0 2
 
  gamevar LOTAGSAVED 0 2
<pre>
  eventloadactor MYSPRITE
gamevar ZERO 0 0
gamevar HITAGSAVED 0 2
gamevar LOTAGSAVED 0 2
 
eventloadactor MYSPRITE
{
     getactor[THISACTOR].hitag HITAGSAVED
     getactor[THISACTOR].hitag HITAGSAVED
     getactor[THISACTOR].lotag LOTAGSAVED
     getactor[THISACTOR].lotag LOTAGSAVED
     setactor[THISACTOR].hitag ZERO
     setactor[THISACTOR].hitag ZERO
     setactor[THISACTOR].lotag ZERO
     setactor[THISACTOR].lotag ZERO
 
}
  enda
enda
</pre>
 
Also see [[EVENT_LOADACTOR]].
 
[[Category:EDuke commands]]
[[Category:Sprite manipulation]]

Latest revision as of 12:52, 23 November 2022

eventloadactor

Blocks run when an actor is loaded into the map — despite the name, it is not a game event but rather an entirely separate type of block ended with enda. It is most often used for moving settings out of a sprite's hitag or lotag and into a gamevar before they have undesirable hardcoded effects.

gamevar ZERO 0 0
gamevar HITAGSAVED 0 2
gamevar LOTAGSAVED 0 2

eventloadactor MYSPRITE
{
    getactor[THISACTOR].hitag HITAGSAVED
    getactor[THISACTOR].lotag LOTAGSAVED
    setactor[THISACTOR].hitag ZERO
    setactor[THISACTOR].lotag ZERO
}
enda

Also see EVENT_LOADACTOR.