Hi,
I am trying to find out the reference of the players summoned creatures.
Unfortunately I got no luck with that yet
I use this code in a script which gets started when a summon is performed.
long indexlong effectKeyref CreatureRef1ref CreatureRef2array_var AllEffectsBegin ScriptEffectStart let AllEffects := ar_Construct stringmap ForEach AllEffects <- (Player.GetActiveEffectCodes) let index := AllEffects["value"] if (MagicEffectUsesCreatureC index) let effectKey := AllEffects["key"] if CreatureRef1 == 0 let CreatureRef1 := Player.GetNthActiveEffectSummonRef effectKey Message "I'm there!" endif ;If CreatureRef2 == 0 ;endif endif LoopEnd
I come to the "I'm there!" message but the reference is zero since I've tried to print out an extended message with the name and I only can read
I appreciate any suggestions of how I can get the reference of the current summons.
Thanks.
Addition:
I just added some console prints to find out what value the index and the effect key have.
The index is enormous high of 1094931290 and the effectKey is just 13.
Those values also don't change if I summon the creature again to run the script.
So it seems something is quite right since I can come to the message inside the if-block.
But I fail to set up the reference since it seems the effectKey isn't correct.