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 Link
Note : For ease of use, when you end rest in the demo time is move forward 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
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;
Posted by OldTimeRadio at 2012-07-30 21:49:05 Voted 10.00 on 07/30/12
This is a great system! I can't believe I hadn't voted for this yet.
Posted by Raven_Blood at 2008-09-23 11:46:14 Voted 7.00 on 09/23/08
This is perfect for what ive been seraching for :O
im not much of a scripter, but ive been attempting to make npcs more "life like" in terms of a night/ day function. Kudos to you for making such a great idea for us all :)
Posted by Inayity at 2008-09-11 19:26:01 Voted 10.00 on 06/17/08
The more I use this the more I love it! Thanks again! I'm really getting some good mileage out of this thing and it saves SO much time! (not to mention covering for some scripting deficits on my part)
Posted by Saduj at 2008-07-30 00:33:42 Voted 10.00 on 06/06/08
Posted by Catoptromancer at 2008-07-26 16:16:05 Voted 10.00 on 07/26/08
Hi Saduj, love the scripts!
I was having a similar issue, thought the running looked really odd in tasks such as patrol, farm and tend shop.
The only problem I had with setting ActionMoveToLocation in ActionMoveNear to FALSE is that the running is perfect for animals, playing children, dancing and dueling..etc.
What I did was add a function to your include,
Posted by V-eZ-duH at 2008-07-08 09:54:44 Voted 9.00 on 07/07/08
Actually, nevermind. I'd only like the NPCs to walk during the "Wander" scheduled task. Any help on this would be most appreciated.
Posted by V-eZ-duH at 2008-07-07 21:39:19 Voted 9.00 on 07/07/08
Really loving the script. Thank you! However, I'd like to get the NPCs to only walk during their scheduled actions; no random running. My lame attempts at scripting this within the system itself utterly failed. Also, would it be at all possible to fire the "ActionRandomWalk" script when scheduling an NPC to "Wander"?
Posted by Inayity at 2008-06-17 13:10:08 Voted 10.00 on 06/17/08
Great script!
Posted by Saduj at 2008-06-06 17:17:59 Voted 10.00 on 06/06/08