Actor: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
ai -> moveflags... this was actually wrong all the time.
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
An actor is any sprite with programming applied to it. An actor is defined as such:
'''actor''' <name> <strength> <action> <move> <moveflags...><br>
 
:(actor code...)<br>
actor <name> <strength> <action> <move> <ai> { actor code } [[enda]]
[[enda]]


<name> is the name/tile of the actor. You can either input a [[define]]d name, or the tile number directly.
<name> is the name/tile of the actor. You can either input a [[define]]d name, or the tile number directly.
Line 11: Line 11:
<move> is the initial [[move]] of the actor (optional).
<move> is the initial [[move]] of the actor (optional).


<ai> is the actor's initial [[ai]] routine (optional).
<moveflags...> is is a (possibly empty) sequence of parameters that specify certain hardcoded movement behavior (optional, see [[move]]).


{ actor code } is obviously the code for the actor.
(actor code...) is the code for the actor.


[[enda]] ends an actor.
[[enda]] ends an actor.


Example actor:


[[define]] SOMEACTOR 3585
Loosely speaking, actors are sprites that run code in game, such as enemies and breakable props.  More precisely, an actor is a sprite with a [[statnum]] of 1.  Sprites with that statnum will execute their actor code once every game tic.  Prior to version 1.4, only the tile numbers hardcoded to be actors could be actors.  In the GAME.CON script file, they were designated by the [[actor]] command.


Version 1.4 introduced the [[useractor]] syntax which allows use of any tile number as an actor.


actor SOMEACTOR 0


[[ifpdistl]] 1024 { [[palfrom]] 32 0 16 0 }
Example actor:
define SOMEACTOR 3585
'''actor''' SOMEACTOR 0
ifpdistl 1024  
{  
    palfrom 32 0 16 0  
}
enda


enda
[[Category:Duke3D 1.3/1.5 commands]]
[[Category:Sprite manipulation]]

Revision as of 10:59, 17 June 2012

actor <name> <strength> <action> <move> <moveflags...>

(actor code...)

enda

<name> is the name/tile of the actor. You can either input a defined name, or the tile number directly.

<strength> is the health of the actor.

<action> is the intial action an actor uses (optional).

<move> is the initial move of the actor (optional).

<moveflags...> is is a (possibly empty) sequence of parameters that specify certain hardcoded movement behavior (optional, see move).

(actor code...) is the code for the actor.

enda ends an actor.


Loosely speaking, actors are sprites that run code in game, such as enemies and breakable props. More precisely, an actor is a sprite with a statnum of 1. Sprites with that statnum will execute their actor code once every game tic. Prior to version 1.4, only the tile numbers hardcoded to be actors could be actors. In the GAME.CON script file, they were designated by the actor command.

Version 1.4 introduced the useractor syntax which allows use of any tile number as an actor.


Example actor:

define SOMEACTOR 3585

actor SOMEACTOR 0
ifpdistl 1024 
{ 
    palfrom 32 0 16 0 
}
enda