Script Help, Won't Compile "No Viable Alternative"

Post » Fri Aug 23, 2013 10:22 pm

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.

User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Fri Aug 23, 2013 11:04 pm

Quick ones as on my phone.

Change your lines like so:

While Stressing =

to

While Stressing ==

And similar lines like that.

If you're comparing two arguments, you need to use ==. Using single = means the left argument is the right argument; like you've used for declaring your floats.

Also i don't think you need to declare spellcast, because the event already has akSpell.
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm


Return to V - Skyrim