I’m trying to get a companion creature “locked” into a polymorph. As far as I understand, I need to set the “nLocked” parameter to True, but even though I do it, the script gives me an Undeclared Identifier error for it.
Here’s the script so far if it helps.
void main ()
object oTarget = OBJECT_SELF;
// Create the effect to apply
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_WINTER_WOLF, nLocked=TRUE);
ePoly = SupernaturalEffect(ePoly);
effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoly, oTarget);
SetScale(oTarget, 1.5, 1.5, 1.5 );
Is the line that has the problem. It needs changing to
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_WINTER_WOLF, TRUE);
When it says to set a parameter to anything you do not need to have an assignment to do it. Rather you place the variable or value that the parameter uses into that slot in the function call.
Ah, understood! Thank you.
[shameless self promotion] While I realise that you are on NwN 2 and I wrote it primarily for NwN, I still honestly think this ebook that I wrote would be of use to you - TR’s Basics - Variables, Types and Functions (TBC).
since the nLocked parameter defaults to true.
Ah, okay. I should have checked.