What's Going On?!

I’m very new to scripting in general and am slowly ploughing my way through the laborious bug-irradiation process. I’ve got to a situation where I’m recreating a scene in the Prelude of the NWN1 game where Ansel and Tabitha are practising Turn Undead. I’ve got the script working just fine one one computer: Ansel generates a skeleton and Tabitha uses Turn Undead to blow it up – rinse and repeat. Yet, when I transfer exactly the same code to another computer (both Alienwares of similar specs and using the same Windows 10 operating system) I get a different result. For example, this bit of script for Tabitha:

effect eBludg = EffectDamage(70, DAMAGE_TYPE_BLUDGEONING);

… gives enough umph via

ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_INSTANT, eBludg, oTarget));

to explode the skeleton (oTarget) on one computer, but even set the EffectDamage number up to ridiculously high levels (100000000) the same Aurora compiler on the other computer refused for some unknown reason to explode the skeleton: the skeleton was just knocked down and then died. I’ve gone through both the code and settings on both computers and as far as I can tell everything’s identical. And now I find that when I tested the non-exploding Tabitha script again after turning my computer on this morning, I find that all of a sudden Aurora now does allow the skeleton to explode every time Tabitha uses her Turn Undead spell. I haven’t modified the script at all and now I’m getting a different result! What??
Other things I can’t understand: Why one custom-created character use Turn Undead only three times and another an indefinite number of times?

Why do some skeletons once killed generate a corpse after they die and others not? If you look at the original NWN games the skeletons Tabitha kills never regenerate a corpse, yet for every four or five skeletons Tabitha kills in my script (totally randomly) a corpse materialises into view. I have to use the DestroyObject function to get rid of it.

Any tips / advise would be appreciated. (I’ll give you my full code if you’d like to see it.)

Thanks

Peter

Welcome.

Apparently (in 1.69) the maximum damage amount that may be applied by EffectDamage is equal to 10000 invariant to damage type. Everything above that (within int limit of course) is replaced with just 1.

Usually it is enough to apply damage equal to creature’s current HP. But due to possible resistances, EffectDeath is more predictable. With it you can even choose whether the creature should be gibbed or leave a corpse.

Did you check the lexicon entry on EffectDamage? It explains when the creature is gibbed and when it leaves a corpse.

I’d be IncrementRemainingFeatUses() or a fabricated “Turn Undead” script. Or - if you added the Turn Undead feat via custom content as an item property to creature’s hide - like all feats with remaining uses, it will be usable infinitely.

Thanks for that, really appreciated. I must have missed the bit about hit points re EffectDamage in my enthusiasm to get to the example code. All is right with the world again! :slight_smile:

Have to say it’s a lot of fun messing about creating these NWN modules and scripting stuff – the hours fly by!