Newbie Script Problem Boolean

Post » Tue Jun 19, 2012 2:26 am

I'm trying to create a script function with two conditions. I'm sure this will be an easy one for most of you. I tried looking for examples of boolean conditions on the wiki, but haven't found any yet, though I'm sure it's there somewhere. What's wrong with my syntax?

Scriptname QutCollKeyScript extends ObjectReference  Quest Property QutCollectorManor  Auto  Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)	if (newContainer == Game.GetPlayer()	&& QutCollectorManor.GetStage < 60)		QutCollectorManor.SetStage(65)	endifEndEvent

(I'm trying to set an alternate quest stage if the player pickpockets the key instead of buying it.)
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Mon Jun 18, 2012 8:00 pm

If you want to split a line into extra parts like that, you need to add a "\" at the end of the line to signify that it continues on the next line:
Scriptname QutCollKeyScript extends ObjectReference  Quest Property QutCollectorManor  Auto  Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)        if (newContainer == Game.GetPlayer() \        && QutCollectorManor.GetStage < 60)                QutCollectorManor.SetStage(65)        endifEndEvent
Aside from that, it looks very good.

Cipscis
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Mon Jun 18, 2012 5:55 pm

if newContainer == Game.GetPlayer()

You started a parenthesis but didn't end it. They aren't required, anyway.

Edit: Nvm, I really need to read the next line....
User avatar
James Potter
 
Posts: 3418
Joined: Sat Jul 07, 2007 11:40 am

Post » Tue Jun 19, 2012 1:10 am

I was originally going to say that too :)

The problem is that this is basically exactly what the compiler will think - without the extra character to tell it that the line continues after the line break, it will expect to find at least another character (potentially a closing parenthesis) before a line break.

Cipscis
User avatar
Scott
 
Posts: 3385
Joined: Fri Nov 30, 2007 2:59 am

Post » Mon Jun 18, 2012 5:06 pm

OK, that's progress. Now I get an error message that says "cannot relatively compare variables to None." It seems to not like the GetStage function.

Edit: OK, it likes GetStage(), as opposed to GetStage. Now to see if it works!

Thanks for the help.
User avatar
cutiecute
 
Posts: 3432
Joined: Wed Sep 27, 2006 9:51 am

Post » Tue Jun 19, 2012 6:02 am

Ah, you've also missed the parentheses after http://www.creationkit.com/GetStage_-_Quest:
QutCollectorManor.GetStage()

Cipscis
User avatar
Wayland Neace
 
Posts: 3430
Joined: Sat Aug 11, 2007 9:01 am


Return to V - Skyrim