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  



NWN2 SCRIPTS

- Jump to comments -
Name  Dynamic Ambient Population System
Author  AmstradHero
Submitted / Updated  11-23-2008 / 06-28-2009
Category  Scripting routines
Type  Type - Daily Routine
Format  Code Only
Patch  1.13
NWN2Game  All
Description
Creating a realistic population to bring your areas to life with activity has never been easier!

This package allows players to create a dynamic population that will roam around an area. I developed this system for use in Fate of a City, and it offers a realistic way to have a population enter and exit an area and also allows for a significant degree of customisation.

Capabilities:
+ Dynamic creation and destruction of an ambient population.
+ Ability to adjust population number during night and day.
+ Ability to increase base population size and have multiple variations of outfits on the same base population character model.
+ Ability to have specific waypointed "day walkers" with their own unique waypoint set.

Included in this package:
+ 1 Trigger blueprint
+ 3 scripts - 1 for the trigger and 2 for the ambient population
+ 23 creature blueprints
+ 115 outfit blueprints - 5 additional sets of clothing for each creature.

-----
Quick Usage Overview

I'll assume that you've created an area in the toolset, and that you've imported the .erf file that holds the DAPS scripts. The first step is to set up the area entrances/exits for the walkers.

To do this, use the DAPS trigger blueprint and draw a trigger an area where you want your population to enter and exit the area. In order to save yourself some time, only paint down a single trigger for now. Now select the trigger and look at its properties, and open up the variables window in the scripts section. The system is run according to the values of these variables.

Dynamic walkers are great if you want to have a background population, moving around, whereas waypointed walkers are good if you want to have named characters that leave an area at night. Waypointed walkers require use of the inbuilt WP_<tag> and WN_<tag> waypoint walking system, so if you're not familiar with that, I'd suggest reading up on that first.

Going back to the trigger variables, to set up dynamic walkers, make sure you set bUseDynamic to 1. Now you need to decide on a "base" tag for the dynamic walkers, which you will use as the value for "cDynTag". Each object has a tag name, and this is used to identify the creatures that are dynamic walkers, so that DAPS knows how to create and destroy the dynamic walkers as they "enter" and "exit" the area. Let's choose something relevant to the area, say "c_castleDyn" or "c_slumsDyn".

The next items is to choose a tag for the "points of interest" within the area, which will be the value for "wpDynDestBase". Dynamic walkers will randomly choose a "point of interest" (a waypoint you will place later on) within the area and walk to it. Once they reach it, they will pause briefly, then either decide to walk to another point of interest or leave the area. Again, let's pick something relevant to the area - "WP_castleDyn" or "WP_slumsDyn". We then have to define the number of points of interest in the area. So work out the number of points of interest in the area and enter that number as the value for "nDynDestNum".

The next value (sDynBpBase) is based on the blueprint names of the population that DAPS will use. I've included blueprints for use within the system, so they are possibly the easiest to use for your first time. I believe the string is "c_commoner", but double check the blueprint ResRef to make sure.

nDynBpNum is the number of blueprints available with the specified blueprint name. Each blueprint must have a unique name, so this number is used in conjunction with sDynBpBase to create creatures - i.e. "c_commoner1", "c_commoner2" and so on. I've included 23 blueprints within the DAPS package, covering commoners, nobles and peasants. This number should be equal to the number of creature blueprints you have, as the DAPS will pick a random number between 1 and nDynBpNum whenever it goes to create a new dynamic walker. So to use all the blueprints included with DAPS, enter 23 here.

nDynBpOffset can be used for more complex set ups with multiple areas. It's mainly there to allow you to use blueprints more efficiently. It simply adds this as an offset to the chosen blueprint number. What does this mean? Say you have 50 creature blueprints. The 1-10 are peasants, 11-20 and commoners, 21-30 are nobles, 31-40 are traders and 41-50 are guards. This would allow you to exclude peasants and commoners by using a value of 20 for nDynBpOffset and a value of 30 for nDynBpNum. For a first time, it's possibly best just to leave it at 0.

wpExitTagBase is going to be the tag of waypoints that the walkers will go to in order to leave the area. These waypoints must cause the walker to cross over a DAPS trigger - so normally you'll want to place them inside a trigger. This is a string that will be the base tag of the exits. Again, let's pick something like "WP_castleDynEx" or "WP_slumDynEx". The value of nExitTagNum is the number of exit waypoints, which will correspond to the exits and entrances that dynamic walkers will leave and enter the area by.

Lastly, nDynDayNum and nDynNightNum is the maximum number of walkers that should exist in the area during day and night, respectively. Thus you can have an area heavily populated during the day and empty during the night, or vice versa.

Having set all those variables, you can now select that trigger, and copy and paste it to the other entrances and exits of your area. This is why it's good to just paint a single trigger in an area, as this way you only have to enter those variables once. Use right-mouse button, repaint trigger, to redraw the trigger for other entrances/exits.

With the triggers placed, now you need to create the waypoints for the walkers. For this, you need to make sure you paint down the same number of waypoints that you specified in nDynDestNum with the tag wpDynDestBase. You can then select them are use the right-mouse button menu to create a waypoint set to automatically number them for you. If you picked "wp_castleDyn" and "5", you will need to have waypoints with tags, "wp_castleDyn1", "wp_castleDyn2", etc.

You also need to do the same for the exit waypoints, placing them inside the exit/entrance triggers, and naming them and numbering the according to the values of wpExitTagBase and nExitTagNum.

With that in place, you should have a working dynamic walker system!

Files

NameTypeSizeDownloads
ambientpop.zipambientpop.zip
Submitted: 11-23-2008 / Last Updated: 11-26-2008
zip5.3Mb727
Ambient population package - contains .erf file, readme.txt and demo module demonstrating dynamic walkers.
SCORE OUT OF 10
8.25
4 votes
View Stats
Cast Your Vote!
Voting FAQ

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

The dynamic population in action





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

Posted by Marcai at 2010-07-08 19:38:17    
I'm somewhat glad to see I'm not the only one who's had problems with this, as I assumed it was just my ineptitude that got me here. I've tried following the instructions (both sets) for the last 6 hours and come up with nothing. The closest thing to sucess I had was copy-pasting from the practice module, and even then they'd only come from one spawn point. Upon further editing, they stopped spawning all together, and now I'm stumped.

Is there any chance of an update with this mod for ease of acess, as it really will bring my city to life!

Posted by Troy47 at 2010-04-25 01:09:31    
Can't get this to work. Even tried just taking the exact names and setup from the demo module and copying it into mine. The install guide is extremely confusing.
_________________________
Admin, Legacy: Dark Age of Britain. Link

Posted by McArcher at 2009-07-26 08:56:51    
I haven't been able to get it working in my module... This system needs a good install guide ))

Posted by Hoegbo at 2009-06-25 18:14:18    Voted 9.00 on 06/25/09
A time saver. and it works pretty well
_________________________
Link

Posted by lightninlad at 2009-06-15 17:56:19    
The module included really helped me alot about how it all comes together but thus far attempts to duplicate it in my own mod have been fruitless. I am not completely clueless when it comes to this type of thing but I seem to be missing something. Is there anyway you could contruct a do-it-yourself documentation file to help amateurs like me understand how to go out setting this up? I would appreciate it since you seemed to have done a great job with this and would like to incorporate it in my game.

Posted by lothyr at 2009-05-08 11:28:13    Voted 10.00 on 05/08/09
Amstrad,

Excellent work. The module is very helpful, but needs some documentation besides that which comes in the zip. could you perhaps provide an example set up with one of each type of walker? Thanks very much for your work.

Posted by AmstradHero at 2009-03-10 07:22:20    
I might try and tweak it a little more to reduce the set-up overhead, but by making it extremely flexible, it has to have a moderate overhead to work. It would depend on the kind of features that people wanted it to have, as then I could simplify the system and its setup.
_________________________
AmstradHero
Fate of a City
Module Development Blog
Fate of a City Blog


Posted by GandorMythos at 2009-01-28 17:20:16    Voted 5.00 on 01/28/09
I liked the idea for using this in a PW as it gives ambiance where many PWs seem to fail. It does take a bit to muddle through the comments and directions, especially when setting up a dynamic walker as opposed to a waypointed.one.
_________________________
Remnants.

Posted by NWN DM at 2009-01-02 21:55:08    Voted 9.00 on 01/02/09
Looks very good. Probably need some "scripting noob" instructions for those of us who aren't very knowledgeable in these things.

Thanks for doing this!

Posted by AmstradHero at 2008-11-29 01:24:08    
[MD]Sephiroth: I just tested the zip file currently available - it's 5.3Mb in size and definitely includes a module. Please try downloading the zip file again.
_________________________
AmstradHero
Fate of a City
Module Development Blog
Fate of a City Blog


Posted by [MD]Sephiroth at 2008-11-27 10:50:52    
Sorry but there is no module inside ;)
thanks
_________________________
Serveur Action/Rôle persistant : FR] Les Terres dechirees
Electro-pop Music : Shed

Posted by AmstradHero at 2008-11-27 00:18:03    
[MD]Sephiroth: I've updated the submission to include a module with a demo area. Please feel free to check it out.
_________________________
AmstradHero
Fate of a City
Module Development Blog
Fate of a City Blog


Posted by [MD]Sephiroth at 2008-11-25 10:49:34    
Please, could you add a module to try your system?
_________________________
Serveur Action/Rôle persistant : FR] Les Terres dechirees
Electro-pop Music : Shed

Posted by landsofkaelthia at 2008-11-24 20:26:25    
question is, is there a way to have these npcs be destroyed to reduce lag when entering trigger at night? and be replaced with bad guys?

Posted by thete at 2008-11-24 19:12:33    
Cool, v. handy, do they roam randomly or have set paths

Posted by jaz at 2008-11-24 13:42:59    
Cool. There was stuff like this for NWN1 too. I believe there were animations that could be played too (like a bartender who pours drinks). :)

Posted by Zodiac at 2008-11-23 17:19:23    
This looks good. Maybe have vampires come out at night, because they have get out sometime.

Make thiefs arrive at night as well.

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

10 - A Masterpiece, Genuinely Groundbreaking
9 - Outstanding, a Must Have
8 - Excellent, Recommended to Anyone
7 - Very Good, Deserves a Look
6 - Good, Qualified Recommendation
5 - Fair, Solid yet Unremarkable
4 - Some Merit, Requires Improvements
3 - Poor Execution, Potential Unrealized
2 - Very Little Appeal
1 - Not Recommended to Anyone

 
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 Visual Effects


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