Can't SetAV for some reason.

Post » Sun Jan 06, 2013 4:43 pm

I have a feeling this has more to do with my setup than script. The setup is as follows: I have a dynamically attached script that basically just recognizes when the player hits something. (Come to think of it, I could probably just do a Combat Hit spell perk with an ability that updates the next part in the chain and dispels itself immediately.) Once hit, this activates the following function in a quest script:
Spoiler

Scriptname H2H_Script_Quest extends Quest int NextLevelint CurrentExp = 0Float HealthFaction Property H2H_Skill autofloat  DamageTotalGlobalVariable Property ExpRemaining autoGlobalVariable Property CurrentRank autoActor Property PlayerREF autoQuest Property ThisQuest autoReferenceAlias Property PlayerAlias autofunction H2Hit(int DamageDone)    NextLevel = ((((PlayerAlias.GetReference() as Actor).GetFactionRank(H2H_skill)) * (((PlayerAlias.GetReference() as Actor).GetFactionRank(H2H_Skill)) * 0.95)) * 0.313) as intUpdatee.RegisterForSingleUpdate(0.25)if (CurrentRank.GetValue() as int) < 100   DamageTotal = DamageTotal + ((PlayerAlias.GetReference() as Actor).GetActorValue("UnarmedDamage") +- (PlayerAlias.GetReference() as Actor).GetBaseAV("UnarmedDamage") * 4)   ExpRemaining.SetValue((DamageTotal/NextLevel) * 100)   ThisQuest.UpdateCurrentInstanceGlobal(ExpRemaining)   if DamageTotal >= NextLevel    (PlayerAlias.GetReference() as Actor).ModFactionRank(H2H_Skill, 1)    CurrentRank.SetValue((PlayerAlias.GetReference() as Actor).GetFactionRank(H2H_Skill))    ThisQuest.UpdateCurrentInstanceGlobal(CurrentRank)    DamageTotal = 0    NextLevel = ((((PlayerAlias.GetReference() as Actor).GetFactionRank(H2H_skill)) * (((PlayerAlias.GetReference() as Actor).GetFactionRank(H2H_Skill)) * 0.95)) * 0.313) as int    ExpRemaining.SetValue((DamageTotal/NextLevel) * 100)    ThisQuest.UpdateCurrentInstanceGlobal(ExpRemaining)    int Current1H = (PlayerAlias.GetReference() as Actor).GetAV("OneHanded") as int    Game.IncrementSkillBy("OneHanded", 1)    (PlayerAlias.GetReference() as Actor).SetAV("OneHanded", Current1H)   endIfendIfendFunctionevent OnInit()    RegisterForMenu("Racesix Menu")endEventEvent OnMenuClose(String asMenuName)	    If (asMenuName == "Racesix Menu") ; Check not necessary if no other menus are registered for this form			    if PlayerREF.GetRace()== ImperialRace || PlayerREF.GetRace()== OrcRace ||PlayerREF.GetRace()== NordRace ||PlayerREF.GetRace()== RedguardRace   PlayerREF.ModFactionRank(H2H_Skill, 20)  elseIf PlayerREF.GetRace()== KhajiitRace    ;PlayerREF.KillSilent()   PlayerREF.ModFactionRank(H2H_Skill, 25)  else   PlayerREF.ModFactionRank(H2H_Skill, 15)  endIf	    EndIfEndEventRace Property ImperialRace autoRace Property NordRace autoRace Property RedguardRace autoRace Property KhajiitRace autoRace Property OrcRace autoMagicEffect Property Updatee  Auto 

Now, you will not that there is a magic effect that receives an update. This belongs to a constant effect ability spell on an alias filled by the player. This effect is scripted, and is simply the following:

Spoiler

Scriptname H2H_UpgradeUnarmed extends activemagiceffect  Faction Property H2H_Skill autoReferenceAlias Property PlayerAlias autoevent OnUpdate()	(PlayerAlias.GetReference() as Actor).SetAV("UnarmedDamage", ((PlayerAlias.GetReference() as Actor).GetFactionRank(H2H_Skill) * 0.30) as int)endEvent

I've tried using GetTargetActor(), PlayerREF, etc. and nothing seems to work. I don't believe my MagicEffect is receiving the update. Halp?
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am

Return to V - Skyrim