A system to emulate Ultima 7 NPC routine activities (Tasks), based on a schedule of daily 3 hour increments.
Intended for all ultimas, and any module needing quick and easy scheduling.
Demo contains an active Gypsy Camp with 4 wagon interiors home to many scheduled NPCs and animals.
Includes optional support for Tseramed's NPC Puttering
Note : For ease of use, each time you end rest in the demo, time is moved forward by 3 hours.
Directions for use:
Import Erf.
Set NPC Heartbeat to "_schedule".
Scheduled tasks are stored in NPC variables, with a corresponding waypoint named after NPC Tag+"_"+time.
Example: if NPC Tag = "Gypsy01" with localint "9PM" = 14 (ACT_SLEEP), then Waypoint Tag = "Gypsy01_9PM".
Waypoints may exist in different areas, NPCs will travel onscreen or teleport offscreen to destinations.
Includes optional Debug Modes and AutoFix for creating missing scheduled tasks (Sleep and Loiter).
Out-of-Area NPCs Optimized to lower AI and teleport NPCs if not moving to or from PC's current area.
Functions have been arranged in library for scripting NPC tasks outside of _schedule use.
(for cutscenes, scripted plot sequences, etc).
Library Contents :
LocalInts :
Special Jobs : HEALER, FELLOWSHIP
WAITING, INPARTY if either is true will make NPC ignore scheduling
ASLEEP if sleeping
SITTING if in a chair
Special Task Waypoints
Tag + "_KITCHEN"
Tag + "_PACEH"
Tag + "_PACEH"
Interactive Item Tags
"Chair"
Autofix Waypoint Resref
"newwaypoint"
Constants :
const int USE_TS_PUTTER = FALSE;
Set to TRUE for Tseramed's putter utilization.
const int DEBUG_SCHED = 0;
0 = Quiet, 1 = Errors Only, 2 = Full Info
const int AUTO_FIX_SCHED = FALSE;
TRUE = Creates Missing Schedule Waypoints
Max number of chairs to search for inn seating
const int CHAIR_LIMIT = 5;
Scheduled Actions :
const int ACT_BAKE = 18;
const int ACT_COMBAT = 33; // in u7 it's really 0, the same as no data in nwn.
const int ACT_DANCE = 4;
const int ACT_DESK_WORK = 30;
const int ACT_DUEL = 27;
const int ACT_EAT = 5;
const int ACT_EAT_AT_INN = 26;
const int ACT_FARM = 6;
const int ACT_FOLLOW = 31;
const int ACT_GRAZE = 17;
const int ACT_HOUND = 9;
const int ACT_KID_GAMES = 25;
const int ACT_LOITER = 11;
const int ACT_LAB = 21;
const int ACT_MAJOR_SIT = 16;
const int ACT_MINER = 8;
const int ACT_PACEH = 1;
const int ACT_PACEV = 2;
const int ACT_PATROL = 29;
const int ACT_PREACH = 28;
const int ACT_SEW = 19;
const int ACT_SHY = 20;
const int ACT_SLEEP = 14;
const int ACT_STAND = 10;
const int ACT_SMITH = 13;
const int ACT_SPECIAL = 24;
const int ACT_TALK = 3;
const int ACT_TEND_SHOP = 7;
const int ACT_THIEF = 22;
const int ACT_WAIT = 15;
const int ACT_WAITER = 23;
const int ACT_WANDER = 12;
const int ACT_MOVE_2_SCHED = 32;
New Functions :
void ActionMoveNear(object oDestination)
void CheckTaskNPC(object NPCWorker, int iNPCTask)
object GetWorkplace(object NPCWorker = OBJECT_SELF)
void DoTaskBake(object NPCWorker = OBJECT_SELF)
void DoTaskCombat(object NPCWorker = OBJECT_SELF)
void DoTaskDance(object NPCWorker = OBJECT_SELF)
void DoTaskDuel(object NPCWorker = OBJECT_SELF)
void DoTaskEatAtInn(object NPCWorker = OBJECT_SELF)
void DoTaskDeskWork(object NPCWorker = OBJECT_SELF)
void DoTaskFarm(object NPCWorker = OBJECT_SELF)
void DoTaskFollow(object NPCWorker = OBJECT_SELF)
void DoTaskGraze(object NPCWorker = OBJECT_SELF)
void DoTaskHound(object NPCWorker = OBJECT_SELF)
void DoTaskKidGames(object NPCWorker = OBJECT_SELF)
void DoTaskLab(object NPCWorker = OBJECT_SELF)
void DoTaskLoiter(object NPCWorker = OBJECT_SELF)
void DoTaskMiner(object NPCWorker = OBJECT_SELF)
void DoTaskPaceH(object NPCWorker = OBJECT_SELF)
void DoTaskPaceV(object NPCWorker = OBJECT_SELF)
void DoTaskPatrol(object NPCWorker = OBJECT_SELF)
void DoTaskPreach(object NPCWorker = OBJECT_SELF)
void DoTaskShy(object NPCWorker = OBJECT_SELF)
void DoTaskSit(object NPCWorker = OBJECT_SELF)
void DoTaskSleep(object NPCWorker = OBJECT_SELF)
void DoTaskSmith(object NPCWorker = OBJECT_SELF)
void DoTaskIdle(object NPCWorker = OBJECT_SELF)
void DoTaskTalk(object NPCWorker = OBJECT_SELF)
void DoTaskTendShop(object NPCWorker = OBJECT_SELF)
void DoTaskThief(object NPCWorker = OBJECT_SELF)
void DoTaskWander(object NPCWorker = OBJECT_SELF)
void DoTaskWaiter(object NPCWorker = OBJECT_SELF)
void DoActivity(int iActivity)
Attachment | Size |
---|---|
![]() | 55.93 KB |
Trial and Terror |
83.3% |
From This Comes Strength |
98.9% |
UNDERMOUNTAIN- Maddgoth's Castle |
82.5% |
Winds of Change |
78% |
Lanterna |
78% |
Ravenloft: Dreamscape |
78.6% |
Nihil Trilogy: Awakening |
92.5% |
Night Howls in Nestlehaven V1.17 |
88.8% |
Sheep and Stone |
93.3% |
Serene |
84% |
A genuinely fun system to have. The demo presented is only half of what it is capable of doing. I will be using this for my Steampunk PW server for some realism in my npc's.