Date: 2016/02/08 17:54:44 UTC-08:00
Type: Denizen Script
#####################################################################################
# Paste this script under the "on assignment" action in the NPC's assignment script #
#####################################################################################
- flag <npc> walk
- flag <npc> pauseMin:<util.random.int[0].to[20]>
- flag <npc> pauseMax:<util.random.int[0].to[20]>
###################################
# Task script to make an NPC Walk #
###################################
Walk:
type: task
debug: false
script:
- flag <npc> walkQueue:<queue>
- while <npc.has_flag[walk]> {
- flag <npc> anchorPoint:<npc.anchor.list.random>
- ~walk <npc> <npc.anchor[<npc.flag[anchorPoint]>]> auto_range
- define waitTime <util.random.int[<npc.flag[pauseMin]>].to[<npc.flag[pauseMax]>]>
- wait <def[waitTime]>
}
- queue clear
###########################################################
# World script that re-runs the walk script upon restarts #
###########################################################
Rerun_Walk_Script:
type: world
debug: false
events:
on server start:
- wait 3s
- foreach <server.list_npcs.filter[has_flag[walk]]> {
- run Walk npc:<def[Value].as_npc>
}
- queue clear