Help with compiling script

Post » Tue Aug 13, 2013 6:29 am

I have my magic effect and my spell, im just not sure where I should put the script. I want this to run as part of the magic effect. Do I put this in the script box under magic effect or should I first go to Papyrus manager-> new script? (Both cause my editor to stop responding.) My code is copied below.

ScriptName OMZmonitorScript extends ActiveMagicEffectImport UtilityInt Property OMZstage AutoEvent OnSpellCast(Form akSpell)Spell spellCast = akSpell as SpellIf spellCast == OMZspell	While OMZstage <= 4		OMZstage += 1		;WIP FX(OMZstage)		Debug.notification(“OMZstage: ” + OMZstage)		Utility.Wait(0.7)		If OMZstage = 5		RegisterForCrosshairRef()   		Game.DisablePlayerControls(abMovement = false, abMenu = false)		endIf	endWhileendIfendEventEvent OnCrosshairRefChange(ObjectReference ref)UnregisterForCrosshairRef()Debug.notification(“Crosshair ref: “ + ref)If ref;WIPendIfendEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)Game.EnablePlayerControls()If OMZstage <= 5OMZstage = 0endIfendEvent
User avatar
Lauren Denman
 
Posts: 3382
Joined: Fri Jun 16, 2006 10:29 am

Post » Tue Aug 13, 2013 3:53 pm

It usually takes my computer a bit when I go through the process of adding a new script in the CK. Give it a minute.

User avatar
Svenja Hedrich
 
Posts: 3496
Joined: Mon Apr 23, 2007 3:18 pm

Post » Tue Aug 13, 2013 9:27 am

Debug.notification(“OMZstage: ” + OMZstage)
Those aren't the right quotation marks; wrong character.

Also,
If OMZstage == 5
...rather than...
If OMZstage = 5
...and you needed a OMZspell property to compare akSpell to.

Compiles:
Spoiler

Import UtilityInt Property OMZstage AutoSpell Property OMZspell Auto ; Property was MIAEvent OnSpellCast(Form akSpell)	If akSpell == OMZspell ; no need for spellCast var		While OMZstage <= 4			OMZstage += 1			;WIP FX(OMZstage)			Debug.Notification("OMZstage: " + OMZstage)			Utility.Wait(0.7)			If OMZstage == 5				RegisterForCrosshairRef()				Game.DisablePlayerControls(True, False, False, False, False, True) ; Disable only movement and menu			EndIf		EndWhile	EndIfEndEventEvent OnCrosshairRefChange(ObjectReference ref)	UnregisterForCrosshairRef()	Debug.Notification("Crosshair ref: " + ref)	If ref		;WIP	EndIfEndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)	Game.EnablePlayerControls()	If OMZstage <= 5		OMZstage = 0	EndIfEndEvent
User avatar
Tom
 
Posts: 3463
Joined: Sun Aug 05, 2007 7:39 pm


Return to V - Skyrim