I’m back and working on the next version of the Companion and Monster AI

If you are not getting exceptions, then the likely reason is they are trying to cast a spell they aren’t able to or casting at a location or creature that is not allowed. Debugging the HenchCastSpell script by uncommenting out the Jug_Debug statements is how I find issues like this.

Edit: Sometimes I just have add in /uncomment a lot of tracing statements just to see what is going on trying to figure what branch of the script it is going down.

1 Like

If I take manual control, I can make them cast everything. With the default AI script they are casting without any trouble at the same NPC at the same location. So they are fully able and allowed to cast, or with the default AI script they wouldn’t cast either.

The AI scripts that determine how to cast spells have changed since then. The hookups for feat use are quite different and casting on creatures vs. location has also changed.

Also, support for more feats and spells have been added from the base game, so the problem could be using one of them. This is especially true if you are using Kaedrin’s PrC pack.

I know that’s why I 'd like it to work for companions. But it doesn’t.

your crinit seems to works perfectly fine when called by the default hench_o0_ai script

If you are using the Kaedrin’s PrC pack: this discussion reminded me of the problem with the ClearAllActions the PrC pack does in the module player equip event. This only affects companions. To test, turn off weapon switching in the companion’s behavior settings. If you are using the PrC pack, you should either remove the script or change it to remove the ClearAllActions. This was added by Kaedrin to prevent exploits on PWs but shouldn’t have been done for everyone. The AI readme has some more details about this.

Sir you are spot on ! Took out the Kaedrin script execution from module equip and all companions are no more sitting ducks with your AI in place. I need to write down that stuff so to not have this problem again.

Tonyk AI is rocking my companions :slight_smile:

1 Like

The eqiup script does some other things in the PrC pack. Certain PrCs get bonuses when certain weapons are equipped, etc. You might want to take a look at modifying he script. I have thought about it, but Kaedrin didn’t officially provide the source for the latest release. I could make a version based on the last release with source and that would have most if not all of the functionality.

1 Like

I am working with the last version with sources. Everything in the project must and have sources :slight_smile: It’s too bad there were very interesting stuff in the lastest release from Kaedrin.

Bugs in the Mosfelds fighting. Sometimes Mosfelds standing in the ring and not attack my characters

https://mega.nz/file/2dhBRJzC#x9CW9IeHlHv2A0pKiUSK5hDQe9xmiA2GHrb6fjXGSoo - my save file.

I am using companion an monster AI 2.8 with installed mod PIA Personal Impossibility Adjustment | The Neverwinter Vault

Link to companion an monster AI 2.8 with installed mod PIA and my difficulty settings below
https://mega.nz/file/2BIEFCIJ#GsYHadq2C1m6w-fPVjYbffAd-Jtyl0paLaeqXPxDT4s

loading up your save and /override files … Web and Ward are attacking but Wyl isn’t …

unfortunately i don’t have Russian edition and the PC name is blanked. So is the PC model herself (i can only hear her speech)

That fight is heavily scripted …

 
[edit] after doing ClearAllActions() on the Mossfelds and jumping them back to their start waypoints (in the OnClientEnter script) they all fight …

@ahag ,

When I try to run the save game, my NWN2 crashes to the desktop. I also don’t see the character or their portrait - a question mark is shown, in the brief time it runs. Are you running using some other custom content like a head pack, etc?. If I run the saved game with nothing in the override, NWN2 lasts longer but as soon as I do something like open the character sheet the game still crashes. I also don’t have Wyl fighting with nothing in the override like @kevL_s. I only run with the Jade Empire frame rate fix, which I tried running without, to no effect.

it crashed me to desktop once (in about a half dozen loads) /info

yep. I’ve never see that question-mark before, as far as i can recall …

i didnt try the character sheet /shrug

note, i run nwn2 from the ClientExtension (some recent iteration, might not be the lastest)

 
i might work a bit on an OnClientEnter workaround tomorrow, but not sure how far that would/could progress the save (?)

 
@ahag what else is in your /override ?

@TonyK in that fight, the scripters are doing weird stuff like slotting creature AI-scripts in and out …

one of the scripts (onspellcastat iirc) looks like it wouldn’t even compile in its current (stock) state …

So it seems possible that Wyl got jarred into an undefined state with his scriptset … / idk

@ahag,

If I don’t do anything with the PC or party, I can delay the crashing enough to test. Most times I run now with the override you provided; all three brawlers start to attack. The results are very inconsistent, earlier Wyl almost never fought.

I checked the event scripts for all three brawlers, they are all the same with critical creature events replaced with module ones.

Heartbeat: 0b_moss_hb
Spell cast at: 0b_brawler_castat
On damaged: 0b_brawler_dmg

Since the heartbeat script has been replaced, the Companion and Monster AI scripts won’t pick up the nearby enemy to attack. The perception script won’t fire because the party was already perceived before the change to hostile. The other scripts key to get them attacking have also been replaced (damaged and spell cast at). In the heartbeat script for the brawlers, it assigns targets and sets commandable to false. When the default AI is called at the end the script, it can’t do anything in that state. I am thinking that this will need some sort of fix with @kevL_s Nwn2fixes.

2 Likes
oPC = GetFirstPC();
if (!GetIsObjectValid(oPC)) // no one is in the game! lovely! Sort of like this scripting ...
    {

i knew id regret this …

1 Like

I am using mods --BETA-- Playable Half-Celestial and Half-Fiends at Neverwinter 2 Nexus - mods and community Playable Half-Celestial and Half-Fiends and Xaltar’s Human Heads for Female Aasimar Xaltar's Human Heads for Female Aasimar at Neverwinter 2 Nexus - mods and community

And Zhjaeve Unveiled | The Neverwinter Vault

May be because i use mods Playable Half-Celestial and Half-Fiends and Xaltar’s Human Heads for Female Aasimar and Nwn2fixes.

And some bugs in Nwn2fixes

  1. Quest items remain in the inventory after the quest is completed if this items in inventory of my companions. For example Tor’s Holy Symbol

To solve this i replaced ga_take_item with files from baldur s gate reloaded mod - link below
https://mega.nz/file/fYR0BJpJ#VjjgiY5h5kdbpeNELD6IW6cES1RLoH8SM438o40LCiE

  1. After the west harbor fighting and talking with Daeghun about silver shard and Bevil if you decide stay in west harbor and not immediately set out to swamp, Daeghun Farlong after a little time start walking to the field when other archers stays.

To solve this problem i saved my game immediately after talking about silver shard and load this save.

This might be an issue with the AI. I can reset the starting location if in a conversation.

@TonyK

do you have an idea, offhand, why at the end of the combat trails (finish) they’d assign ‘nw_c2_default5’ instead of ‘gb_comp_attack’ ? seems odd …

	if (GetTag(oPCF) == "npc_bevil") // and Amie also
	{
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_BLOCKED_BY_DOOR,    "gb_comp_block");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_DIALOGUE,           "gb_comp_conv");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_DAMAGED,            "gb_comp_damage");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_DEATH,              "gb_comp_death");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_END_COMBATROUND,    "gb_comp_combat");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_HEARTBEAT,          "gb_comp_heart");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_DISTURBED,          "gb_comp_distrb");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_NOTICE,             "gb_comp_percep");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_MELEE_ATTACKED,     "nw_c2_default5"); // kL_note: why not 'gb_comp_attack'
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_RESTED,             "gb_comp_rest");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_SPAWN_IN,           "gb_comp_spawn");
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_SPELLCASTAT,        "0b_bevil_castat"); // for the magic trial
		SetEventHandler(oPCF, CREATURE_SCRIPT_ON_USER_DEFINED_EVENT, "gb_comp_usrdef");
	}