Compile Script Failure?

Post » Mon Nov 09, 2015 4:58 am

This is probably gonna show how new I am to modding, kinda embarrassing to even question people with this, but I digress...

I wrote a script (Shown below) for a quest and when I try to compile it it comes out to failure. When I try to read up on all this kind of stuff it's like trying to read Egyptian. What's going on? What am I not doing right? At a quick glance would this script even work? Please help!

Scriptname EndGameQ00S01 extends Quest
{Adds note to inventory for EndGameQuest01.}
Alias_NoteFromQuaranir.TryToEnable()
Game.GetPlayer().AddItem(Alias_NoteFromQuaranir.GetReference())
EndGameQ00S01.SetStage(10)
GetQuestCompleted(EndGameQuest00.GetReference())
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Mon Nov 09, 2015 4:29 pm

Is this your entire script?

You are missing a few important things...

1)

Everything the Script does happens inside of either an 'Event' or a 'Function'. Events are basically situations when the Script will automatically run (for example, "OnInit" will automatically run the first time the Script is initialised in game); Functions are like... Sub-sections which can be ran at specific times, by being called inside an event.

2)

You've not got any properties/Variables...

See how you have 'EndGameQ00S01.setStage(10)'? You'll need to define EndGameQ00S01 as a quest in order for the game to know what sort of 'thing' it is, and what commands it can run upon it; making it a property will allow you to attach the actual Quest Form to that, and make the script run commands on that particular form.

3)

Maybe I'm missing something, but why do you have your note defined as an alias, and using GetReference/TrytoEnable? If it's a Note placed in world (and in a reference Alias) you'd probably want to 'activate' it instead, to force the player to read it. But based on what you say, you just want to add the item to the Player's inventory, right?

Try this:

 Book Property NoteFromQuaranir AutoQuest Property EndGameQ00S01 Auto Event OnInit()   Game.GetPlayer().AddItem(NoteFromQuaranir, 1, 1) ; Adds 1 version of the item, with the 'silent flag' set to  true   EndGameQ00S01.SetStage(10)EndEvent

That *should* add the note immediately upon the Script initialising; but you have to remember to fill the Script Properties (next to where you added the Script on the Quest Form) otherwise nothing will happen :P

I would recommend you check out CreationKit.com, and read through the information on Scripts there--like you say, it can be a bit hard to get to grips with at first, but if you read through that, and look at a few of the Vanilla Scripts at the same time, you should be able to see how things are meant to flow :)

What's great is that the Wiki has details on like... 99% of the functions the game uses... so pretty much anything you're unsure of you'll be able to find there :)

(I'm actually really bad at explaining this stuff, but hopefully you get what I am trying to say above :) If not, I'm sure someone else can word it a bit clearer :D One tip I would give you: if you can, post the error the CK prints out--that usually tells you exactly which line the error occurs on, and a gives a good idea of what has gone wrong :) )

User avatar
Ann Church
 
Posts: 3450
Joined: Sat Jul 29, 2006 7:41 pm

Post » Mon Nov 09, 2015 8:25 pm

Thanks a bunch! Now lets just hope that my SM Event runs right! That was at least a little more straight forward though. :)

User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am


Return to V - Skyrim