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  CODI Core AI v1.1
Author  NamelessOne
Submitted / Updated  05-03-2003 / 11-22-2006
Category  Creature Related
Expansions  Works on all versions
Format  Module and Code
Type  Type - Combat
Includes  Custom
Description
The idea behind this project has been to create a set of artificial intelligence scripts for combat that can be easily configured and extended to suit the needs of the community. Configuration is simple enough that even those with little or no scripting experience should be able to get creatures behaving as they want, while the extensibility allows those with scripting experience to add new behaviours and integrate them with the existing core set of behaviours with a small amount of work. The core behaviours provided with the package were written with the approach of making the creatures fight more like humans fight when playing NWN. It tries to simulate the creatures being more aware of what is happening around them, using their abilities more intelligently, and especially improving the teamwork of groups of creatures. If you have questions about these scripts or need help with any aspect of their use please direct them to the Scripting board in the forums at the CODI site.

Files

NameTypeSizeDownloads
CODICoreAIv11.zipCODICoreAIv11.zip
Submitted: 05-03-2003 / Last Updated: 12-22-2003
zip2Mb6667
--
SCORE OUT OF 10
9.96
9 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





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

  1  2  3 Next>

Posted by Xovian at 2010-02-01 21:25:07    Voted 10.00 on 02/01/10
It's a bit late, but well done.

Posted by Almighty God at 2009-07-19 16:38:23    Voted 10.00 on 07/19/09
Hm. Everithing's still very stupid but that is quite an improvement. Quite a big one :>
_________________________
[...] And the world was created. [...]

Posted by Katdoral at 2008-10-09 16:09:52    Voted 10.00 on 10/09/08
Absolutely great ai system, adding my vote now

Posted by Luusah at 2008-07-18 01:59:08    Voted 10.00 on 07/18/08
The best AI out there!

Posted by Kergael at 2008-06-26 07:22:52    Voted 10.00 on 06/26/08
Thank you very much for this interesting and very useful script :)
_________________________
Tell me how you play, I'll tell you who you are...

Posted by Shargast at 2007-10-14 01:42:37    Voted 10.00 on 10/09/07
Rewrite of CODI AI no_ai_dh with respawning creatures integrated into the code.

I've partially written and partially patched this code together and I'm in the initial testing period. It seems to be adjusting faction (prr system), droping weapons (se_drop_weapons) and respawning the creatures in question as well as interfacing with the CODI AI system.

Rather pleased atm - could someone please have a look at my code and clean it up (as I have the feeling that some things in there are not quite right).

Appreciate any help

NWScript:

//::///////////////////////////////////////////////
//:: On Death -- no_ai_dh_dorg// Kast // Raien
//:: replaces no_ai_dh in CODI AI
//:: Patched and jimmied by Shargast
//:://////////////////////////////////////////////
/*
On Death script incorporating prr, weapon drop,
simple creature respawn and CODI AI system
(used in conjunction with the entire CODI AI system)
*/
//:://////////////////////////////////////////////

#include "_prr_main"
#include "no_lib_data"
#include "no_inc"
#include "se_drop_weapons"

void RespawnObject(string sTag, int iType, location lLoc) {
// ResRef must be derivable from Tag
string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16));
CreateObject(iType, sResRef, lLoc);
}
void main()
{
// Scarfaces xp system
ExecuteScript("sf_xp", OBJECT_SELF);
// End Sf_xp system

// prr faction adjustment 1 of 3 factions
object oPC = GetLastKiller();
PRR_Adjust_Enemy_Factions(oPC, "", "FACTION_FOCUS_DORGANIENS", -10);
// end prr fact. adj

// Sir Elrics drop weapon system
SE_DropHandSlot(OBJECT_SELF, INVENTORY_SLOT_LEFTHAND, 180.0, TRUE);
SE_DropHandSlot(OBJECT_SELF, INVENTORY_SLOT_RIGHTHAND, 180.0, TRUE);
// End se_drop_weapons

string sTag = GetTag(OBJECT_SELF);
int iType = GetObjectType(OBJECT_SELF);
// For creatures, save the location at spawn-time as a local location and
// use it instead. Otherwise, the creature will respawn where it died.
location lLoc = GetLocation(OBJECT_SELF);
float fDelay = 360.0; // 6 minute delay
AssignCommand(GetArea(OBJECT_SELF),

DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc)));
//CODI AI Creature Death scripting
//float fDieDelay = GetLocalFloat( OBJECT_SELF, "#DECAYDELAY" );
//corpse decay deactivated for Murray module
float fDieDelay = 10.0;
ClearAllActions();
//broadcast death
SpeakString( "BC_DEAD", TALKVOLUME_SILENT_TALK );
//PrintString( GetName( OBJECT_SELF ) + " killed by " + GetName( GetLastKiller() ) );
if ( GetName( GetItemInSlot( INVENTORY_SLOT_CARMOUR, OBJECT_SELF ) ) == "Balor Properties" )
{
ExecuteScript( "nw_s3_balordeth", OBJECT_SELF );
}
DelayCommand( fDieDelay, ExecuteScript( "no_scr_cleanvars", OBJECT_SELF ) );
DelayCommand( fDieDelay + 0.5, ExecuteScript( "no_scr_excorpse", OBJECT_SELF ) );
//signal death to userdef
//End CODI AI creature death scripting
SignalEvent( OBJECT_SELF, EventUserDefined( 1007 ) );
}



Best
Sai
_________________________
Realms of Shargast V1-V5ab, LOTR V15, The Undeath Clave & Faithful of Aerth

Posted by Shargast at 2007-10-09 23:43:49    Voted 10.00 on 10/09/07
3 votes and 5000 dl's - the world is not fair!!

Well put together user-friendly system that requires only logical thinking to implement! Along the way I learned also quite a bit about scripting! The inlcluded module was a nice touch to get me started!

Thanks a bundle!

Best
Sai aka Shargast
_________________________
Realms of Shargast V1-V5ab, LOTR V15, The Undeath Clave & Faithful of Aerth

Posted by Dreggas ( 70.34.xxx.xxx ) at 2005-12-14 06:57:34    
Has anyone had an issue with knockdown NOT working on the creatures using this script set??? If so what was the solution, we have had creatures be knocked down yet they continue to slide across the screen, get up and continue to run as if nothing happened.

Posted by Arlain ( 58.164.xxx.xxx ) at 2005-10-11 17:34:17    
Ok is there an updated version of the AI or is it just that the documentation is now out of date?

Posted by NamelessOne at 2005-07-01 23:53:31    
"is there any way to make creatures duel-wield?"

If the creatures are spawned dual-wielding they'll attempt to use those weapons whenever they're in melee. If they've been disarmed and lost one of their weapons they may try to pick the weapon up to wield it again if it's still on the ground.

Posted by commche at 2005-05-17 00:56:27    Voted 9.75 on 03/14/05
is there any way to make creatures duel-wield?
_________________________
Modules:
Shadows of Darkmoon
The Arena of Champions
Dragon's Bane
Scripts:
Random Loot Generation System v1.0
Supernatural Subrace System
PW Monk-speed balancer

Posted by commche at 2005-03-14 07:15:04    Voted 9.75 on 03/14/05
Fine work indeed!
_________________________
Modules:
Shadows of Darkmoon
The Arena of Champions
Dragon's Bane
Scripts:
Random Loot Generation System v1.0
Supernatural Subrace System
PW Monk-speed balancer

Posted by Plundar ( 4.19.xxx.xxx ) at 2004-10-26 13:52:00    
Here is an interesting post by AlanC9.

*****

Well, isn't that special? Look at this comment from x0_i0_talent:

"ISSUE 1: The check in this function to use a random ability
after failing to use best will fail in the following
case. The creature is unable to affect the target with the
spell and has only 1 spell of that type. This can
be eliminated with a check in the else to the effect of :

else if(!CompareLastSpellCast (GetIdFromTalent(tUse)) )

This check was not put in in version 1.0 due to time constraints.
May cause an AI loop in some Mages with limited spell selection."


Apparently the AI thinks Charm, Hold, and Dominate spells can't hurt PCs. Spellcasters with only one of those spells will AI loop. Test it yourselves.

IOW, Bio's always known about this problem.

****

Just wanted to make sure people knew about this.

Posted by 9Fires ( 24.70.xxx.xxx ) at 2004-07-03 17:24:00    
I still care

Posted by merentha at 2004-04-01 07:31:29    Voted 10.00 on 04/01/04

_________________________
Currently awfg and deep into cyberpunk of AO, but I'll eventually come back to NWN :)

No wait, playin' DDO! But I've got a copy of NWN2 to load up and play ><

Posted by mcjesus at 2004-02-23 22:47:00    
A number of the scripts don't compile. Unfortunately I found this out after I spent several hours applying these scripts to every creature in my module.

Posted by Old_Scores_Transfered at 2004-02-20 10:29:22    Voted 9.00 on 02/20/04
This is a compilation of the old system into a single score. There were 24 that made this score of 9.28 then rounded to 9.

Posted by merentha at 2004-02-20 04:34:00    Voted 10.00 on 04/01/04
Open the script editor inside the toolset for your module that uses the CODI AI then do a search for "SendMessageToDM" on all files in the module...if the script that has that function is called no_* then open it and see if it's the offending line(s). BTW, if I miswrote the call just look for it under functions on the right hand panel of the script editor, it'll turn up.-Merentha
Purveyor of Fine Music, Fine Wines and Fine Women!
(hey we all dream!)
_________________________
Currently awfg and deep into cyberpunk of AO, but I'll eventually come back to NWN :)

No wait, playin' DDO! But I've got a copy of NWN2 to load up and play ><

Posted by Weld ( ..xxx.xxx ) at 2004-02-19 16:17:00    
OK, so I get the point that nobody has a clue.

Firstly, why does CODI when used make the NPCs send messages to the DM channel on attack? And why can't I find where it does that? *grumble*

Secondly: where do I find the function InitCombat()? I've searched through all the linked include files.

Posted by Weld ( ..xxx.xxx ) at 2004-02-19 13:59:00    
And what is up with the triggering user defined events when there is no user defined script file in the package?

Posted by Weld ( ..xxx.xxx ) at 2004-02-19 13:49:00    
That post doesn't seem to help. I just installed these scripts into my PW and set them up on a few choice NPCs. Was nice to see some NPCs with brains! But after awhile (and after they killed my test subject a few times) they just stopped attacking.

They were still activating the attack shout, which means they did perceive - but they'd just stand there. I think after a little while of one-hit and run from the player, they started attacking again.

Anyone using this AI unmodified from this post and it works perfectly?

Posted by merentha at 2004-01-24 09:22:00    Voted 10.00 on 04/01/04
I just had a dragon chase me across areas last night and when we finished transitioning I stood in place and unloaded all spells and a number of scrolls taking it down. The entire time the dragon just stood facing me. The scripts this particular beast was on are the AI scripts I got from here. In case the info helps...I had just assumed it was because after we transitioned it shifted me behind the area transition point on that map and so I may have been in an invalid place?-Merentha
Purveyor of Fine Music, Fine Wines and Fine Women!
(hey we all dream!)
_________________________
Currently awfg and deep into cyberpunk of AO, but I'll eventually come back to NWN :)

No wait, playin' DDO! But I've got a copy of NWN2 to load up and play ><

Posted by Plundar ( ..xxx.xxx ) at 2004-01-19 12:38:00    
I see Namelessone mentioned this:

"In the release of v1.0 we overwrote the default scripts and that cause problems for a fair amount of people. This time around we went with non-overwriting scripts to avoid that. You still have the option to save the creature event scripts (any scripts with names of the form no_ai_*, eg/ no_ai_atk, no_ai_blk, etc) with the names of the corresponding default scripts."

I have not worked with any of the scripts before but I am familiar with making backups and changing filenames. Could I get a list of which CODI files replace which default files so I can make the CODI AI the default AI? Could this be added to the readme file perhaps?

Thanks for your time.

Posted by LoCash at 2004-01-18 13:58:00    
Well, I just checked that area in the toolset ... all creatures are already set to "Long" so that can't be the problem.

Posted by Dromin ( ..xxx.xxx ) at 2004-01-17 23:27:00    
Well, it may have been that the creatures have a "short" perception or "average". I always set my critters to "long", that way the PCs don't get a free round of ranged fire at them.

Posted by NamelessOne at 2004-01-15 05:33:00    
LoCash:
Thanks for the feedback. I haven't noticed the behaviour you've described in my own testing, but that doesn't mean there isn't some set of circumstances leading to what you're describing. There's only so many things I can test myself while working on these scripts. I'll take another look at it and see if I can spot any perception holes or anything else that might cause creatures not to kick into and remain in combat mode.

hermyt:
Good job. I have a rewrite of the healing behaviour planned (couldn't fit it in before release for the 12 days of madness) to allow it to include undead allies and inflict spells for consideration if the possiblity is there.

CSM:
I've just downloaded and tested the file myself and couldn't find anything wrong with it.

Posted by CSM ( ..xxx.xxx ) at 2004-01-13 17:46:00    
The file is corrupted. Each time when I download the file or open it, I get a message that states that it is corrupted.

Posted by hermyt ( ..xxx.xxx ) at 2004-01-05 15:09:00    
hmm, well to make this ai a tad more useful for undead casters of no small power, I added in the harmself ability into the dohealself function in no_lib_actions

if(GetRacialType( OBJECT_SELF ) == RACIAL_TYPE_UNDEAD )
{
if(GetHasSpell(759) && (iDam * 100) / GetMaxHitPoints() > 60) //undeads new harm self, no constant for it, dug it from 2da's
{
ActionCastSpellAtObject(759, OBJECT_SELF);
SetLocalObject( OBJECT_SELF, "#HEALER", OBJECT_SELF );
DelayCommand( 4.0, DeleteLocalObject( OBJECT_SELF, "#HEALER" ) );
return TRUE;
}
}


dunno if that will format properly when posted, but you should get the gist, I added that call right after the check for healing potions which tests if the caller was undead, that if statement comes just after that block

this block here actually:

//iCR = 20;
iCR = 10;
iHealTalent = 0;
if ( GetRacialType( OBJECT_SELF ) != RACIAL_TYPE_UNDEAD ) //undead do not use healing potions
{
//while ( iCR && GetIsTalentValid( tP = GetCreatureTalentBest( TALENT_CATEGORY_BENEFICIAL_HEALING_POTION, iCR-- ) ) )
while ( iCR-- && GetIsTalentValid( tP = GetCreatureTalentRandom( TALENT_CATEGORY_BENEFICIAL_HEALING_POTION ) ) )
{
if ( iP = GetTalentPotionHealAmount( tP ) )
{
if ( iP > iHealTalent && iP 60)
{
tHeal = tP;
iHealTalent = iP;
}
}
}
}
}

anyways, hope that's helpful I'll throw it on the codi site too.

HerMyT

Posted by LoCash at 2003-12-31 14:19:00    
Well, speaking with some other builders, it seems that some engine changes were made in 1.59-1.61 which would probably impact many AI scripts (how NPCs handle the combat round, and of course DelayCommand functionality) so maybe that has something to do with it. The fact that I didn't find the demo particularly tough isn't a big deal since I'm used to playing with custom AI scripts (usually Tony_K's).

Oh yeah, Happy New Year CODI! Let's hope we can see a real .mod from you guys sometime in 2004.

Posted by LoCash_ ( ..xxx.xxx ) at 2003-12-27 14:16:00    
Either this script package isn't all that its cracked out to be, or the Demo mod included with it is faulty.

Taking my 10Barb/2Wiz (horribly non-optimal build, only good for RPing) through most of the Demo rooms resulted in easy combats (exception being the Dragon). In the "Band of the Hand" room, it almost seemed like it was the BioWare AI all over again; while I'm in melee with one hostile in one part of the room, a hostile in another part of the room *just stands there* staring at me (I'm right in its line of sight) without engaging or firing ranged at me. Then after I take care of the rest and go after it, it seems to wake up and try to flee.

Also, I noticed that AI casters seem to have no compunctions about firing AoE spells when they have friendlies in the area of effect. Thats how one of the drow mages killed herself; throwing a fireball at me when I was just a few steps away from her, and getting herself fried in the process.

  1  2  3 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 Scripts


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