As part of a boss fight I'm working on, I have the boss 'disappear' and send three 'projections' of himself after the player. These projections look identical to him, except they have a constant effect chameleon to appear 'ghostly'. This all works fine -- the problem is that immediately after any one of the 3 ghosts dies, the other two lose their chameleon ability and become corporeal.
I'm at a loss to why this might be happening, because each of the three NPCs has a different script (they all do the same thing, but they are different scripts and so shouldn't interfere with one another).
Even adding precautions to add back chameleon abilities to their scripts doesn't seem to fix it.
I'll attach the scripts they have attached below. Note that though it's labelled 'scriptname 1', each of them has their own (scriptname 1, 2, 3) which do exactly the same thing, to ensure no weird variable overlaps.
Begin NON_VoidAncalAsp1short triggerfloat timerif ( menumode == 1 ) returnendifif ( onactivate == 1 ) returnendifif ( trigger == 1 ) returnendifif ( GetHealth < 1 ) ; this part makes them vanish when they die set timer to ( timer + getsecondspassed ) if ( timer > 0.5 ) PlaceAtMe "NON_WarpEffect" 1 1 1 StartScript NON_VoidCrystalChargerN1 ; triggers a second script included below Set timer to 0 Set trigger to 1 Disable Return endifendifif ( GetScale != 1.10 ) SetScale 1.10endifif ( GetEffect, sEffectChameleon == 1 ) ReturnendifAddSpell chameleon_100_unique ; note that this is a different chameleon ability ; to the one they start off with, so it's not redundantend
The above script triggers a second script which is involved with charging up a superweapon, and thus not really relevant. I included it just in case it might be involved:
Begin NON_VoidCrystalChargerN1short statIf ( menumode == 1 ) returnendifif ( stat == 0 ) If ( NON_VoidAncalagon == 8 ) PlaySound "sprigganmagic" Player->RemoveItem "NON_AncalagonStaff1" 1 Player->AddItem "NON_AncalagonStaff2" 1 MessageBox, "The Thaumaturgica has absorbed enough metaphysical energy to reach full power." Set NON_VoidAncalagon to 9 Set stat to 1 Return Else PlaySound "sprigganmagic" MessageBox, "The Thaumaturgica absorbs the metaphysical energy trapped within Ancalagon's projection." Set NON_VoidAncalagon to ( NON_VoidAncalagon + 1 ) Set stat to 1 Return EndifElseIf ( stat == 1 ) stopscript NON_VoidCrystalChargerN1EndifEnd
'NON_VoidAncalagon' is a global which all three 'charger' scripts modify -- this is the only point that I can see where these scripts might interact.
It's a minor issue, but I really like the effect of having these ghost/projection enemies, so it'd be a shame if I had to scrap it. Any help would be appreciated!