Cannot start quest from another quest script

Post » Fri Nov 16, 2012 2:44 pm

I am dabbling with scripting in the CK, trying to familiarize myself with the Papyrus system.

I wanted to create a small quest script which only starts another quest.

Here it is:

Scriptname DeathlessSJinit extends QuestQuest property DEAjumpit auto;===========================================Event OnInit()    RegisterForSingleUpdate(0.1)    Debug.Notification("Start")    EndEvent;===========================================Event OnUpdate()        DEAjumpit.Start()EndEvent;===========================================

I thought this would start the DEAjumpit quest, the notification appears but the quest doesn't start, I checked with GetQR. I also attached another script to the DEAjumpit quest to get another notification, but it never shows.

Can someone help me, what am I doing wrong?
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Fri Nov 16, 2012 4:06 pm

Are you sure you have resolved the property for DEAjumpit in the Creation Kit?
User avatar
Miragel Ginza
 
Posts: 3502
Joined: Thu Dec 21, 2006 6:19 am

Post » Fri Nov 16, 2012 5:01 pm

Are you sure you have resolved the property for DEAjumpit in the Creation Kit?

Since I don't know what you mean, I guess I didn't :). Sorry, I just started with this yesterday, and it's very different from Oblivion scripting...
User avatar
Naughty not Nice
 
Posts: 3527
Joined: Sat Nov 04, 2006 6:14 am

Post » Fri Nov 16, 2012 5:46 pm

If you've attached the script to your quest in the Creation Kit, you need to open the Properties menu, add a value for your quest property, and select your quest from the dropdown. Or, if the property and the quest are the same name, press "auto-fill all" to have the Creation Kit do it for you.

For a more detailed explanation with screenshots, http://tesalliance.org/forums/index.php?/topic/5039-class-2-properties/
User avatar
Avril Churchill
 
Posts: 3455
Joined: Wed Aug 09, 2006 10:00 am

Post » Fri Nov 16, 2012 5:53 pm

I also have a problem very similar to this one. However I am not starting my quest through another quest, but through an object that has to be activated (think pullchain).
I've also written two debug scripts, which inform me whether starting the quest was successful and whether the quest is continuously running.

Now here's the problem, when I activate my object, it returns to me that the quest was not started successfully. However I am quite sure I am not doing anything much different than Deathless Aphrodite.
The script on my object looks like this:

Scriptname SomeQuest02_DebugScript02 extends ObjectReference  Quest Property SomeQuest02  Auto  Event OnActivate(ObjectReference akActionRef)    SomeQuest02.Start()    SomeQuest02.SetStage(0)    SomeQuest02.SetObjectiveDisplayed(0)    Debug.MessageBox("SomeQuest02 Stage " + SomeQuest02.GetStage())    if SomeQuest02.Start()        Debug.MessageBox("SomeQuest02 was started successfully!")    Else        Debug.MessageBox("SomeQuest02 was NOT started successfully!")    EndifEndEvent
I've also added the SetStage() and SetObjectiveDisplayed() functions after I already tried with just Start(), but it seems to make no difference. Is the Start() function broken?
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Fri Nov 16, 2012 8:24 pm

I also have a problem very similar to this one. However I am not starting my quest through another quest, but through an object that has to be activated (think pullchain).
I've also written two debug scripts, which inform me whether starting the quest was successful and whether the quest is continuously running.

Now here's the problem, when I activate my object, it returns to me that the quest was not started successfully. However I am quite sure I am not doing anything much different than Deathless Aphrodite.
The script on my object looks like this:

Scriptname SomeQuest02_DebugScript02 extends ObjectReference  Quest Property SomeQuest02  Auto  Event OnActivate(ObjectReference akActionRef)	SomeQuest02.Start()	SomeQuest02.SetStage(0)	SomeQuest02.SetObjectiveDisplayed(0)	Debug.MessageBox("SomeQuest02 Stage " + SomeQuest02.GetStage())	if SomeQuest02.Start()		Debug.MessageBox("SomeQuest02 was started successfully!")	Else		Debug.MessageBox("SomeQuest02 was NOT started successfully!")	EndifEndEvent
I've also added the SetStage() and SetObjectiveDisplayed() functions after I already tried with just Start(), but it seems to make no difference. Is the Start() function broken?
No, Start() is not broken. Look again closely at the post before yours by Thomas Kaira
User avatar
Keeley Stevens
 
Posts: 3398
Joined: Wed Sep 06, 2006 6:04 pm

Post » Fri Nov 16, 2012 3:28 pm

There is the possibility you forgot to check the box 'startup stage' as well. Without that, you'd have to do a setStage to get it going for real I think. I agree with making sure your property is filled first though. As for the second person's code, do you have a stage "0"? If not, you may have to set this to your started stage.

I haven't messed around too much with using functions as booleans, but as written I'm not sure if doing an 'if thequest.Start()' would return something meaningful. You may want to try an isStopped or isStarting. Also, if the quest is non-repeating you could do a getStage to see if it's triggered.
User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Fri Nov 16, 2012 10:55 am

There is the possibility you forgot to check the box 'startup stage' as well. Without that, you'd have to do a setStage to get it going for real I think. I agree with making sure your property is filled first though. As for the second person's code, do you have a stage "0"? If not, you may have to set this to your started stage.

I haven't messed around too much with using functions as booleans, but as written I'm not sure if doing an 'if thequest.Start()' would return something meaningful. You may want to try an isStopped or isStarting. Also, if the quest is non-repeating you could do a getStage to see if it's triggered.
I have a stage 0, which is the startup stage and the required Property is filled.
The wiki, from what I could gather, said that .Start() returns a true or false value, which is dependent on whether the quest was started up successfully or was not started at all, but to make absolutely sure I have also written a debug script which tells me whether the quest is currently running. For that I used the .IsRunning() function, but that one tells me it won't work, as well. So as a last resort when I use the console with the command player.sqs for my quest, it shows that stage 0 was actually set, however quest related scripts still didn't activate.


Alright I did a new test on this whole matter with an entirely freshly created quest. It works now. So I'd assume either one of the aliases or one of the scripts didn't work out as planned, but I believe that it was the aliases is most likely. So disregard what else I posted, the .Start() works fine and I must simply have made some stupid mistake somewhere else.
User avatar
Spooky Angel
 
Posts: 3500
Joined: Thu Aug 10, 2006 5:41 pm

Post » Fri Nov 16, 2012 1:05 pm

If you've attached the script to your quest in the Creation Kit, you need to open the Properties menu, add a value for your quest property, and select your quest from the dropdown. Or, if the property and the quest are the same name, press "auto-fill all" to have the Creation Kit do it for you. For a more detailed explanation with screenshots, http://tesalliance.org/forums/index.php?/topic/5039-class-2-properties/

Thanks, that was actually it. That page you've linked to is amazing. Now the quest is running, it is a quest with another script attached to it so I don't think it needs a Stage. BUT the script doesn't seem to run if I use OnReset as event, isn't OnReset a good event type to make the script run as soon as the quest is started? I've solved it using OnInit in a way that it doesn't do anything the first time it's called on game load. But I'm curious about OnReset, is it broken for scripts?
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Fri Nov 16, 2012 6:01 pm

It's cool you guys both got your stuff working! DrAutumn's script shoulda worked, given all the stuff in the last post is true. My next suggestion would have been that the fragment file somehow became corrupt. I had this happen to me not so long ago; by simply deleting a quest stage I didn't need, half of the fragment's scripting was jumbled or outright deleted. I've heard this isn't very common, but it does happen.. twice for me now (apparently it's a session-based issue?).

By remaking it from scratch you would have eliminated that corruption altogether.. just keep that in mind if you add or delete quest stages after having created the fragment file. EG: create your stages, do your fragment; then any changes you make in the future, open that fragment file up and double-check the code to ensure it matches what the CK shows before reloading the plugin in a new session. While still in the same session, it shows correctly - but may pop up some kind of 'validation' error... sound familiar?

[EDIT: I think onReset only runs when the ref/alias the script is attached to is actually reset, though it's supposed to when the quest first starts - perhaps your quest needs to be reset as well as the alias? OnInit only runs once as well (either when the plugin/quest first runs, or when the alias is first filled I think). I might suggest using a custom function and maybe placing it in an onCellAttach event.
http://www.creationkit.com/OnReset_-_ObjectReference

I haven't messed with quests and aliases too much yet. But if it's like anything else in Skyrim that's 'brand new', then it's bound to have a bug or two somewhere.. I already explained that to be the case regarding fragments. Point is, onReset may be one of those bugs or non-up-to-par functions.]
User avatar
Ella Loapaga
 
Posts: 3376
Joined: Fri Mar 09, 2007 2:45 pm

Post » Fri Nov 16, 2012 9:16 pm

OnInit() runs when you start the quest, but it also runs the first time you load the game with the new script in it. This is really absurd, the quest is not even started but the scripts starts all the same. Then when you start the quest the script is initialized a second time... Anyway a simple check is enough to make the first initialization irrelevant.
User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm


Return to V - Skyrim