Jump to content
  • entries
    17
  • comments
    41
  • views
    12,066

Alias Refilling on Non-Clean saves and Quest Reset


darkconsole

911 views

Potential Problems:

  • Your quest aliases are None when you load your mod on a non-clean save.
  • Your quest aliases are None after resetting your quest or resetting your mod with an MCM option.

Given the following code:

Function ResetMod()    self.Stop()    self.Reset()    self.Start()EndFunction

This seemed rather reasonable given the lack of documentation and the way software engineers think. Stop your shit, reset your shit, restart your shit. I lost so many hours on this. After Google searching and bitching on IRC for days I finally got the Creation Kit wiki to validate my email so I could post a discussion topic. Turns out people do actually watch and update the wiki, and TerraNova2 had a small footnote that proved to be a pointer for why all my quest aliases were turning up empty after running this code, instead of being refilled like I expected.

This is all I currently know about Reset(). Reset() will send a quest back to its Startup stage and clears all aliases. What Reset does not do is refill them, and start the quest. Also Reset() will not run when Stop() has been called before it. This is why your second function worked as expected.

However, it is worth noting that this is not a REASON why it fails to work as I expected, but a HINT into which direction to look. Start() and Stop() alone are enough to cause aliases to refill, it just won't reset the stages if you skip the Reset(). So Reset() not running after Stop() really should have been a moot point and I should have been chasing down a completely different bug: why are stages not resetting?

 

I think we all know though by now though that as great as Skyrim is, as beautiful as the game looks, yet still running on fairly old computers well - at the end of the day... Creation Engine is kind of fucked. So the solution... seriously... is this. Change up the order. If you been fighting this as long as I have, you are going to be so pissed.

Function ResetMod()    self.Reset()    self.Stop()    self.Start()EndFunction

Bam. Stages reset. Aliases refilled. Fucking... bam.

4 Comments


Recommended Comments

Why does reset() not work if stop() is called before it? That makes no damn sense...

It's like, instead of saying "stop what you're doing and try again" you say "try again, THEN stop what you're doing."

 

But I can solve all your problems... trust me, this next section of code will fix every issue you've ever experienced:

 

While 1 == 1

   debug.notification("I hate this goddamn engine")

EndWhile

 

Or at least if it doesn't solve the problem, it gives some much needed venting. :)

It's better than my other usual thing:

 

Event OnLoad()

   ;impressive code goes here!

EndEvent

Link to comment
Guest Plastrader

Posted

I was asking myself the other day if I should recommend you to post this as a blog entry as this is too important for people to have in a thread which is drown beneath "OMG MY PRON MOD DOESN*T WORK HAPLZ!!"

Now with that out of the system...


Isn't "reset" just what it does?
Resetting variables and quest stages, if you take the word by its defintion.
On the other hand, if the function was called "restart" it wouldn't make sense.
I hope this made sense.

Not trying to be an arse, I know exactly how frustrated you were at the time.

Link to comment

I was asking myself the other day if I should recommend you to post this as a blog entry as this is too important for people to have in a thread which is drown beneath "OMG MY PRON MOD DOESN*T WORK HAPLZ!!"

 

Now with that out of the system...

 

Isn't "reset" just what it does?

Resetting variables and quest stages, if you take the word by its defintion.

On the other hand, if the function was called "restart" it wouldn't make sense.

I hope this made sense.

 

Not trying to be an arse, I know exactly how frustrated you were at the time.

 

I didn't realise the blog feature existed. I've been wanting a place to put my modding WTFs but didn't want to dick around with starting a WordPress blog myself or anything heheh.

 

Ehhhh, Ehhhhh ehhhhhhh... so Reset() doesn't actually really do a reset though. Resetting suggests that you would flush and refill to default states, when what actually happens is it just flushes. All aliases get turned to None, all stages get set to 0. Depending on your personal definition of what a reset is, that may be good enough in your opinion. Which is totally fine. What I just said is what it is documented as doing.

 

The crazy thing is how not only does the Reset explode, but it messes up the Start() that comes after it when you call Stop() before it! Isn't that wild? I assume there must be some broken race condition in the engine itself. Technically what should have happened is I never noticed, because Start() should have refilled the aliases after the Reset(). So maybe the problem is actually Stop() is broken in the engine? This is crazy stuff.

Link to comment
Guest Plastrader

Posted

What I just said is what it is documented as doing.

OK, I see what you mean, more on this below.

 

...This is crazy stuff.

I sense this to be some sort of "reconstruct" as in, they didn't plan or think about the event of actually restarting quests if they failed on unhandled reasons etc. So they sat down, developed something which worked for the moment.

 

I didn't realise the blog feature existed. I've been wanting a place to put my modding WTFs but didn't want to dick around with starting a WordPress blog myself or anything heheh.

I'm glad you did! Soon if you have enough patience to continue you'll have a "Traps to avoid while scripting" guide.
Link to comment
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use