Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Ultima NPC Scheduled Activities
Author  Carcerian @ Ultima Restoration
Submitted / Updated  06-05-2008 / 06-09-2008
Category  Scripting routines
Expansions  Works on all versions
Format  Module and Code
Type  Type - Daily Routine
Forums  Link
Description
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

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)

Files

NameTypeSizeDownloads
Ultima_NPC_Schedules.modUltima_NPC_Schedules.mod
Submitted: 06-05-2008 / Last Updated: 06-05-2008
mod455.61Kb299
Scheduled Gypsy Camp Demo (requires Beta 1.69 build 10)
ultima_schedules.erfultima_schedules.erf
Submitted: 06-05-2008 / Last Updated: 06-05-2008
erf64.71Kb311
Import Files.
Ultima_NPC_Scheduling.txtUltima_NPC_Scheduling.txt
Submitted: 06-05-2008 / Last Updated: 06-05-2008
txt4.23Kb389
Directions for use.
SCORE OUT OF 10
9.83
8 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS

Ultima NPC Scheduled Activities


Gypsy Camp at Daytime


Gypsy Camp at Night


Gypsy Camp Children at play.


In the Gypsy camp a mysterious woman performs a late night ritual.


Example Use : Script Setup


Example Use : NPC's Variables for Schedule


Example Use : Waypoint Setup for a Task





You Must Be Logged In to Participate.
Comments (16):

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
Great Idea, i'll try to incorporate along with a few other things :)
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

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,

void ActionWalkNear(object oDestination)
{
ActionMoveToLocation(GetRandomLocation(GetArea(oDestination),oDestination,5.0)
,FALSE);
}

so I could use both to suite my personal taste. It works so well I had to come vote and suggest it to you..if you didn't already think of it :)

Posted by Saduj at 2008-07-10 23:13:39    Voted 10.00 on 06/06/08
To make them walk not run see :

void ActionMoveToLocation(location lDestination, int bRun=FALSE)
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

Posted by Saduj at 2008-07-10 23:02:14    Voted 10.00 on 06/06/08
Try using const int ACT_WANDER = 12;
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

Posted by Saduj at 2008-07-10 23:01:03    Voted 10.00 on 06/06/08
Well, the run/walk is a simple TRUE /FALSE change in MoveToWaypoint :)

To wander, look at "Loiter" or other tasks, many just pick a random point near workplace and wander till job is over :)
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

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
And if you like it or use it please vote!
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

Posted by Saduj at 2008-06-06 14:10:04    Voted 10.00 on 06/06/08
Note : This is a work in progress so if used be sure to check back when updated :)
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

Posted by Saduj at 2008-06-06 12:48:59    Voted 10.00 on 06/06/08
Glad you like it, this is a fairly barebones package i plan on expanding, adding detail to activities, etc, if anyone has any question on its use or suggestions on how to improve, expand or optimize it all comment are welcome :)
_________________________
Carcerian/Saduj's Submissions: (169 Portrait/Soundset Unlocker) (12 NWN Fonts) (30 NWN Fonts) (Auto-Emotes) (Custom Dragon Disciples) (Dynamic Wildshape) (Keyring) (NPC Schedules) (Sacred Shields) (Spawning Undead) (Shayans Subrace Engine for 169)

Posted by rawn_phoenix at 2008-06-06 03:46:19    Voted 10.00 on 06/06/08
AWESOME!

This is exactly what I was looking for for my upcoming PW!

Many thanks!

Posted by chaos_theocrat at 2008-06-05 18:49:57    Voted 10.00 on 06/05/08
An interesting system with a lot of potential for making more lifelike NPC activities than previously thought of.

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Other


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters