Jump to content

Home

Default AI Style?


Dashus

Recommended Posts

Where are the default AI styles stored? I would think there would be be a 2da but I must be overlooking it if that's the case.

 

There is an aiscripts.2da but I think it's only used for player selectable styles since there are more than those listed here used by NPCs. I also suspect parts of them are set in the GUI manifest files since there are no icons specified in this 2DA file.

 

The styles are part of the main AI scripts (k_inc_generic.nss and k_inc_gensupport.nss mostly) which checks what style is set and adjusts the behavior accordingly. You have Get/Set functions for the styles, where the set stores an AI style value and the Get checks which style is set.

 

While I haven't tested it I'd guess the Get/Set functions would accept other values than the AI STYLE constants specified in nwscript.nss (the values in aiscripts.2da seem to correspond to these constants too).

 

This is mostly speculation on my part though since I haven't tried to add more AI styles, merely use the existing ones.

Link to comment
Share on other sites

Not trying to add any - mostly just curious if it's possible to change the default one as it seems that some utc's (notably the Mark V Wardroid) seem to prefer melee combat even with a ranged weapon equipped, which looks somewhat ridiculous. Obviously I could just stick a set into the OnSpawn but I was hoping for something slightly more elegant (ie less work :p)

Link to comment
Share on other sites

Not trying to add any - mostly just curious if it's possible to change the default one as it seems that some utc's (notably the Mark V Wardroid) seem to prefer melee combat even with a ranged weapon equipped, which looks somewhat ridiculous. Obviously I could just stick a set into the OnSpawn but I was hoping for something slightly more elegant (ie less work :p)

 

Weird, default AI behavior for droids is to always equip and use their ranged weapons if they have any in their inventory and never switch it out regardless of how close the target is. (Had to make a special AI for a droid that should engage in both melee and ranged combat depending on the situation.)

 

But, as far as I know there is no more elegant way of switching AI style for NPCs than via scripts. Either give all droids of that type a custom OnSpawn script, or, if they are spawned, change their AI in the script that spawns them.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...