lfnetwork.com mark read register faq members calendar

Thread: Disable AI for henchmen, Kotor and TSL
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-26-2009, 11:33 AM   #1
WRFan
Rookie
 
Join Date: Jun 2009
Posts: 63
Disable AI for henchmen, Kotor and TSL

Don't you hate it when your companions attack enemies automatically, without waiting for your orders? I hate that. They always engage in melee combat. I hate that in Kotor, in TSL and in NWN2. In Kotor and TSL, this AI behaviour is controlled through the file k_ai_master. If you want your companions to wait for your orders, comment out the line

Code:
GN_DetermineCombatRound();
for all henchmen events (like KOTOR_HENCH_EVENT_ON_PERCEPTION) and then recompile the script.

Don't touch the KOTOR_DEFAULT_EVENT_ON_... events! Those control enemy behaviour. You don't want enemies to just stand around doing nothing. lol.

It may also be possible to change henchmen AI style, haven't tested it yet, but there's a function in TSL that allows to do this:

Code:
// Sets the party ai style
void SetPartyAIStyle(int nStyle);
The AI styles are defined in nwscript.nss script. This one is interesting:

Code:
int NPC_AISTYLE_PARTY_REMOTE    = 14;//RWT-OEI 09/08/04 - Combat AI for the floating remote.
The Bao-Dur remote does pretty much nothing, so it may be interesting to change your party AI style to remote's style
WRFan is offline   you may: quote & reply,
Old 06-26-2009, 12:47 PM   #2
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 706
Veteran Modder 
Cool. I hate it when the npc's run off and chase creatures.
newbiemodder is offline   you may: quote & reply,
Old 06-26-2009, 09:05 PM   #3
N**
Rookie
 
Join Date: Jun 2009
Posts: 44
I think this would be better implemented by a new aiscripts.2da entry, named Following or something (a la NWN's Follow Me command).

Sometimes I just want the NPC's to tag along for conversation only. I usually equip and level them so strongly that most could run through the entire campaign plot on their own at Hardcore setting with no input from me.

Other times when you are forced to take a companion, such as the DS Star Forge plot, I'd prefer that they also do nothing but follow.

So, I guess, great work and idea, but I don't think it's quite flexible enough!
N** is offline   you may: quote & reply,
Old 06-26-2009, 09:32 PM   #4
Allronix
Forumite
 
Allronix's Avatar
 
Join Date: Aug 2003
Location: Seattle
Posts: 575
I'd actually like some better-done party scripts, like:

Throw your nastiest Force power, then attack.
Hang back and fire your guns.
Keep casting force powers
Stay back and cast protection and healing powers.
Defend yourself (activate shields, cast protective powers on self)


Allronix - KOTOR Filefront Supporter
http://knightsoftheoldrepublic.filefront.com/

Please bring your mods. They'll give them a good home!
Allronix is offline   you may: quote & reply,
Old 06-26-2009, 09:42 PM   #5
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by WRFan View Post
The Bao-Dur remote does pretty much nothing, so it may be interesting to change your party AI style to remote's style
That style only works for party puppets; if the object running it doesn't have an owner assigned it will not follow, and will just run the default AI routines instead. (If it is a puppet it will make it follow the owner around and heal any droids in the party that gets damaged.)


mt
stoffe is offline   you may: quote & reply,
Old 06-27-2009, 08:11 PM   #6
N**
Rookie
 
Join Date: Jun 2009
Posts: 44
I re-added some of the originally planned scripts for KotOR back into aiscripts.2da. These were: No Script, Aid, Melee Attack, and Ranged Attack.

I only looked briefly, but I think only Melee Attack will actually function; the rest will simply behave like No Script (following, but not attacking or using any power).

Here are the descriptions of those scripts as they were left in the game:
No Script: The character will do nothing but basic following of the leader, it will not attack or heal.
Melee Attack: The character will only use melee weapons.
Ranged Attack: Character will only used ranged weapons.
Aid: Whenever possible the character will use Force powers and med kits to heal party members that are below 50% in vitality points. Otherwise the character behaves in the same manner as the 'Default attack' setting.
I played through DS Star Forge with Bastila set to No Script, and it worked great! When combat began, she would halt in position and only return once it was over.

It's unfortunate that the other scripts probably won't work. Improved AI is something KotOR always needed. I would like to take a try at it, but since beating the game again I find myself reluctant to begin playing once more.

aiscripts.2da
N** is offline   you may: quote & reply,
Old 07-01-2009, 12:56 PM   #7
WRFan
Rookie
 
Join Date: Jun 2009
Posts: 63
I just noticed that the Handmaiden sisters are using the henchmen AI scripts in TSL. This is an oversight on Obsidian's part, since Handmaiden sisters are technically copies of the henchman Handmaiden that follows you. So if you fight the handmaiden sisters in the battle circle at the Telos jedi academy, either remove the k_ai_master.ncs from the Override folder until you finish the fights or edit all the sisters' character files and adjust their AI scripts. Otherwise they won't determine combat rounds (means they won't attack you if you edited the henchmen portions of the k_ai_master script)
WRFan is offline   you may: quote & reply,
Old 07-02-2009, 08:36 AM   #8
WRFan
Rookie
 
Join Date: Jun 2009
Posts: 63
I also noticed that the first time you encounter Visas (when she attacks you on the ship) in TSL, she's also using the henchmen scripts. This is beginning to get annoying. Ok, so maybe removing the DetermineCombatRound function altogether wasn't such a good idea after all. Instead, I recommend the following approach:

Code:
if( (GetTag(OBJECT_SELF) == "VISASCUT" || GetTag(OBJECT_SELF) == "DOJO" || GetTag(OBJECT_SELF) == "DOJOSISTER") && !IsObjectPartyMember(OBJECT_SELF) )
{
// original code here
}
or, even more reliable and simple:


Code:
if( !IsObjectPartyMember(OBJECT_SELF) )
{
....
this will basically prevent your party members only from determining combat rounds.

There still may be a problem with Handmaiden fights on the Ebon Hawk. Have to look into this
WRFan is offline   you may: quote & reply,
Old 11-12-2014, 07:30 PM   #9
Oli Baba
Lurker
 
Join Date: Nov 2014
Posts: 2
For anyone still wanting to turn of the party AI in KotOR 1:

https://www.dropbox.com/s/a218bcim4c...aster.ncs?dl=0
...to put in the Override folder

https://www.dropbox.com/s/7qopo9c2hk...aster.nss?dl=0
...source file for those interested in my "approach"

For some reason, WRFan's solution about the combat rounds did nothing for me. So after some uneducated fiddling, I plain and simply cut out all the henchmen scripts. Maybe not the most elegant approach but it finally got it done!

No party member does anything in combat without my order!

Last edited by Oli Baba; 11-12-2014 at 07:44 PM.
Oli Baba is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Disable AI for henchmen, Kotor and TSL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:43 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.