Difference between revisions of "NPC ScriptOperation Design"
Jump to navigation
Jump to search
(Created page with 'See Behavior_Operations page for most up to date description of syntax and commands. ---- == Script operations == === Common attributes === vel, $WALK|$RUN|speed|(empty) …') |
m (add to category (Engine documents)) |
||
Line 194: | Line 194: | ||
type, nearest|boss|owner|target | type, nearest|boss|owner|target | ||
range, (optional default = 2) | range, (optional default = 2) | ||
[[Category:Engine documents]] |
Revision as of 02:05, 23 October 2010
See Behavior_Operations page for most up to date description of syntax and commands.
Script operations
Common attributes
vel, $WALK|$RUN|speed|(empty)
Move Operation
Move around.
anim | The name of the animation to use |
duration | The total time for move |
ang_vel | The rotation speed to use |
Example XML:
<move vel="2" anim="walk" duration="1.0"/>
Circle Operation
...
radius anim, anim name angle, in degrees (can be 0) duration, (can be 0) ang_vel, (can be 0)
MoveTo Operation
Move to a position.
x y z anim anim name
Rotate Operation
Rotate the NPC.
type, inregion|random|absolute|relative|locatedest|target ang_vel, turn speed anim, anim name
Example XML:
<rotate type="locatedest" anim="walk" ang_vel="120" />
Locate Operation
Target something.
obj, perception|target|owner|self|tribe:(home|memory|resource)|friend|waypoint|empty static_loc, true|false (only locate once) range, optional random, true|false invisible, true|false invincible, true|false
Move to the target location.
anim, anim name
Wander Operation
Use waypoints to move to location.
anim, anim name random, true|false underground, true|false (use waypoints that are marked as underground) underwater, true|false (use waypoints that are marked as underwater) private, true|false (use waypoints that are marked as private) public, true|false (use waypoints that are marked as public) city, true|false (use waypoints that are marked as city) indoor, true|false (use waypoints that are marked as indoor)
Chase Operation
Chase a target.
anim, anim name type, nearest|boss|owner|target range, (optional, default = 2) (look for nearest target in this range) chase_range, optional (give up if target is outside this range) offset, (optional, default = 0.5) ang_vel, turn speed
Pickup Operation
Pickup an object.
obj equip count
Equip Operation
Equip something.
item slot count
Dequip Operation
Dequip something.
slot
Talk Operation
Talk.
text target, true|false (talk to target or to targeted friend npc) command (friend:command will be sent as a perception to the targeted friend npc)
Sequence Operation
Do some looping.
name cmd, start|stop|loop count
Visible Operation
Make the NPC visible.
Invisible Operation
Make the NPC invisible.
Reproduce Operation
Clone the targeted friend NPC.
Resurrect (Tribe only) Operation
Resurrect the NPC at the tribe home.
Memorize (Tribe only) Operation
Store the last perception in the tribe memory.
Melee Operation
Attack something.
seek_range melee_range invisible, true|false invincible, true|false
BeginLoop Operation
Loop some ops
iterations
EndLoop Operation
End looping.
Wait Operation
Make the NPC wait.
duration, in seconds anim, anim name
Drop Operation
Make the NPC drop something.
slot, name of slot
Transfer Operation
Make the NPC transfer something.
item, name|tribe:wealth target count
Dig Operation
Make the NPC dig.
resource, name|tribe:wealth
Debug Operation
Debug a NPC.
exclusive level
MovePath Operation
Move the NPC along a path.
path anim, anim name direction, forward|reverse
Watch Operation
Keep target on something.
range invisible invincible type, nearest|boss|owner|target range, (optional default = 2)