When are Quest Aliases filled? Can I force it?

Post » Thu Jun 21, 2012 7:58 pm


Your questions about carriages actually got me to try making a drivable carriage (before I found out it was already made) and the way I detected followers was to start a quest when the cart is activated.

The quest would have 4 optional reference aliases (since there are only 4 seats in the cart) with the match conditions:

GetFactionRank CurrentFollowerFaction >= 0
IsRidingHorse == 0

The reference aliases had an attached script that told the actors to use SetVehicle and PlayIdle in the OnInit event.

I am doing something similiar for my quest alias... but it does not return the followers. But this gives me some insight... when does the CK evualuate the conditions for the Alias? I was just *assuming* it was when I wanted them, but that's probably not the way it works and why I was not getting the results I expected.

Is there a way to force them just before I send them to my script properties?
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Post » Thu Jun 21, 2012 5:13 pm

The conditions are evaluated when the quest is started. I forgot to say that you must check the boxes for "In Loaded Area" and "Closest" for the optional aliases.
User avatar
Sudah mati ini Keparat
 
Posts: 3605
Joined: Mon Jul 23, 2007 6:14 pm

Post » Thu Jun 21, 2012 7:42 pm

Aliases are filled when the quest is started, unless you specifically force them (Alias.ForceRefTo()) in a script.
User avatar
gary lee
 
Posts: 3436
Joined: Tue Jul 03, 2007 7:49 pm

Post » Thu Jun 21, 2012 3:14 pm

Thanks INgenue, yes, I just "saw" this from the Quest Tab Wiki page:
>The list of aliases is an ordered list - when the quest starts, aliases are filled in order, and the order can matter in the case of aliases which are directly or indirectly
>(through conditions referring to other aliases) dependent on each other.

Randomnoob, yes, I was using the "In Loaded Area" and "Closest" checkboxes also, but, that still doesn't change when it fills the aliases, right?

So if I have a quest that start with the game and always running (my carriage quest does just that), it's still evaluating the conditions when the game starts?

So, can I force the quest to reevaluate those aliases? Or do I just need to scrap that idea? (I wanted to use the Quest Conditions to fill the follower aliases when the player is ready to take a ride.)
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Thu Jun 21, 2012 9:44 am

Then you would need to create a second quest containing those aliases, that's not start game enabled, and only start it when you get into a cart. You stop it when you get out of the cart.
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Thu Jun 21, 2012 11:51 am

You could start another quest at that point, with fill type set to Find matching etc, and then either use its Aliases directly or use Alias.ForceRefTo to assign them to your first quest's aliases.

Aargh, just repeating Randomnoob's reply again. Curse this slow connection....
User avatar
james tait
 
Posts: 3385
Joined: Fri Jun 22, 2007 6:26 pm

Post » Thu Jun 21, 2012 4:25 pm

Depending on how much state information you need in your quest you might just be able to stop and restart the main quest itself.

In playing around I learned that you can stop and restart a quest from a script attached to one of it's aliases. The only problem is that when you restart a quest everything about it gets reset including any script variables. But the existing function that is calling the Stop and Start can still be running after the restart and if it had stashed any property or variable values into local copies (declared inside the function) then it can use those to restore the global values after the quest restarts.

Here's how my mod now resets itself to support upgrading from version 0.5 to version 0.6 of my Storage Helpers mod. And thinking about 0.7 I've set it up so that any key remapping you do in version 0.6 will be copied over for version 0.7. (Which is more than I can say for Bethesda's 1.6 Beta patch.) Doing it this way allows me to check a few other variables to make sure it's a reasonable time to be stopping the quest too but if you have lots of state information this would probably be a bad idea.
Spoiler
int[] KeyCode					; The key codes and their descriptions for the menusstring[] KeyDescbool[] listLocked 		; a weak attempt to lock the list, probably insufficient, but it will have to do.bool initFinished		; a safety check used when restarting the quest to preserve key mappingsint GrabMode			; How should containers respond to a grab, and should quick-keys be monitored.Function EnsureSaneConfiguration(bool preserve = true){Call on every game load (safe to call multiple times). Stops and restarts the quest but preserves the key mappings!}	if !soundInstance && !listLocked[0] && initFinished		int mode = GrabMode		int[] code = new int[8]		int i = 0		while i < KeyCode.length	; copy of the key codes			code[i] = KeyCode[i]			i += 1		endwhile		initFinished = false		GetOwningQuest().Stop()		GetOwningQuest().Start()	; this is latent, but it doesn't block!		while !initFinished		; implements a signal to know that init has finished.			Utility.Wait(0.01)		endwhile		while i > 0				; restore the user's key mapping			i -= 1			KeyCode[i] = code[i]		endwhile		GrabMode = mode	endifEndFunctionEvent OnInit(){Basic variable setup. (UpdateWeight will check for SKSE.)}	Utility.Wait(0.0001)	; wait to initialize in GameMode	InitKeyData()	InitCraftSupplyKW()	listLocked = new bool[1]	UpdateWeight()	initFinished = true  ; signal for EnsureSaneConfiguration that it's safe to restore the key mappingsEndEvent
User avatar
Jodie Bardgett
 
Posts: 3491
Joined: Sat Jul 29, 2006 9:38 pm

Post » Thu Jun 21, 2012 6:48 pm

Unfortunately, your suggestion RandomNoob (and Ingenue) doesn't work... seems simple enough, but I still don't get the aliases filled. When I use cdcooley's suggestion of just stopping and starting my quest, it works fine. I used the same selection criteria in both quests, so I know my selection criteria is good. I don't have the "Start Game Enabled" checkbox checked on the AliasOnly quest either. I tried setting a stage to see the display text come up and it does (when I start the quest) but it's still not giving me the followers.

I don't see any issues with just restarting my quest when I need it, and it's working fine. I'll do more testing, but not seeing any drawbacks to that solution. Anyone think of anything that might be a problem? (Oh, and I'm doing the Quest.Stop() & Quest.Start() in the dialog from the driver, before the carriage ride starts. )

Thanks for the responses!
User avatar
GLOW...
 
Posts: 3472
Joined: Thu Aug 03, 2006 10:40 am

Post » Thu Jun 21, 2012 8:14 am

Unfortunately, your suggestion RandomNoob (and Ingenue) doesn't work... seems simple enough, but I still don't get the aliases filled

It is simple, but perhaps your aliases are reserved, so you'd need to check Allow reserved for them. But restarting your first quest is fine if setting or skipping stages won't cause unwanted side effects.
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am


Return to V - Skyrim