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  Fight or Flight: A morale and retreat system.
Author  Jeff Peterson
Submitted / Updated  01-08-2003 / 11-22-2006
Category  Creature Related
Expansions  Works on all versions
Format  Module and Code
Type  Type - Combat
Includes  BioWare Standard
Description
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.

Files

NameTypeSizeDownloads
Fight_of_Flight_1.4.zipFight_of_Flight_1.4.zip
Submitted: 01-08-2003 / Last Updated: 03-05-2003
zip179.9Kb1632
--
SCORE OUT OF 10
9.75
7 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 (26):

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

---------------------------- Neverwinter Nights Community Site: The Unofficial Homepage for NWN ----------------------------

Posted by issendriel at 2008-07-27 01:20:37    Voted 9.75 on 07/27/08
Pretty awesome script. Well documented and implemented.

Posted by NorD_fr at 2007-04-21 06:54:08    Voted 10.00 on 04/21/07
Awesome script. Overlooked!
_________________________
Québec!

Posted by princewally at 2005-03-25 21:49:20    Voted 9.50 on 03/25/05
This is a great script.

Posted by Nazrohn at 2004-05-27 14:30:11    Voted 10.00 on 05/27/04

Posted by Old_Scores_Transfered at 2004-02-20 10:29:18    Voted 9.00 on 02/20/04
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.

 
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