GetActorValue("DragonSouls") help?

Post » Fri Mar 22, 2013 8:38 pm

I'm trying to script a spell that will check to see if the player has any Dragon Souls, and if so, remove one and give him/her a choice of increasing health, stamina, magicka or perk points. Everything compiled fine until I added the red text below. Then it gave me the following error message:

QuickeningScript.psc(11,5): type mismatch while assigning to a int (cast missing or types unrelated)

Can someone take a look at this and let me know what they think is going on? I modeled the red text on the previously successfully compiled gold text so I'm not sure where the snag is.

Scriptname QuickeningScript extends activemagiceffect
{This is the spell effect for the JPQuickeningMagEffect}

Message property quickeningBox auto
{points to the message box that is shown when the spell is cast}

Message property noSoulsBox auto
{points to the message box to tell the player he has no Dragon Souls}

Event OnEffectStart(Actor akTarget, Actor akCaster)
int iSoulCount = Game.GetPlayer().GetActorValue("DragonSouls")
if iSoulCount == 0
noSoulsBox.Show()
Else
int iSelection = quickeningBox.Show()
if iSelection == 0
Game.GetPlayer().ModActorValue("DragonSouls", -1.0)
Game.GetPlayer().ModActorValue("health", 10.0)
elseif iSelection == 1
Game.GetPlayer().ModActorValue("DragonSouls", -1.0)
Game.GetPlayer().ModActorValue("magicka", 10.0)
elseif iSelection == 2
Game.GetPlayer().ModActorValue("DragonSouls", -1.0)
Game.GetPlayer().ModActorValue("stamina", 10.0)
elseif iSelection == 3
Game.GetPlayer().ModActorValue("DragonSouls", -1.0)
Game.AddPerkPoints(1)
endif
endif
endEvent

Based on the error message I'm guessing the issue is with this line ...
int iSoulCount = Game.GetPlayer().GetActorValue("DragonSouls")
... I just don't know why.

Also, I see that there is a VoicePoints AV too, does anyone know the difference between this and DragonSouls? I tried swapping it out in the offending line and it didn't have any effect on the error.
User avatar
Chenae Butler
 
Posts: 3485
Joined: Sat Feb 17, 2007 3:54 pm

Return to V - Skyrim