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.
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
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.
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.
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.
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
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.
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.
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.
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.
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