Error when compiling scripts

Post » Sun Jul 07, 2013 2:48 pm

Okay When i made this script it won't compile

Scriptname teq01startup extends ObjectReference

Quest Property teq01opentostart Auto
Event OnActivate(Book treeentbook auto)
teq01.setstage (10)
endEvent

When I save it, it says

Starting 1 compile threads for 1 files...
Compiling "teq01startup"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\teq01startup.psc(4,34): extraneous input 'auto' expecting RPAREN
No output generated for teq01startup, compilation failed.

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

any ideas as to how I can stop this or actually compile the script?

User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Sun Jul 07, 2013 2:38 pm

The error says it all... The "auto" in the Event line is extraneous. The area between the parentheses is where parameters are defined, not variables or properties.

Also, the OnActivate event fires whenever the object the script is attached to is activated, so if you were hoping to catch the player activating a book, that's not how it works. Also, you should always copy the event's parameters from the wiki. For instance, OnActivate's parameter is an ObjectReference, not a Book. It would compile, but it won't work.

I recommend attaching the script to the book that you've placed in the cell and using the http://www.creationkit.com/OnRead_-_ObjectReference event.

User avatar
Jon O
 
Posts: 3270
Joined: Wed Nov 28, 2007 9:48 pm

Post » Sun Jul 07, 2013 12:34 pm

Okay the script is attached to the book but what do I do with the "auto" ?

User avatar
I’m my own
 
Posts: 3344
Joined: Tue Oct 10, 2006 2:55 am

Post » Sun Jul 07, 2013 3:17 pm

Don't flag parameters as "auto", because it's nonsense. OnRead doesn't even have any parameters to define.

Your script should look like this:

Scriptname teq01startup extends ObjectReference  Quest Property teq01opentostart  AutoEvent OnRead()	teq01opentostart.setstage(10)EndEvent
User avatar
Marquis T
 
Posts: 3425
Joined: Fri Aug 31, 2007 4:39 pm

Post » Sun Jul 07, 2013 4:47 pm

Thanks that script worked pefectly

User avatar
Darren Chandler
 
Posts: 3361
Joined: Mon Jun 25, 2007 9:03 am

Post » Sun Jul 07, 2013 8:42 am

any ideas on this one??

Scriptname teq01wheretogonext extends ObjectReference

Quest Property teq01gotoentking Auto
Event OnRead()
teq01.setstage(30)
EndEvent

then

Starting 1 compile threads for 1 files...
Compiling "teq01wheretogonext"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\teq01wheretogonext.psc(5,0): variable teq01 is undefined
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\teq01wheretogonext.psc(5,6): none is not a known user-defined type
No output generated for teq01wheretogonext, compilation failed.

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

User avatar
Laura
 
Posts: 3456
Joined: Sun Sep 10, 2006 7:11 am

Post » Sun Jul 07, 2013 12:51 am

Line 5, character 0 (so, start of line 5), you have teq01.setstage(30).

But teq01 isn't defined anywhere (hence the error "is undefined"). So, I assume you have a quest called teq01? You need to add a property

Quest Property teq01 Auto

and in the CK fill that property with the quest.

By the way, have you worked through the tutorials http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World (and the subsequent ones) and http://www.creationkit.com/Bethesda_Tutorial_Basic_Quest_Scripting? They might help clear up some points in a more structured way.

User avatar
Marie
 
Posts: 3405
Joined: Thu Jun 29, 2006 12:05 am


Return to V - Skyrim

cron