On the verge of a beta release...trouble ahead. Need some he

Post » Wed Jun 20, 2012 11:07 am

I have a quest that has several different aliases. This has ALL been working to the best of my knowledge up until today, and quite literally I can't think of anything that I could have done that would have changed the behavior of this. But....

Animal001 OPTIONAL
Animal002 OPTIONAL
Animal003 OPTIONAL
PlayerRef REQUIRED
JournalAlias OPTIONAL

Up to now this has been working fine. I have a spell which is cast and puts animals in one of the three aliases above, and a journal notebook which does some tracking. I can load a game and the quest is ACTIVE and RUNNING but NONE of the aliases are filled out. I also have a "FixupAlias" function that actually fixes up the aliases under certain conditions. If I wait for the script to execute the fixup fixes everything and all of the aliases are populated (except the animal ones). I can cast my spells to fill up the animal references. The point is....

Starting this morning...if I check my questvars before I save my game, I can see they're all set. I save the game and then reload the game and they're all NONE, but the quest is running. What's changed? Nothing that I can put my finger on. Any thoughts? I've never had my quest aliases drop out of savegames before.

Edit: Ok I've narrowed this down some...hopefully this will shed some light.
I allow the player to disable the quest via the console by setting a variable. Let's say:
set DisablePlayerQuest to 1

And then they just have to wait 1 hour and it's disabled. Then I add an item back to the players inventory. If they consume the item, it starts the quest back up and populates the aliases. If I look at the scriptvars before saving the game after doing this, EVERYTHING looks good. If I save the game, exit, and THEN come back in. None of the aliases are preserved. Why aren't the aliases preserved. What could be causing the aliases to no longer be preserved in the save game after stopping the quest, restarting the quest and repopulating the aliases via script?

-MM
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Thu Jun 21, 2012 12:56 am

Have the quest save the aliases to some properties. It can then reload them from those properties if they are empty when it comes time to use them. For example, if your code was

DoStuffWithAnimal(Alias_Animal1.getRef())

then change it to
if !Alias_Animal1.getRef()   Alias_Animal1.ForceRefTo(Prop_Animal1)else   Prop_Animal1 = Alias_Animal1.GetRef()EndifDoStuffWIthAnimal(Alias_Animal1.GetRef())
User avatar
^_^
 
Posts: 3394
Joined: Thu May 31, 2007 12:01 am

Post » Thu Jun 21, 2012 1:04 am

Thanks RedWood. That would provide a potential workaround. I just need to make sure it's in a tight loop when the game starts so the animals don't kill the player. It's rare that someone will disable the quest this way, and quite honestly I implemented it to help with testing but I'm really concerned and would like to know why once you START a previously STOPPED quest that the quest aliases don't persist in the savefile. I understand that aliases are wiped out when the quest is stopped, but why aren't they being persisted once the quest is running and they've been filled.

I wonder if I can reproducfe the issue via console...

-Testing.

Hmmm....if I stop the quest via console the aliases are removed. I start the quest up the aliases are none, and I wait.....the aliases are updated. I then save the game, reload and the aliases are still populated. There's got to be something in the way I stop the quest.

Function StopThisQuest() <<< main quest function to stop the main questTrace("Stopping quest. Player is not a vampire or has chosen to stop by setting to -1")RemoveVampireAbilities(Game.GetPlayer())mm_BeluaRQ01.Stop() <<< Stop radiant questsmm_BeluaRQ02.Stop() <<< Stop Radiant QuestsUnregisterForUpdateGameTime()UnregisterForSleep()mm_BeluaNoLongerABeluaSanguinareVampire.Show()if PlayerIsVampire.GetValue() == 1  PlayerVampireQuest.Start() ; Restart the original player vampire quest script.  ScriptForPlayerVampireQuest.VampireFeed() ; trigger a vampire feed from that quest.EndIfGame.GetPlayer().RemoveItem(mm_BeluaVampireJournal,1) ; remove the journal from the player. <<< this might be it.Self.Stop() << stop the questEndFunction

This is my code. I thought my journal alias was option, but it's not. It's required. Here, we're specifically removing it from th quest before stopping. and that item is the reference for the quest from that point forward. I'll mark it optional and see if that helps.

Nope no help.

So we know that STOPQUEST will WIPE values out. No news. STARTQUEST, if it has a trigger to find certain references will find them, of if the quest script fills them it will. And when I save and reload a game where I used STOPQUEST and STARQUEST it works as expected and values are retained.

In my scripts if I STOPQUEST I lose my values. I have another trigger (drinking blood) that can restart the quest and can repropulate those values...no worries) but when I save and reload a game using that process, the quest aliases are all NONE even those the quest is started and running and at least ONE of those aliases is REQUIRED. This is driving me nuts.

-MM
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Wed Jun 20, 2012 2:41 pm

Rather than another edit...some progress but not inscript progress. I can work around this problem and get the quest aliases to start saving out again if I drop down to the console and do a STOPQUEST and then a STARTQUEST and let the aliases get hooked up. I save, reload, aliases are still populated. Which lead me to believe that perhaps I wasn't STARTING The quest. So I looked the code that kickstarts the quest when you use the item:

Scriptname mm_BeluaVAmpireChangeEffectScript extends ActiveMagicEffect mm_BeluaVampireQuestScript Property BeluaVampireQuest AutoEvent OnEffectStart(Actor Target, Actor Caster)   BeluaVampireQuest.VampireChange(Game.GetPlayer())EndEvent

Ah...ok, no quest start. I'm just calling into the quest function? So I changed the code to:

Scriptname mm_BeluaVAmpireChangeEffectScript extends ActiveMagicEffect mm_BeluaVampireQuestScript Property BeluaVampireQuest AutoEvent OnEffectStart(Actor Target, Actor Caster)   BeluaVampireQuest.Start()   BeluaVampireQuest.VampireChange(Game.GetPlayer())EndEvent

Hoping that now I would be mimicking what I was doing in the console and tested....no luck.

Well, this rare occurence has an easier workaround that needs to be documented but I'd like to understand what I'm missing to actually get this to work right.

-MM
User avatar
RObert loVes MOmmy
 
Posts: 3432
Joined: Fri Dec 08, 2006 10:12 am


Return to V - Skyrim