Jump to content

Compile Error - Missing EOF at "If"


Recommended Posts

Just wondering what's wrong with this script:
 
 

Scriptname CRSoulHouseQuest1CheckIfWaited extends Quest Hidden

Function CRSoulUpdaterOne()
     RegisterForUpdateGameTime(8.0)
endFunction

if CRSoulHouseQuest1.getStage() == 0
     Event OnUpdateGameTime()
          UnregisterForUpdateGameTime()
          CRSoulHouseQuest1.setStage() = 900
     endEvent
endIf
 
Basically, the game is checking every 8 in game hours after this quest has started, whether or not the player didn't achieve a specific goal or not (IE: hasn't advanced the quest past stage 0.) But the CK gives this error:
 
 
Starting 1 compile threads for 1 files...
Compiling "CRSoulHouseQuest1CheckIfWaited"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(7,0): missing EOF at 'if'
No output generated for CRSoulHouseQuest1CheckIfWaited, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on CRSoulHouseQuest1CheckIfWaited
Link to comment

As I don't have the rest of your files to work with, try this instead:

 

Scriptname CRSoulHouseQuest1CheckIfWaited extends Quest Hidden
 
Function CRSoulUpdaterOne()
     RegisterForUpdateGameTime(8.0)
endFunction
 
 
Event OnUpdateGameTime()
if CRSoulHouseQuest1.getStage() == 0
          UnregisterForUpdateGameTime()
          CRSoulHouseQuest1.setStage() == 900
endif
endEvent

 

Link to comment

I have no experience in scripting in Skyrim but I'm looking a t it from a developers point. This line here CRSoulHouseQuest1.setStage() = 900 looks odd to me as in other languagues it would assign a valuen to a function call instead of calling a function with a value like in CRSoulHouseQuest1.setStage(900)

 

Dunno if that's the problem, but you never know.

Link to comment

I have no experience in scripting in Skyrim but I'm looking a t it from a developers point. This line here CRSoulHouseQuest1.setStage() = 900 looks odd to me as in other languagues it would assign a valuen to a function call instead of calling a function with a value like in CRSoulHouseQuest1.setStage(900)

 

Dunno if that's the problem, but you never know.

 

Yours was the problem, now I get these errors:

Starting 1 compile threads for 1 files...
Compiling "CRSoulHouseQuest1CheckIfWaited"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(8,8): variable CRSoulHouseQuest1 is undefined
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(8,26): none is not a known user-defined type
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(8,37): cannot compare a none to a int (cast missing or types unrelated)
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(10,10): variable CRSoulHouseQuest1 is undefined
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(10,28): none is not a known user-defined type
No output generated for CRSoulHouseQuest1CheckIfWaited, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on CRSoulHouseQuest1CheckIfWaited

Serious note, the script is inside the quest CRSoulHouseQuest1, so it can't be undefined (since it knows that's the quest it's referencing to, and thusit isn't undefined.)

 

Should I set it to parent.getStage and parent.setStage instead? Since the script is running inside the quest, and not alone.

Link to comment


 
Scriptname CRSoulHouseQuest1CheckIfWaited extends Quest Hidden
 

Quest Property CRSoulHouseQuest1 Auto
 

Function CRSoulUpdaterOne()
     RegisterForUpdateGameTime(8.0)
endFunction
 
Event OnUpdateGameTime()
  if CRSoulHouseQuest1.getStage() == 0
    UnregisterForUpdateGameTime()
    CRSoulHouseQuest1.setStage(900)
  endIf
EndEvent
 

 

Link to comment
 
Scriptname CRSoulHouseQuest1CheckIfWaited extends Quest Hidden
 

Quest Property CRSoulHouseQuest1 Auto
 

Function CRSoulUpdaterOne()
     RegisterForUpdateGameTime(8.0)
endFunction
 
Event OnUpdate()
  if CRSoulHouseQuest1.getStage() == 0
     Event OnUpdateGameTime()
          UnregisterForUpdateGameTime()
          CRSoulHouseQuest1.setStage(900)
     endEvent
  endIf
EndEvent
 

 

Yours gives the following error:

 

 

Starting 1 compile threads for 1 files...
Compiling "CRSoulHouseQuest1CheckIfWaited"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CRSoulHouseQuest1CheckIfWaited.psc(13,5): mismatched input 'Event' expecting ENDIF
No output generated for CRSoulHouseQuest1CheckIfWaited, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on CRSoulHouseQuest1CheckIfWaited
Link to comment

 

...

 

Yeah, I didn't see it.

 

Fixed in my previous post.

 

 

I kind of figured it had something to do with not getting the Quest ID and defining it in the script. I just didn't figure out how to do that. Thank you though, the script compiles now, now all I have to do is write the rest of the stages/etc. and test it.

 

I've never done things so complex as these, prior, I only did NPC followers, changing leveled states, etc. But making a house and attaching a quest to it like this is really involving. I'm glad that, even with all of its bugs, the Creation Kit exists. I couldn't imagine how you'd mod this otherwise.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use