Iron Golem: Creature/Toolset Questions

Hi All,

I have an iron golem and have added the poisonous gas ability. I have two questions …

  1. Is there something about the AI that makes the iron golem “slow” to attack? i.e. It only appears to attack every other round now and then. It can even go past a few rounds before deciding to act … is there a setting I am missing?

  2. It never appears to use its poisonous gas ability. Again, any reason why?

Thanks in advance, Lance.

hey Lance,

I plopped down a stock Iron Golem and did some debugging. First, his physical attacks started right away and continued with no issues. It’s quite a good fighter …

Second, no gas attack though. So on a hunch (well, more than a hunch really) i used the nwn2_ai_2da_editor to increase the EffectWeight of #263 Golem_Breath_Gas from 0.1 to 10.0 …

and golem breathed poison once. Then increased its uses to 5 and it breathed five times in a row (before commencing physical attacks as expected).

But I don’t have a ‘feel’ for what EffectWeight should be; i just pumped it to 10.0 to “make it so.”



my golem is using HenchDetermineCombatRound() – not nwn1’s DetermineCombatRound()


Hi KevL,

Thanks for looking into this. :slight_smile:

Mine also uses HenchDetermineCombatRound.

However, I am very interested in this EffectWeight you mention in nwn2_ai_2da_editor. What is that?

This sounds like something very useful, as I have often tried looking at what encourages a monster to use their abilities and this sounds like the job!

Thanks again.

very cool.

1 Like

Thanks KevL,

I will take a look at that straight away!


1 Like

Hi KevL,

Yeh! That weight adjustment sorted the issue! :ok_man:

Which of course means another 2da to add to the campaign files. :wink:

So, in brief, monster/henchmen spells can have their “priority” adjusted via the weight column in this henchspells.2da file?

EDIT: I did also have an error in one script that was not using the correct AI function, but the weight fix is what was finally needed. The script has since been fixed alongside the weight update.

Thanks again, Lance.

woohoo (always glad to see Iron Golems breathing poison…)

It seems so (the SoZ/tonyAI is a pretty complicated place). I tried an EffectWeight of 2.0 and it worked, so the value appears to be fairly sensitive.

the idea behind the editor is that the values and bit-toggles in HenchSpells.2da ought reflect what’s in spellscripts and vice versa.

Hi KevL,

I am going to ask a really stupid question here … Is the SoZ AI TonyAI then?

I mean I often see people say use the TonyAI addon, but is that not already in place if you have SoZ then?

i.e. Tony AI add-on is not required for SoZ built mods anyway?

Also, do you mean “sensitive” in your post, or “insensitive”, as you say the result is the same whether we use a value of 2 or 10? Just making sure I understand you correctly. :slight_smile:

P.S. Do you know how the X2_L_BEH_MAGIC variable works in relation to the AI with respect to abilities, if at all? I understood it encouraged spell use, but then maybe ability use is not spell use?

Cheers, Lance.

here’s my personal interpretation of a rumor … tony did the SoZ ai (what happened before that i have no clue) but my guess is that he didn’t consider it finished (or he was so indepth in it by release that he knew there was more he wanted to do to it). ergo the Companion and Monster AI 2.2 was released as a mod add-on …

not required. From what I’ve seen they are very similar. The major difference Tony added is to the companion behaviors on the character sheet. (but have noticed other tweaks also)

what i meant is that the delta between 0.1 (stock) and 10.0 is “insensitive”

but since the delta between 0.1 and 2.0 is enough to cause an apparent change in behavior means that adjustments to EffectWeight are “more sensitive that previously attempted” – i mean, who knows, changing the value to 0.5 could be all that’s needed

and the rubric is, make the smallest change that causes the desired result,


the X2_L_BEH_* variables are for DetermineCombatRound and afaiaa do zero zip nadda if HenchDetermineCombatRound() takes the call instead. So … nop, I don’t know if it works for abilities: if nwn1 DCR is called when I’m playing, bright magenta letters appear in all caps and i put a stop to it pretty fast.

(don’t get me wrong – the Nwn1 ai is pretty darn good and there are thousands of players who can and no doubt would vouch for it – but working w/ 1 ai at a time is quite enough for yours truly)


Ah … OK, I will experiment there then! Thanks.

Ah … so that variable may have been a spin off when I was experimenting with DetermineCombatRound a long while ago and I did not realise it no longer had any bearing after switching back to HenchDetermineCombatRound. Thanks for clarifying. I will do a quick search and some more modifications before releasing v2.93 then.

Cheers, Lance.

1 Like

one thing I don’t know offhand (but would like to look into) is whether or not there is a probability inserted between consideration of EffectWeight and the decision to cast or not. At the moment it seems too deterministic to me … so i’d like to insert a probability, based on EffectWeight …

anyway / good luck on things

:passport_control:   pseudo-random emoji

That would be very good to have indeed, as I believe that X2_L_BEH_MAGIC was supposed to do something like that and is why I had it 100 (%) to ensure spell casters did cast spells at the time.

By the way, (and this is totally outside of my knowledge, but just something I “noticed” in passing/searching) … I noticed “EffectWeight” shows up in a search in the compiled version of “hench_o0_ai” (well my different named copy of that file anyway), but does not show in the NSS version, which I guess is where is gets added somehow.

Anyway, I have no idea how that works, but just thought I’d mention it, even though I suspect you knew that already. :slight_smile:

Thanks, Lance.

const string HENCH_SPELL_EFFECT_WEIGHT_COL = "EffectWeight";

is in ‘hench_i0_spells’ #include. Any scripts that call any of several functions that use that constant will have the string “EffectWeight” in their compiled file. that’s just how it works, Lance  :)

and yes that’s the EffectWeight we’re talking about …

1 Like

Thanks for the explanation!

Also, just out of interest … Is there any reason why the chat window would NOT display every creature attack?

e.g. I have a party attacking the golem, but not every creature’s attack appears to be shown.

EDIT: Actually, I think I noticed my mistake on looking here … It seems that if a PC/henchman is doing something special (like “Power Attack”) it places that before the name and so I was missing the PC/henchman action for the round … I think. E.g. Sebastion (power attack) and Myara (off hand).

ALTHOUGH … I do note that the golem does not appear to have attacked every round … Do we know if it has been programmed to be slowed if hit by an electrical attack? (One PC has an electrical weapon and I know there are rules about golems being slowed by electric, but this would be hard-coded by the looks of it as I cannot see why else the golem would nto attack on a given round.)

UPDATE: Don’t worry, I found it … I had not applied a check to see if the golem was already in combat, so it kept resetting attacks!

NOW THAT’S THE NASTY I REMEMBER! Muwuaha! Sorry, got a little carried away there. :wink:

Cheers, Lance.


so have you got a fully fighting Golem ?

1 Like

Yeeee… up!

The bad ass is back in form and fighting like he should!

It’s all part of the fixes being made for v2.93 … the ones that I always wanted to look at, but never did through fear of messing something up. But, I really did want to sort this one out … and glad I did, thanks to your help … again! :ok_man:

Cheers, Lance.

Just to prove it …

1 Like


1 Like