Jump to content

Weird things happening with getEnchantment


RagnaHighArc

Recommended Posts

Here's the code. I'm trying to find out what the player's gauntlet enchantment does, but something is happening.

 

begin gameMode
if (V == 1)
set B to getEnchantment N2
set b3 to getNthEffectitemMagnitude B
set b2 to getNtheffectitemCode B 0
messageEx "%n" B3
endif

if (b3 == 25)
z1.pms effectFireDamage 0.5
endif

 

N2 is a gauntlet ref and z1 is a NPC ref.

 

I used messageEx to print out the ref "B" and 'b3" and all i get is "No Name", but even though it gets "no Name", the second if statement (b3 == 25) still works. I know it works because the effectFireDamage shader appears on the npc. So, it seems like everything works except for getNtheffectitemCode.

 

Does anyone know how to get the magic effect or even the name of the enchantment?

Link to comment
Share on other sites

hi there!

 

Notice that getNthEffectitemMagnitude requires 2 params, spell and index, and that it returns an integer, not a reference, so print "%n" won't work, it has to be "%.f". If it were a reference second block woudn't work.

 

If used several times getNthEffectItemCode and I tell you this function works as expected, but you're not using it in this code. With this you get a code that represents all the magic effects (this value becomes useful using the 'code' version of magic functions and to compare it with the value retrieved from GetMagicEffectCode).

 

It seems that getEnchantment returns a reference variable pointing to the enchantment itself, so [messageEx "%n", B] should print the name of the enchantment.

 

And just a random thought, woudn't it be better if second block would check dam >= 25 ?

 

Good luck mate!

Link to comment
Share on other sites

The second block is part of the testing. 25 is the magnitude of the Fire-shield enchantment that's on the gauntlet. Its gonna end up getting replaced.

 

I also tried [messageEx "%n", B] and it still came out as "-No Name-"

 

So i guess i was comparing the wrong thing then. Before i had it as

 

if (b2 == FISH)
z1.pms effectFireDamage 0.5
endif

 

and it still didn't work and now i know why. Well i'm gonna go fix the code.

 

Thanks for the help.

 

///

 

Yeah it works. I just need to configure the spells and then i'll release the mod

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...