Hi all. This script is kicking my butt, plz help me!
Full Script
Spoiler
Scriptname PLZcrosshairRef extends activemagiceffect Import UtilitySpell Property spell1 AutoSpell Property spell2 AutoSpell Property spell3 AutoSpell Property spell4 AutoImageSpaceModifier property LoopFX AutoFormlist Property omzAllSpells AutoForm Property targetForm AutoObjectReference Property targetREF Auto Actor Property playerREF AutoEvent OnSpellCast(Form akSpell)Spell spellCast = akSpell as spellIf spellCast = spell1 Float mode = 0.0 Float Stress = 0.0 Float Stressing = 1.0 While Stressing = 1.0 Stress += 0.1 If playerREF.GetAnimationVariableBool("IsCastingLeft") == True If playerREF.GetEquippedSpell(0) == spell1 mode += 1 endIf endIf If playerREF.GetAnimationVariableBool("IsCastingRight") == True If playerREF.GetEquippedSpell(1) == spell1 mode += 10 endIf endIf If mode == 0.0 Stressing = 0.0 elseif mode == 1 If Stress < 1.0 LoopFX.Apply(Stress) Game.ShakeController(Stress, 0.0, 1.0) Elseif Stress >= 1.0 RegisterForCrossHairRef() Game.DisablePlayerControls() endIf elseif mode == 10 If Stress < 1.0 LoopFX.Apply(Stress) Game.ShakeController(0.0, Stress, 1.0) Elseif Stress >= 1.0 RegisterForCrossHairRef() Game.DisablePlayerControls() endIf elseif mode == 11 If Stress < 1.0 LoopFX.Apply(Stress) Game.ShakeController(Stress, Stress, 1.0) Elseif Stress >= 1.0 RegisterForCrossHairRef() Game.DisablePlayerControls() Game.ShakeCamera(afStrength = 0.1) Stressing = 0.0 endIf endIf If Stressing = 1.0 Wait(0.1) endIf endWhileendIfEndEventEvent OnCrossHairRefChange(ObjectReference ref)UnRegisterForCrossHairRef()targetREF = reftargetForm = ref.GetBaseObject() as FormDebug.Notification("Crosshair targeting " + targetForm.GetName())Game.EnablePlayerControls()endEvent
Problem Part of Script
Spoiler
Event OnSpellCast(Form akSpell)Spell spellCast = akSpell as spellIf spellCast = spell1 ; I get errors here Float mode = 0.0 Float Stress = 0.0 Float Stressing = 1.0 While Stressing = 1.0 ; I get errors here even if I use a bool Stress += 0.1 If playerREF.GetAnimationVariableBool("IsCastingLeft") == True If playerREF.GetEquippedSpell(0) == spell1 mode += 1 endIf endIf If playerREF.GetAnimationVariableBool("IsCastingRight") == True If playerREF.GetEquippedSpell(1) == spell1 mode += 10 endIf endIf If mode == 0.0 Stressing = 0.0 endIf If Stressing = 1.0 Utility.Wait(0.1) endIf endWhileendIfEndEvent
I am getting this from the CK:
Compiling "PLZcrosshairRef"...C:\Game\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PLZcrosshairRef.psc(14,3): no viable alternative at input 'spellCast'C:\Game\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PLZcrosshairRef.psc(18,7): no viable alternative at input 'Stressing'C:\Game\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PLZcrosshairRef.psc(59,5): no viable alternative at input 'Stressing'No output generated for PLZcrosshairRef, compilation failed.
I have tried compiling with Notepad++ and it compiles fine, then I try again but I open it via the CK and I get these errors... If I change to a bool variable AND leave out the = true part of the while statement, that part will compile, but will not function correctly.