Script Help Needed, missing EOF at 'if'

Post » Tue Jun 19, 2012 6:28 pm

This script should turn a campfire & linked light on/off depending on time.

Error Message : (16,6) missing EOF at 'if'

I'm not sure if the 'if' is actually the problem or i'm missing some properties.
The script is one I had in fallout so this may not be helping.
Could anyone help me correct this please? i'm not too clever with the new properties or scripting ways.

Spoiler

Scriptname svxCampfireScript1 extends ObjectReference

; Forward = Initial turn-on/warm-up state
; SpecialIdle = Fully bright, occasional flicker
; Backward = off

short bInitialized
short bLit ; 1 = Light is on.
short bFlicker ; 1 = Light is fully bright and occasionally flickering.
float fTimer
float fRandomDelay
ref LinkedLight

begin OnLoad

if bInitialized == 0
PlayGroup Backward 1
set bInitialized to 1
endif
end

begin GameMode

if bLit
if GetCurrentTime < 20.0 || GetCurrentTime > 23.0
set LinkedLight to GetLinkedRef
PlayGroup Backward 1
set bLit to 0
set bFlicker to 0
LinkedLight.disable
elseif bFlicker == 0
if fTimer < fRandomDelay
set fTimer to fTimer + GetSecondsPassed
else
set fTimer to 0
PlayGroup SpecialIdle 1
set bFlicker to 1
endif
endif

else
if GetCurrentTime > 20.0 && GetCurrentTime < 23.0
set LinkedLight to GetLinkedRef
PlayGroup Forward 1
set bLit to 1
LinkedLight.enable
set fRandomDelay to 15 + 10.0/99.0 * GetRandomPercent
endif
endif

end
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Tue Jun 19, 2012 8:15 pm

You can't mix the old 'script' language with the new 'papyrus' language. You have to convert that all over to papyrus.
User avatar
Stephy Beck
 
Posts: 3492
Joined: Mon Apr 16, 2007 12:33 pm

Post » Tue Jun 19, 2012 6:31 am

ok, that solves that then, thanks for the reply, i'll get trying to learn the new system :)
User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm

Post » Tue Jun 19, 2012 4:35 am

Ya, thats not papyrus script
User avatar
Robert Garcia
 
Posts: 3323
Joined: Thu Oct 11, 2007 5:26 pm


Return to V - Skyrim