Setting A Conditional On A Trigger

Post » Thu Jun 21, 2012 1:30 pm

I am trying to use a SetStage trigger box to trigger a quest.

However, I also want to ensure a different quest has been completed before the trigger box is set.

The conditional I'm trying to use isn't able to compile. I get an error about EOF and no output generated.

Can someone help me with the proper syntax for this?

Scriptname LBGSetStageOnEnter extends defaultOnEnter  conditional{sets a quest stage when the specified ref or refs are in the trigger}quest property myFirstQuest auto{ The quest that must be completed before trigger }quest property myQuest auto    { quest to call SetStage on}int property stage auto{ stage to set};total targets currently in the triggerint targetCountCurrent;how many targets are we looking for? When targetCountCurrent reaches this, we triggerint targetCountTotal; what happens when all my targets are in the trigger?; override on subclass to change behavior; Has the other quest been completed?If getquestcompleted(myFirstQuest) != 1function TriggerMe()    myQuest.setStage(stage)    parent.TriggerMe()endFunctionendif

I have also tried game.getplayer().getquestcompleted(myFirstQuest) != 1 but that isn't compiling either.

Any help would be much appreciated!
User avatar
Beulah Bell
 
Posts: 3372
Joined: Thu Nov 23, 2006 7:08 pm

Post » Thu Jun 21, 2012 7:16 pm

GetQuestCompleted is a condition, used in the editor. In a script you use

if myFirstQuest.IsCompleted()
User avatar
OJY
 
Posts: 3462
Joined: Wed May 30, 2007 3:11 pm

Post » Thu Jun 21, 2012 8:15 am

GetQuestCompleted is a condition, used in the editor. In a script you use

if myFirstQuest.IsCompleted()

Thanks for the reply Ingenue

I am still getting the error "missing EOF at if" when I try to compile it.
User avatar
Lady Shocka
 
Posts: 3452
Joined: Mon Aug 21, 2006 10:59 pm

Post » Thu Jun 21, 2012 3:28 pm

Sorry, that was just the if line - you would need to put an endif after whatever came next.
User avatar
Sweet Blighty
 
Posts: 3423
Joined: Wed Jun 21, 2006 6:39 am

Post » Thu Jun 21, 2012 6:56 am

The whole thing is:

if myFirstQuest.IsCompleted()function TriggerMe()	myQuest.setStage(stage)	parent.TriggerMe()endFunctionendif

So the endif is there
User avatar
Rich O'Brien
 
Posts: 3381
Joined: Thu Jun 14, 2007 3:53 am

Post » Thu Jun 21, 2012 5:56 pm

"EOF" means Event Or Function. It means that you're not putting your code between the event or function wrappers.

EDIT: You also cannot put one function inside of another function.
User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Post » Thu Jun 21, 2012 4:52 am

"EOF" means Event Or Function. It means that you're not putting your code between the event or function wrappers.

EDIT: You also cannot put one function inside of another function.

Wow...how would I get around that?
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm

Post » Thu Jun 21, 2012 3:54 am

I am not quite sure what you're trying to do.

Edit: What event are you calling this in?
User avatar
Vera Maslar
 
Posts: 3468
Joined: Wed Sep 27, 2006 2:32 pm

Post » Thu Jun 21, 2012 2:28 pm

Yes.

However I just tried compiling that very thing and it didn't work.

Something about a missing reference

edit

Object reference not set to an instance of an object

That is the error
User avatar
Michelle Serenity Boss
 
Posts: 3341
Joined: Tue Oct 17, 2006 10:49 am

Post » Thu Jun 21, 2012 2:23 pm

I am not quite sure what you're trying to do.

Edit: What event are you calling this in?

This is a SetStage on enter trigger where I am going to start a quest if another quest has NOT been completed yet

edit

This is to keep players from entering the Lamplight town if they have not started the main quest.

An NPC will come to the player and tell them to get lost.

And the player is teleported to the exterior.
User avatar
CArla HOlbert
 
Posts: 3342
Joined: Wed Feb 21, 2007 11:35 pm

Post » Thu Jun 21, 2012 8:42 am

Your script is extending "defaultOnEnter". I took a look at it and I want to know, do you really need all of that? What exactly are you trying to do?

If you just want to set a quest stage, why not use "defaultSetStageOnEnter" or "defaultSetStageTrigSCRIPT"?
User avatar
Soph
 
Posts: 3499
Joined: Fri Oct 13, 2006 8:24 am

Post » Thu Jun 21, 2012 11:11 am

Edit: ignore me, just realized you did post the whole thing higher up :)
User avatar
Makenna Nomad
 
Posts: 3391
Joined: Tue Aug 29, 2006 10:05 pm

Post » Thu Jun 21, 2012 3:42 pm

Your script is extending "defaultOnEnter". I took a look at it and I want to know, do you really need all of that? What exactly are you trying to do?

If you just want to set a quest stage, why not use "defaultSetStageOnEnter" or "defaultSetStageTrigSCRIPT"?

The trigger box is a SetStageOnEnter trigger.

This is the script attached to it.

However, I don't want to fire this trigger if the player has completed the initial quest. And if they have not completed the quest then force them outside.

So, I have to add a condition to the script.

edit

It's a DefaultSetStageOnEnter trigger

edit edit

I changed the name of the script so I don't mess with the vanilla script, btw :)
User avatar
The Time Car
 
Posts: 3435
Joined: Sat Oct 27, 2007 7:13 pm

Post » Thu Jun 21, 2012 7:57 pm

Nevermind about "defaultsetstageonenter". I'm too lazy to go look through the vanilla scripts, but really all you need is something like this:

Scriptname ExampleTriggerScript extends ObjectReferenceQuest Property Quest01 AutoQuest Property Quest02 AutoInt Property Stage AutoEvent OnTriggerEnter(ObjectReference akTriggerRef)    if (akTriggerRef == Game.GetPlayer() && !Quest01.IsCompleted())        Quest02.SetStage(Stage)    endifEndEvent
User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Thu Jun 21, 2012 2:43 pm

Ok...I see what you did there. This is cool because I can use a generic trigger for it.

Is there a listing somewhere of the akWhatever?

I really want to learn the syntax and I've done a lot of searching but some things are hard to find.

I'm going to try that script out now :)

Thanks!
User avatar
Jordyn Youngman
 
Posts: 3396
Joined: Thu Mar 01, 2007 7:54 am

Post » Thu Jun 21, 2012 1:25 pm

Is there a listing somewhere of the akWhatever?

There is this http://www.creationkit.com/Category:Papyrus.
User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Post » Thu Jun 21, 2012 12:18 pm

There is this http://www.creationkit.com/Category:Papyrus.

Huh...I've never heard of that one...thanks!

Let me ask you this.

By setting a stage in a quest that has not yet started, like to stage 10, would that automatically start that quest?

Or is there something else I should do to start the second quest?

edit

That link went to the creation kit wiki...I didn't find what I was looking for there before but I'll try again :)
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Post » Thu Jun 21, 2012 4:47 pm

i still think you are better off manipulating your load door in some way instead of allowing the player to sit through a load screen into the new area, then sit through another load screen when they are forced out
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am

Post » Thu Jun 21, 2012 5:10 am

i still think you are better off manipulating your load door in some way instead of allowing the player to sit through a load screen into the new area, then sit through another load screen when they are forced out

I agree but I didn't know you can set a condition and a stage on an auto-load door :/

I guess I could put the trigger box outside and have the NPC there ready.

If the 1st quest hasn't been completed the NPC will tell them they aren't welcome and the trigger won't work unless the 1st quest is complete too,

That way it wouldn't be so confusing.
User avatar
Miragel Ginza
 
Posts: 3502
Joined: Thu Dec 21, 2006 6:19 am

Post » Thu Jun 21, 2012 1:39 pm

By setting a stage in a quest that has not yet started, like to stage 10, would that automatically start that quest?

Yes. And if the quest has a start up stage - I mean a stage that has the start up stage box checked, not just a first stage - that will automatically run first.

That link went to the creation kit wiki...I didn't find what I was looking for there before but I'll try again

You can look up On.... events from that page and see their parameters. Sorry if it's not what you meant. I love that page though :)
User avatar
Yonah
 
Posts: 3462
Joined: Thu Aug 02, 2007 4:42 am

Post » Thu Jun 21, 2012 6:30 pm

Is there a listing somewhere of the akWhatever?

JustinOther made a post on the forums somewhere that explained the syntax, but for most things, it really doesn't matter what you use. In the example I gave, I could just as easily have used:

Event OnTriggerEnter(ObjectReference q843uptiopjwfj)    if (q843uptiopjwfj == Game.GetPlayer() && !Quest01.IsCompleted())        Quest02.SetStage(Stage)    endifEndEvent

The only things that have special variables would be the various http://www.creationkit.com/Category:Fragments.

I agree but I didn't know you can set a condition and a stage on an auto-load door :/

Why not just have the door be initially disabled, and then enable it in the last stage of your main quest?
User avatar
Fluffer
 
Posts: 3489
Joined: Thu Jul 05, 2007 6:29 am

Post » Thu Jun 21, 2012 5:33 am

Why not just have the door be initially disabled, and then enable it in the last stage of your main quest?

You guys never cease to impress me...that's a great idea!

I have two entrances to the town but that shouldn't be a problem

I had no idea about the syntax you talked about.

I thought the akWhatever is a set-in-stone variable or function of some type.

But really I could actually use akWhatever and it would actually work lol
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am

Post » Thu Jun 21, 2012 8:21 pm

You can look up On.... events from that page and see their parameters. Sorry if it's not what you meant. I love that page though :smile:

My problem is mostly the wiki itself. I seems that most of it presumes you know pretty well what you're doing and doesn't go into enough details for the noobs.

I have so much to do for this mod It will probably take me another year to get it done lol
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Thu Jun 21, 2012 7:18 pm

I have yet one more question...if I may

How do you enable an object through a fragment?

In the last stage of the 1st quest I want the load doors to be enabled. So under "SetObjectiveCompleted(30)" in the fragment box I will need to enable both of the load doors.

Or maybe I should start a new thread :/
User avatar
Hope Greenhaw
 
Posts: 3368
Joined: Fri Aug 17, 2007 8:44 pm

Post » Thu Jun 21, 2012 11:16 am

declare the doors as objref properties and fill them in the properties window

then in the fragment

Door1Ref.Enable()
Door2Ref.Enable()

the names Door1Ref etc are the names of the properties you declare, you can name these whatever
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Next

Return to V - Skyrim