Move: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
No edit summary
(4 intermediate revisions by 4 users not shown)
Line 3: Line 3:
Define outside an actor as so:
Define outside an actor as so:


move <name> <horizontal> <vertical>
'''move''' <name> <horizontal> <vertical>


<name> is the name of the move command.
<name> is the name of the move command.


Warning: You '''cannot''' use the same name from a [[define]], or the game will crashes.
Warning: You '''cannot''' use the same name from a [[define]], or the game will crash.


<horizontal> is the horizontal velocity of the [[actor]]. Negative values reverse direction.
<horizontal> is the horizontal velocity of the [[actor]]. Negative values reverse direction.
Line 16: Line 16:
Used inside an [[actor]], a move command is written as:
Used inside an [[actor]], a move command is written as:


move <name> <type>
'''move''' <name> <moveflags...>


<type> is a parameter set used for directional functions.
<moveflags...> is a (possibly empty) sequence of parameters that specify certain hardcoded movement behavior.


You '''cannot''' substitute <name> for a number, define, or gamevar. It has to be predefined with the first definition of move.
You '''cannot''' substitute <name> for a number, define, or gamevar. It has to be predefined with the first definition of move.


Values for <type> are:
==moveflags==


faceplayer - [[actor]] faces the player.
Values for each <moveflag> (defined in DEFS.CON) are:


geth - use horizontal velocity.
{| {{prettytable}}
 
!moveflag!!description!!internal value!!
getv - use vertical velocity.
|-
 
|faceplayer
randomangle - [[actor]] will face random direction.
|[[actor]] faces the player.
 
|align="right"|'''1'''
faceplayerslow - same as faceplayer, but done gradually.
|-
 
|geth
spin - spin in a clockwise circle.
|use horizontal velocity.
 
|align="right"|'''2'''
faceplayersmart - same as faceplayer, but with a slight "lead" on position.
|-
 
|getv
fleeenemy - [[actor]] faces away from the player.
|use vertical velocity.
 
|align="right"|'''4'''
jumptoplayer - [[actor]] will move vertically and then fall as if jumping.
|-
 
|randomangle
seekplayer - [[actor]] will try to find the best path to the nearest player.
|[[actor]] will face random direction.
 
|align="right"|'''8'''
furthestdir - [[actor]] faces the furthest distance from the closest player.
|-
 
|faceplayerslow
dodgebullet - [[actor]] attempts to avoid all shots directed at him. The [[actor]] will not avoid GROWSPARK.
|same as faceplayer, but done gradually.
|align="right"|'''16'''
|-
|spin
|spin in a clockwise circle.
|align="right"|'''32'''
|-
|faceplayersmart
|same as faceplayer, but with a slight "lead" on position.
|align="right"|'''64'''
|-
|fleeenemy
|[[actor]] faces away from the player.
|align="right"|'''128'''
|-
|jumptoplayer
|[[actor]] will move vertically and then fall as if jumping.
|align="right"|'''257'''*
|-
|seekplayer
|[[actor]] will try to find the best path to the nearest player.
|align="right"|'''512'''
|-
|furthestdir
|[[actor]] faces the furthest distance from the closest player.
|align="right"|'''1024'''
|-
|dodgebullet
|[[actor]] attempts to avoid all shots directed at him. The [[actor]] will not avoid GROWSPARK.
|align="right"|'''4096'''
|}


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

Revision as of 00:50, 11 October 2016

A move command is used to give velocity to an actor.

Define outside an actor as so:

move <name> <horizontal> <vertical>

<name> is the name of the move command.

Warning: You cannot use the same name from a define, or the game will crash.

<horizontal> is the horizontal velocity of the actor. Negative values reverse direction.

<vertical> is the vertical veloctity of the actor. Negative values cause upward motion.


Used inside an actor, a move command is written as:

move <name> <moveflags...>

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

You cannot substitute <name> for a number, define, or gamevar. It has to be predefined with the first definition of move.

moveflags

Values for each <moveflag> (defined in DEFS.CON) are:

moveflag description internal value
faceplayer actor faces the player. 1
geth use horizontal velocity. 2
getv use vertical velocity. 4
randomangle actor will face random direction. 8
faceplayerslow same as faceplayer, but done gradually. 16
spin spin in a clockwise circle. 32
faceplayersmart same as faceplayer, but with a slight "lead" on position. 64
fleeenemy actor faces away from the player. 128
jumptoplayer actor will move vertically and then fall as if jumping. 257*
seekplayer actor will try to find the best path to the nearest player. 512
furthestdir actor faces the furthest distance from the closest player. 1024
dodgebullet actor attempts to avoid all shots directed at him. The actor will not avoid GROWSPARK. 4096