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  Blasco and ffbj's NPC Citizen Project
Author  Blasco-Yang and ffbj
Submitted / Updated  11-08-2009 / 01-16-2010
Category  Creature Related
Expansions  Works on all versions
Format  Module Only
Type  Type - Other
Description
This project began as nothing more than a simple demo of my Random NPC Citizens
and the Randomized Descriptions that they came equipped with.

I ended up enlisting the aid of a scripter/ idea man for whom I have the utmost respect;
"ffbj".

We soon found ourselves embroiled in one idea right after the other.

As we worked on this, I tried to maintain the distinction between what was "purely" ffbj's and what was "purely" mine, but throughout it all we passed ideas, suggestions,
and ever changing concepts, and in many cases, that distinction became somewhat
blurred.

Within the scripts you will find file and function headers which give you the author of the script and often, credit to one or the other of us.

In some situations, it was not an easy task to classify the author of the scripts. I tried to make it so that the originator of the script or function kept the title of "author", but
make no mistake, we both have our fingerprints on every inch of this stuff. lol

In the end, the best description I can come up with for this system is:

It is a Demonstration of
1) Blasco's Random NPC Generation
2) Blasco's Randomized Descriptions for NPC citizens.
3)Blasco's Random NPC Bounty
4) ffbj's Bounty Shout
5)ffbj's Daily Bounty Sheet.

I had a blast working with him on this project and hope to do so again sometime in the future.

The Demo module has all the scripts, include files, and information on how to use the system. Feel free to take what you need from it.


Files

NameTypeSizeDownloads
DEMO_The_Blasco_and_ffbj_NPC_Project.modDEMO_The_Blasco_and_ffbj_NPC_Project.mod
Submitted: 11-08-2009 / Last Updated: 11-14-2009
mod252.25Kb78
An Important Note:

I felt it should be mentioned that within the "00_Descriptions" include file you will find what basically amounts to a Random Word Generator that has the ability to create random words anywhere from 4 to 10 letters in length.

These words are suitable for use as names within a fantasy world setting (which is exactly what I made it for, and the purpose for which ffbj and I used it)

I mention it so that you may know that you can use it "standalone" by calling the function itself in any script you like.

The RandomWord function also has a built in swear filter that contains several objectionable words within the body of it so don't let your kids see it. lol
DEMO_The_Blasco_and_ffbj_NPC_Project.zipDEMO_The_Blasco_and_ffbj_NPC_Project.zip
Submitted: 11-08-2009 / Last Updated: 01-16-2010
zip87.51Kb110
VERSION 3:
Added in bounty hb to prevent normal citizens from turning hostile to the PC when they attack a bounty npc before the npc has a chance to perceive them. This will allow the PC to attack from stealth and still have the npc be hostile prior to such action. An oversight pointed out by Gonzo_og.

These scripts will generate npc's with random clothing and descriptions and a few with bounties on them. Consult the scripts for more defintions.
DEMO_The_Blasco_and_ffbj_NPC_Project.modDEMO_The_Blasco_and_ffbj_NPC_Project.mod
Submitted: 11-08-2009 / Last Updated: 11-14-2009
mod339.99Kb79
This is:
VERSION 2 of the module:
Features a modified "00_descriptions" include file with:

1) Several new random strings for the descriptions.

2) Reworked much of the grammar, and used lower case "He, his, him, She, her" where it is appropriate. The descriptions look far better in this version.

3) Added a check to insure that certain portions of the descriptions are never given (back to back) to newly created NPCs which helps to improve the appearance of the randomness of the descriptions themselves.

4) And, as suggested, added a new function to the include that can be used within the NPC Citizen's OnConversation event to allow the npc to give a random one line conversation.

Also included in this version is a new script: "gen_npc_onconv" which is added to the NPC Citizen templates in the module. It is nothing more than a simple modification of the default bioware OnConversation event script for NPCs with the new function for the Random One Line conversation called within it.
SCORE OUT OF 10
10
6 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
No Images




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

  1  2 Next>

Posted by Gonzo_og at 2010-01-19 19:28:52    Voted 10.00 on 01/19/10
Uh.. You didn't have to put my name in lights like that. It's like being an 1 second extra in a Scorcese film. Hope your oranges came out okay, and thanks for updating!
_________________________
stuff

Posted by ffbj at 2010-01-16 18:28:27    Voted 10.00 on 11/09/09
Oh it was an oversight on my part anyway. The real meat of this is the npc's and their hillarious backstories, random names, and outfits. I never tire of reading their descriptions. The bounty part is just a little mustard added for some spice.
Great Job Blasco.

Posted by Blasco-Yang at 2010-01-16 10:12:03    
Version 3 is up there now. It's the same as version 2 except for ffbj's fix concerning "innocent" npcs turning hostile when the player attacks a wanted "outlaw" npc.

Frankly, I threw that whole issue right in his lap as I was just coming off several nights of "emergency" night shift work trying to save our orange grove from a freeze.

I'm afraid I was a bit too "fuzzy" to really be capable of handling it, but he resolved the problem quickly and with his usual good nature.

Our thanks to Gonzo for bringing it up and my thanks to ffbj for shouldering the burden on his own.

Posted by ffbj at 2010-01-13 15:58:20    Voted 10.00 on 11/09/09
Odd it won't post the second part of that statement which is: < 15.0)

if (GetDistanceToObject(oPC)

Posted by ffbj at 2010-01-13 15:57:05    Voted 10.00 on 11/09/09
if (GetDistanceToObject(oPC)

Posted by ffbj at 2010-01-13 15:54:54    Voted 10.00 on 11/09/09
{
ActionUseSkill(SKILL_MOVE_SILENTLY,OBJECT_SELF);
ChangeToStandardFaction (OBJECT_SELF,STANDARD_FACTION_HOSTILE);
ClearAllActions();
if (!GetWeaponRanged(oWeapon))
{
ActionMoveToObject(oPC, FALSE, 10.0);
}
DelayCommand (1.0 + d4(), ActionAttack (oPC));
return;
}
}
}

Posted by ffbj at 2010-01-13 15:53:35    Voted 10.00 on 11/09/09
if (GetDistanceToObject(oPC)

Posted by ffbj at 2010-01-13 15:52:41    Voted 10.00 on 11/09/09
//so the idea is gets the nearest PC and if the npc has bounty set and not in combat
// and the PC is closer than 15 meters they will go stealthy and either move toward the
// PC if they have a melee weapon or stand in place and eventually fire their ranged weapon.
void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF);
if ((GetLocalInt (OBJECT_SELF,"Bounty") == 1) && (!GetIsInCombat(OBJECT_SELF)))
{
if (GetDistanceToObject(oPC)

Posted by ffbj at 2010-01-13 15:51:39    Voted 10.00 on 11/09/09
I figured I may as well post the fix I sent Blasco for it may be some time before he gets around to updating.

//so the idea is gets the nearest PC and if the npc has bounty set and not in combat
// and the PC is closer than 15 meters they will go stealthy and either move toward the
// PC if they have a melee weapon or stand in place and eventually fire their ranged weapon.
//ffbj
void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF);
if ((GetLocalInt (OBJECT_SELF,"Bounty") == 1) && (!GetIsInCombat(OBJECT_SELF)))
{
if (GetDistanceToObject(oPC)

Posted by ffbj at 2010-01-12 15:56:16    Voted 10.00 on 11/09/09
The fix is in. I sent a fix to Blasco so something should be coming down the pipe soon.
Thanks. I solved this problem in a different way in my own world and considered it might be a problem but it should be working well once the fix I sent Blasco is implemented.

Posted by Gonzo_og at 2010-01-12 09:07:34    Voted 10.00 on 01/19/10
Maybe you could just bump up the wanted NPC's perception range when it becomes wanted?
_________________________
stuff

Posted by Gonzo_og at 2010-01-12 09:06:03    Voted 10.00 on 01/19/10
Thank you two for improving NWN with scripts like these, long into it's "golden years".
_________________________
stuff

Posted by ffbj at 2010-01-12 08:19:36    Voted 10.00 on 11/09/09
Oh and add into the hb the check for a nearby PC within 25 meters or so, to prevent the npc from going hostile if no PC are nearby.

Posted by ffbj at 2010-01-12 08:17:41    Voted 10.00 on 11/09/09
This could also occur if the PC is in stealth mode and the npc does not perceive them before the PC attacks them. One way to solve it would be to add in a line to the npc's on hb which turns them hostile if when checked the local bounty has been set to 1.

Posted by Blasco-Yang at 2010-01-11 17:01:45    
To Gonzo:

Thanks for bringing that to my attention Gonzo. I tested it again and you are correct. It has to do with the NPC's OnPerception event.

We wanted to insure that once an Npc became flagged as a "wanted bounty" that it would not turn hostile while no Players were around and begin attacking "innocent npcs" so it was decided to work this out in the Npc's OnPerception and cause it to turn hostile only once it percieved a Player character.

It appears the problem arises when the "wanted" npc is attacked by the Player before it actually "percieves" the Player.

In such an instance all npcs (even those who are not flagged as wanted) will retaliate against the Player.

If the outlaw npc actually percieves the player first, then this scenario does not occur.

I will discuss this with ffbj and we will try to work out a solution as soon as possible.

Thanks again.

Posted by Gonzo_og at 2010-01-11 16:10:26    Voted 10.00 on 01/19/10
This is a really cool script. I only have one issue in the demo mod.

When using the bounty sheet, one of the NPC's becomes hostile. No problem. But when my PC engages in combat, every randomly generated NPC in the area becomes hostile and attacks my PC.

_________________________
stuff

Posted by Daijin at 2009-11-22 00:25:38    Voted 10.00 on 11/22/09
Nice work :) !!
_________________________
Dream Well, Faith, Loyalty, Truth, Honor, Friendship always.....

Daijin Dreamweaver, Leader of the Dream Warriors for 32 years, going strong.

Nwn The Dunjon Shard:
Link

Posted by Blasco-Yang at 2009-11-16 16:55:03    
Thanks for the advice CAP.

Yea I left out a few races. Specifically the ones I didn't use as templates for the npc creation.

Frankly, I've been tempted to add half orcs to the templates.

Thanks for the spelling correction as well. I've actually, always been quite good with spelling. (grammar, and punctuation not so good), but certain words I seem to continually mess up. And you found one of them: "freind".

"i" before "e" and all that gets twisted up in the old noggin. lol

Good, constructive pointers like that are what make a script/system better so long as we heed the advice.

Posted by CAP 9fires at 2009-11-16 07:38:05    Voted 10.00 on 11/08/09
In closing I'd just like to point out I misspelled 'swirling' in my last post
_________________________
Vox Populi. Vox Dei
The Community Adventure Project

Posted by CAP 9fires at 2009-11-16 07:27:23    Voted 10.00 on 11/08/09
Line 644 of 00_description... Misspelled 'freind'...

I am having a storm of my brain... There are many thing swilling... Oh yes... This is good... Very good.

Damn shame I can't vote twice.


_________________________
Vox Populi. Vox Dei
The Community Adventure Project

Posted by CAP 9fires at 2009-11-16 07:19:51    Voted 10.00 on 11/08/09
This is my function to randomly generate names... Seems to me that you left out a couple of races...

*** CODE BELOW ***
//:**************************************************************************:\\
void MyNewName (object oSelf = OBJECT_SELF)
{
//Randomly Generate Names, so that no Common NPC is without one
string sTag = GetTag (oSelf);
if (sTag == "COMMONER"){
int NAME_ME;
int nRace = GetRacialType (oSelf);
switch (nRace)//Accounts only for first names
{
case RACIAL_TYPE_DWARF:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_DWARF_MALE;
else NAME_ME = NAME_FIRST_DWARF_FEMALE;
break;
case RACIAL_TYPE_ELF:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_ELF_MALE;
else NAME_ME = NAME_FIRST_ELF_FEMALE;
break;
case RACIAL_TYPE_GNOME:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_GNOME_MALE;
else NAME_ME = NAME_FIRST_GNOME_FEMALE;
break;
case RACIAL_TYPE_HALFELF:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_HALFELF_MALE;
else NAME_ME = NAME_FIRST_HALFELF_FEMALE;
break;
case RACIAL_TYPE_HALFLING:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_HALFLING_MALE;
else NAME_ME = NAME_FIRST_HALFLING_FEMALE;
break;
case RACIAL_TYPE_HALFORC:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_HALFORC_MALE;
else NAME_ME = NAME_FIRST_HALFORC_FEMALE;
break;
case RACIAL_TYPE_HUMAN:
if (GetGender (oSelf) == GENDER_MALE) NAME_ME = NAME_FIRST_HUMAN_MALE;
else NAME_ME = NAME_FIRST_HUMAN_FEMALE;
break;
}
string MyNameIs = RandomName (NAME_ME);
SetName (oSelf, MyNameIs);
}
}
_________________________
Vox Populi. Vox Dei
The Community Adventure Project

Posted by Blasco-Yang at 2009-11-15 17:35:39    
DM Vecna: I do have a bounty system that works quite well for encounter creatures if you are interested. (In many ways it is quite similar to this system)

It's called: Blasco's Simplified Bounty Creatures and you can find it right here on the vault.

Posted by DM_Vecna at 2009-11-11 18:08:44    Voted 10.00 on 11/11/09
Really nice job here guys!

The only thing I see missing is a on spawn variation to be used for encounter based spawning/despawning and custom heads.
_________________________
Link
Link

Posted by ffbj at 2009-11-10 08:10:47    Voted 10.00 on 11/09/09
One thing on the bounty side which was Blasco's idea, was that the bounty npc does not actually have the gold that is the bounty on them. The PC just gets the gold when they kill that npc.
This prevents thieves from stealing that bounty gold off the npc, and makes more sense. Personally I never cared for the idea of turning in fingers, noses, or whatever. It's just an expedient way to rewared the PC for killing the bounty creature.

Posted by Blasco-Yang at 2009-11-09 16:20:08    
Absolutely CAP 9fires.

Feel free to do with it as you please. I'm glad you like it and can use it.

I've been using your Graphic Meters Concept and loving it. I'm glad to be able to return the favor.

As for the NPCs giving out a greeting:

I had considered this, but was actually looking into the potential of pulling a bit of text out of the NPC's own individual description field as part of a quick, non PC respondable, greeting.

This would make for fairly individualized "SpeakString" comments that personally relate to the NPC in question.

Of course, I've not yet looked too deeply into it, so doing it in that manner may not be feasible.

If not, I will inject some form of greeting anyway in a future update.

Posted by ffbj at 2009-11-09 08:16:25    Voted 10.00 on 11/09/09
Cool by me. Of course you would have to get an ok from Blasco too. I know he speaks glowingly of your CAP, btw.

Also adding in a random hello would not be a bad thought, but that's Blasco's ballywick, so the ball's in his court there. I don't usually vote on my own stuff but since I was just a part of this project I am going to vote on it. I really like what it does and how it adds, depth, or substance to a world. Just laughed my ask off on some of the descriptions.
Thanks for the votes, and great working with you Blasco on this.
Cheers!

Posted by CAP 9fires at 2009-11-08 18:46:11    Voted 10.00 on 11/08/09
Is it cool if I wrap this up in my AI? I had something similar - well a random name generator, but damn you guys took what I was thinking and made it ... a 10.

The random clothing thing... WOW what a time and resource saver... The random descriptions, superlative. I love random. Predictability sucks.
_________________________
Vox Populi. Vox Dei
The Community Adventure Project

Posted by Wazf651 at 2009-11-08 17:11:26    Voted 10.00 on 11/08/09
first time i vote,i was thinking vote was splitting

Posted by CAP 9fires at 2009-11-08 17:09:20    Voted 10.00 on 11/08/09
o.0 This looks interesting.
_________________________
Vox Populi. Vox Dei
The Community Adventure Project

Posted by Wazf651 at 2009-11-08 17:07:56    Voted 10.00 on 11/08/09
Nice! i like the random npc setup and your scripts is clean.
Suggestion: maybe one random speach liner like "hello" can put more colors to npc

  1  2 Next>

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 Original Hakpaks


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