Very simple script that I just can't get to work!

Post » Wed Aug 07, 2013 1:28 am

Scriptname zzRehnMQ1LeaveNote   Quest Property zzMQ1RehnsIsland  Auto  Event OnRead()	if (zzMQ1RehnsIsland.GetStage() == 20)  		 zzMQ1RehnsIsland.SetStage(30)		zzMQ1RehnsIsland.SetObjectiveDisplayed(30)		Debug.Trace("Quest should advance")	else		Debug.Trace("Has been triggered, no quest advance.")	endifendEvent

This is the code I have for a simple note lying on a table. I want it to advance a quest to stage 30. But only if it's already at stage 20. Otherwise it should no continue. However, the if statement doesn't even seem to fire since none of the debug messages pop up. It's probably something very simple that I seem to miss. But I just can't figure it out. Any help from you pro's out here?

Thanks in advance!

- Rehn

User avatar
Katy Hogben
 
Posts: 3457
Joined: Mon Oct 30, 2006 12:20 am

Post » Wed Aug 07, 2013 4:22 am

Do you mean "show up on screen" when you say "pop up"? If so, then you are using the wrong function. Debug.Notification() shows the string on screen, while Debug.Trace() prints the string in the Papyrus log file.

User avatar
Laura Wilson
 
Posts: 3445
Joined: Thu Oct 05, 2006 3:57 pm

Post » Tue Aug 06, 2013 10:10 pm

Aah, then that's part one of my error. Let's see if that gets me any results! I'll report back with my findings and let's hope this gets me on the right track.

User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Wed Aug 07, 2013 3:18 am

I just noticed that your script doesn't extend any other script. In your case you need to extend the ObjectReference script. Simply modify the first line of your script to look like this:

Scriptname zzRehnMQ1LeaveNote Extends ObjectReference
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Wed Aug 07, 2013 1:58 am

Scriptname zzRehnMQ1LeaveNote

Your script should probably be extending something like ObjectReference or ReferenceAlias:

Scriptname zzRehnMQ1LeaveNote extends ObjectReference

The "OnRead" event is defined in the ObjectReference datatype's script; so if you're not extending that datatype, the game will have no idea what that event is.

Edit: :ninja:

User avatar
Lifee Mccaslin
 
Posts: 3369
Joined: Fri Jun 01, 2007 1:03 am

Post » Wed Aug 07, 2013 4:24 am

Aah, thanks. That helped a lot. It still won't advance the quest like it should. But now I at least get the message that the note is being activated but won't advance the quest. So it's something!

User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Tue Aug 06, 2013 9:48 pm

Did you fill out your Quest Property? Also use a debug message such as

Debug.MessageBox(zzMQ1RehnsIsland+" is at stage "+zzMQ1RehnsIsland.GetStage())

It's easier to debug as it will show you if your property is filled and what stage the quest is actually at.

User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Tue Aug 06, 2013 11:51 pm

Yes, thank you! The property wasn't filled right even though I thought I had. That fixed it, thanks a lot for the help. All of you. :)

User avatar
Kristina Campbell
 
Posts: 3512
Joined: Sun Oct 15, 2006 7:08 am


Return to V - Skyrim