This script will add some life to your NPCs, they can now move about doing odd jobs, making small talk, sit down, rest, etc.
It can add a lot of atmosphere if you add this script to a few NPCs in a busy place like an inn or shop.
For example, my Innkeeper moves about, fiddles with a keg, talks to patrons, turns on a light, uses a crate, takes a swig from a bottle, sits down on a chair, looks about the inn, asks a waitress to fetch something for him, etc..
The tasks are set using a couple of simple function calls in the NPC's Spawn file.
The tasks are performed in a circular or random order, during the day or night, or at a specific time.
The NPC can move into different areas to perform tasks. (E.g. Do jobs about the house in the evening, and do jobs around town in the daytime)
Read the README for more info
V3.0 allows events (3.4 of readme). Have a thief scout for targets, have a group of guards catch the thief, and escort him to jail.
Events are a very powerful and flexible addition to Version 3.0.
What it really means is now all the NPCs doing their daily routines have the ability to adapt to a changing situation.
Example:
You have created a populated village, with NPCs moving about doing their stuff...
Farmers tending fields, innkeepers serving other folk, etc...
Now say you want to trigger an orc attack:
- The trigger might occur when the PC is talking to an
NPC, and speaks a specific
line, or when the DM uses a wand to trigger the start of
the attack. etc...
- Some villagers might flee to a predetermined shelter.
- Some might don armour, take up defenses on the village towers and wait for the orcs to come within range of their bows.
- One might close & bar the gate, and start setting up defences around the gate, and then join the battle.
- One sneaky fellow might try and let some orcs in the back gate.
- When the battle is over, the NPCs might assemble at the inn to talk about how many orcs they killed, before going back to their normal routines.
Features added Version 3.0:
- Added Events for each NPC! Each NPC can now react to Area wide events (such as an orc attack on my village - everyone to Arms), or local event (such as I spotted someone trying to steal my goods).
Currently you can set each NPC to react up to 2 seperate events.
- A new area which uses events (Hideout). The guards will react to an intruder.
- Added an item : "DM NPC Event Wand", which will trigger an area wide event at the spot the DM is standing.
- NPC can set the perceive event script using SetPerceive (string) function.
This means that different NPCs may call different events depending on this script.
E.g. in the example module the guards on perceiving a foe, raise an area alarm, but Siam when she sees someone with a weapon drawn, goes and talks to them (Local event).
- New action NPC_COMMAND_RESETEVENT will reset the NPCs event, so that they go back to processing normal daily routines; back to the task they were doing before the event.
- New actions NPC_COMMAND_ENABLEEVENT1, NPC_COMMAND_ENABLEEVENT2 will enable the NPC's response to event 1 & 2 respectively.
- New actions NPC_COMMAND_DISABLEEVENT1, NPC_COMMAND_ENABLEEVENT1 will disable the NPC's response to event 1 & 2 respectively. These functions would be useful if you only want the NPC to respond to events during specified hours, or maybe if event 2 could only be triggered after event 1, etc...
- New action NPC_COMMAND_PLAYSOUND gets the NPC to start a sound object at the location of the sound object.
They stop the sound after the duration specified. The sound object must be specified in the oWaypoint element.
- New action NPC_COMMAND_CONVERSATION gets the NPC to start a full conversation with the target (a PC).
The conversation file to use is specified using the void SetConversation(string sConv) function.
- Bug fix: Now durations of under 1.0 seconds don't cause an error. Durations this short don't usually work that well anyway, because it takes at least 6 seconds to process a heartbeat.
- Bug fix: Previously, if an NPC was distracted (conversation/fight) on their way to a task, they would skip the task. This is fixed (Actually I think that this was fixed in v2.2 - but I'm not 100% sure).
- Added function void SetNPCProcessingLevel(int iValue), sets the level of processing done when there are no PCs in the same area as the NPC.
It may be set using the following values:
NPC_CPU_FULL: Normal setting (Same as version 2.2), the NPC will attempt to process its tasks as normal even though there are no PCs in the area.
Note that if there are no PCs, NWN automatically slows down the heartbeat, and uses a worse pathfinding algorithm, so the NPC could act more slowly.
NPC_CPU_DISABLEPATHFINDING: If there are no PCs in the area, the NPC, teleports around to do their tasks, so no processor power is wasted on their pathfinding.
NPC_CPU_NONE: If there are no PCs in the area, the NPC will stop all duties, until a PC enters the area.
Attachment | Size |
---|---|
![]() | 550.27 KB |
So glad I found this again! Such a great addition to the game and any world, wether single player or online. Basically it adds very simple jobs for npcs to do.
I added this to farms and gave the area so much life.