Setting a global variable? How?

Post » Wed Jul 08, 2015 1:28 am

Hey there!

I'm trying to find out why my script isn't working! Can anyone please help?
vmWaterValveOpen is a short int global variable, that I've created in the object window, under misc/global.
The activator is a dwemer valve.
The error message is: required (...)+ loop did not match anything at input ','

Scriptname VanaheimWaterValve extends ObjectReference  {The Water Valve governing script}bool property bidirectional = True Auto{Should the valve alternate directions with each activation? Default: True}bool flip = FalseAuto STATE Waiting	EVENT onActivate (objectReference triggerRef)		self.BlockActivation(true)		if (flip)			playAnimationandWait("trigger02","Trans02")			SetValueInt.vmWaterValveOpen(1)		Else			playAnimationandWait("trigger01","Trans01"),			SetValueInt.vmWaterValveOpen(0)		EndIf		flip = !flip		self.BlockActivation(false)	endEVENTendState

Thanks so much!

User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Wed Jul 08, 2015 3:02 am

Is it because your OnActivate Event has a space before its arguments are declared? I've never seen anyone declare their events like that?

Which line does the compiler indicate as problematic?

User avatar
JAY
 
Posts: 3433
Joined: Fri Sep 14, 2007 6:17 am

Post » Tue Jul 07, 2015 11:36 pm


That wasn't the case.
Actually this script is originally attached to the dwemer valve activator, I just modified it by adding the
SetValueInt
lines.

Oh, by the way the trouble is at VanaheimWaterValve.psc(16,46): required (...)+ loop did not match anything at input ',
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Tue Jul 07, 2015 11:46 am

Have you declared your global variable as a property?

GlobalVariable Property vmWaterValveOpen Auto
User avatar
Flash
 
Posts: 3541
Joined: Fri Oct 13, 2006 3:24 pm


Return to V - Skyrim