I've long thought a system of basic morale checks was wanting from NWN. I mean, consider the goblin: a craven creature if ever there was one; yet it will stand and fight unto its own death against terrible odds. Unfortunately, I was not able to find a system that worked the way I wanted it. Flight should not only be a function of how many of your allies have been killed, but by how you stand against your individual opponent, and how your group is faring relative to your enemy's group. In this spirit, I made a mathematical model which seems to work fairly well.
Posted by Gonzo Gygax at 2009-10-27 08:11:26 Voted 9.50 on 10/27/09
I really love these script, they add a lot of flavor, even to NWN2, these scripts work just fine for NWN2 also. _________________________ Loudwater / KOW / Khalidine
Posted by The Amethyst Dragon at 2009-08-19 20:12:42 Voted 10.00 on 08/19/09
Nice looking script. Brilliant idea. I bookmarked this a looong time ago, figured I'd actually take a look at it and toss up my vote. _________________________ World of Aenea (Hall of Fame PW and the origin of all my works)
Vault Entries: The Complete List (50+ entries, including 17 Hall of Fame awards)
Self-Promotional Honesty: If you have opinions on stuff I've made, or if you use any of it (as a player or builder), I like comments/votes/feedback...so do other content makers and builders. Keep us motivated. :)
This is a compilation of the old system into a single score. There were 8 that made this score of 9.12 then rounded to 9.
Posted by Gamergeek ( ..xxx.xxx ) at 2003-07-01 11:00:00
I've modified these scripts to use the new creature scripts, if anybody wants them. They work just fine without my modication, but some of the new functionality won't work quite right... such as spawning loot on creatures, the new includes, etc. Email me at the above address if you want them.
Posted by Sgain ( ..xxx.xxx ) at 2003-05-03 21:08:00
Hiya Jeff;
Thanks for the speedy response, I tweaked my encounters with your moral system and play tested it a few times, it really seems to add more realistic behaviour to the monsters! Nice work!
I've updated both my modules here on the vault using your (modified) moral scripting. Heres a shameless plug for my modules....
The modules are; The Lost Caverns of Thracia V2.0 (version 3.0 actually) and Evil Ruins Version 1.0 (version 1.1). I hope some folks who want to check out this script take a look at it in action as it really adds to the realism.
cya
Sgain
Posted by Jeff Peterson ( ..xxx.xxx ) at 2003-05-02 06:29:00
Sure, the scripts are fairly easy to tinker with. To have a creature flee from an evenly matched opponent at 60% HP, you need to change the fRaw figure in the "fof_set" file. In this case, just get rid of all the IF statements at the bottom of the script, and stick in:
SetLocalFloat(OBJECT_SELF,"fRaw",0.3);
This will give the desired result for all FOF-tagged creatures. As far as the 13 HD limit, your solution should work, but be sure that you've also changed the last part of that line, the GetChallengeRating section.
Good luck, and enjoy!
Posted by Sgain ( ..xxx.xxx ) at 2003-05-01 12:15:00
Hiya Jeff;
First off, love the script! Works great on low level monsters and really adds a lot of flavour to encounters. My problem is that I want the script to function for all my monster encounters not just those below 6 HD.
What value should I change in your script? I opened up the fof_set and changed the HD CR setting to 13 (I figure that is the top end of 90% of the encounters in my module), but I didn't notice any changes in the responses of my opponents in the game (not like the low level gobs in the demo).
Also, how do I change the percentage of wounding before the monster cuts and runs? I figure if anything with an IQ of 5 or better would know its time to make a hasty retreat when it hits 60% hitpoint loss....in your script it says they leave when they are down to 1/6th total...way to low (in my opinion) to make a break for it.
Thanks for any help (and thanks for setting up this script, its something that really needed doing).
cya
Sgain
Posted by Ray Miller ( ..xxx.xxx ) at 2003-04-22 13:39:00
sorry about the (author) in my name. It's on the pulldown menu from my download page.
Posted by Jeff Peterson ( ..xxx.xxx ) at 2003-04-19 15:58:00
Thank you for your praise. On the commented-code issue, though, I must plead stupidity: I wrote it more to keep my brain focused than for anything else!
I'm glad you've modified it to your needs. And indeed, I myself have made a guards-related change, preventing a "defender" faction from retreating. I've been tweaking things a little bit, and may come out with an update sometime after Easter.
You mentioned the Perception issue, and this has been raised before. I guess my thought is, as I've expressed it elsewhere, that the hope of a quick victory lies in the heart of the most cowardly monster, and so the idea of a kobold coming up and whacking a high-level PC, then running away, makes sense to me. But again, modify away--as long as you make it better :)
And on that note, I would be interested in seeing the script. If it's not posted somewhere, send it to my email. Thanks again!
Posted by Ray Miller ( ..xxx.xxx ) at 2003-04-19 07:16:00
Jeff, this is a most excellent modification, and very well written. There can't be enough said for code that is clearly remarked and intuitive to decipher, especially in the world of open source.
As a matter of personal preference I removed the 5 HD cap, and added some more restrictions based on race and other situations (such as my guards... they never flee regardless of level). The modifications were very easy thanks to your clearly written code.
My one suggestion would be, since you've expressed concern about modifying too many Bioware default scripts, to move as much of the code as possible to the default user defined script. I know some things can't be moved because they rely on variables in scope, like the OnConversation script, but you get my drift.
This script was recommended to me by Wibble (his aka on this board). He uses it in his PW. I was looking for a script to stop NPCs of substantially lower level from attacking high level PCs; The "suicide on the sword blade" syndrom. I was a bit disappointed that there were no moral checks on perception. However, I don't really care to have creatures "run away" when they see a high level PC. I just don't want them to run up and skewer themselves.
To this end I've written a little on perception modification. It's not complete enough to release. All it does is stops creatures from attacking PCs whose levels are more than twice their CR. It works very well in conjunction with your script.
You can have it if you want to use it as a building block.
Or if not, if anybody else is interested I can e-mail it to you.
Posted by Jeff Peterson ( ..xxx.xxx ) at 2003-03-05 12:20:00
The most recent update addresses some of the matters that
have been mentioned: the SpeakStrings have been commented
out, some fixes have been implemented in determining who
runs the scripts and who doesn't, retreaters without
rallying points or leaders disappear after running a
certain distance, and leaders can summon help from nearby
allies. Things seem to be working quite well--thanks to
all for your helpful input!
Posted by Jeff Peterson ( ..xxx.xxx ) at 2003-02-07 15:33:00
I left those in so that people could go into the scripts
and customize strings as they saw fit...but they are easy
to remove. I believe they're at lines 102, 117, and 127 of
the fof_library script. Go in and comment them out.
But I'm uncertain why a bat should be saying these things
anyway. I checked the stats and bats, with an intelligence
of 3, should be excluded from retreat via the fof_set
script which runs OnSpawn. Is this a custom, "smart bat"
by any chance? I may have to do some testing to see how
this shakes out.
Posted by Rives Jones ( ..xxx.xxx ) at 2003-02-05 16:37:00
Awesome scripts, but, how do I get rud of the "It ain't
worth it!" speakstrings? It seems odd, for a bat to ba
saying that. Help!
Posted by zimero ( ..xxx.xxx ) at 2003-01-11 12:48:00
I deleted the archer and placed a new one at a different
location. The teleport problem dissapeared. Probably it was
just a temporary glitch.
I played around a bit with using "shouts", here are some
suggestions:
*Move some functions like GetEnemyCR, GetTheirCR, GetOurCR
to an include file. You probably need several SignalFlee
functions, used depending on if the creature has been
damaged or if he as heard a shout. By using an include you
won't have multiples of the same function -> easier to
debug.
*Add a line to the GetTheirCR, and GetOurCR, which checks
if the current creature in the loop is currently fleeing
(using your "RETREATED" localint). A fleeing creature
shouldn't count towards the total CR of the group.
Posted by Jeff Peterson ( ..xxx.xxx ) at 2003-01-11 07:47:00
Indeed, I had plans to add modifications
for "Green," "Seasoned," and "Veteran" creatures; but my
problem is that I tend to keep tinkering with a thing
beyond all reason, and I was eager to put it out there and
get some feedback. Already this has proven itself the
wiser course. Expect an update in just a few days
incorporating this and the "shouts" bit suggested by
zimero.
PS: I have noticed some weirdness with the archer in the
demo module, but I have no rational explanation for this.
Posted by Soltan ( ..xxx.xxx ) at 2003-01-11 07:41:00
A while back ago, I made a morale script for Kobolds,
before kobs were around. It was modifiable with other
creatures. I had the script scan the area for allies,
visible and hearing, and then scan for enemies that were
visible only. I then compared the CR of each and it decides
on what action the creature would take: Run, Fight at
Range, or Melee. It was all based on ADnD rules, 2nd
addition. It worked rather well too.
Also, it took into account on what actions a creature would
take on first perception of an enemy.. Such as a goblin
seeing a high level creature.. It would run if he and his
buddies weren�t strong enough and at worse odds.
Ill look for it and post it if I still have it.
Posted by Darkwind_Legion ( ..xxx.xxx ) at 2003-01-11 00:56:00
I just played with this script extensively. Thanks so
much for doing this, this is how NWN should have been from
the start.
Suicidal goblins are pretty lame. :-)
I already customized your script into several variations
of my own: Brave, Normal, Coward, etc etc. and it was
quite easy to make a few changes.
My recommendation is that you do this for the non-
scripting public. Give them several prebuilt scripts, that
is my only real recommendation for this.
Thanks again.
Posted by Jeff Peterson ( ..xxx.xxx ) at 2003-01-10 12:01:00
Thanks for the input. About the archer teleporting, that
is a mystery to me. The script in question already uses
ActionMoveToObject rather than the "force" version, so I
guess I have some more playtesting to do.
I think the OnDialog idea is a great one, and I'm already
thinking about ways to implement it. Originally, I'd hoped
to have the check run OnCombatRoundEnd, but there were
some technical problems that encouraged me to go with the
OnDamaged, which results in the rather craven behavior of
some opponents...the OnDialog is a tack I hadn't
considered, but I think it may solve many of the problems
I'd been having. Thanks again!
Posted by elandys ( ..xxx.xxx ) at 2003-01-10 11:46:00
This sounds neat - and I like zimero's suggestions.
Posted by zimero ( ..xxx.xxx ) at 2003-01-10 10:28:00
Oh, forgot one thing:
In your demo, the archer teleports to the cleric, instead
of running. I suppose this is because you use
Action*Force*MoveTo and something goes wrong with the
pathfinding?
Posted by zimero ( ..xxx.xxx ) at 2003-01-10 10:21:00
Actually, even if I really felt that this is a 'first
version' when I tested it, it is already a very cool
addition to the game.
Some points:
Often the creatures falls back one o one, waiting to be
damaged before they do it. I would like to see the
following:
*When a creature is damaged and has determined that it's
time to fall-back, he screams and runs. Then his friends
have a check on their "On Dialog" event (using listening
patterns). The check determines 1. if they heard their
friends scream 2. if they agrees that it's time to fall-
back.
Not a very detailed explanation, but I hope you understand
what I meen.
Also it would be nice if it is possible to check so that a
creature doesn't run in to the area-edge.
Great work!
Posted by Memengwa ( ..xxx.xxx ) at 2003-01-10 09:47:00
I am very thankfull that you did this. This means that I
don't have to think it out on my own :)
I haven't tried it yet, but I'm sure it's great.
You must be Logged In to post comments in this section.