Jump to content

How GECK can lead to confusion


Recommended Posts

This is the new issue I had these days, I wasted some hours behind it. Pretty hard to track down, but in my opinion it deserves to be explained. At least, its "resolution" deserves to be explained at the point to give it an entire thread... :)


I had this script, it was CTD in game.

Just as reference, I attach here the scrap which was CTDing.

        elseif (GetStage aaPQuest == 130)
            setstage aaPQuest 140
            SetObjectiveCompleted aaPQuest 130 1 >>> this specific line
            SetObjectiveDisplayed aaPQuest 140 1


More specifically, the SetObjectiveCompleted one.

Skipping it with a semicolon wasn't leading to CTD.


I tried many workarounds, I capsided the lines in the block etc. but I still wanted to keep the structure of the script, for readability. I mean, workarounds are good, but I'm not going to create a brand new script which contains a chunk of code, just because it refuses to work inside the main script. AND, if it was in the end of the main script, I could have done it, like creating a MainScriptPartTwo... but it was in the middle of the main script so I really didn't want to do it.


At the end, after banging my head because I couldn't find the mistake, I decided to do a simple debug: let's put some PrintC - Print, let's see some variables and check their values.


At first execution, the variables didn't print...

That smells fishy... Ok, no panic, let's check again the code. But... there's no reason for them to not be printed!

Let's launch the game again...

They... are in console now? really? before they weren't, now they are, and I didn't change anything? And I'm reloading the same savegame? and... what about the quest stages? ... oh god, they are correct now?!? it doesn't CTD ANYMORE?!?!?!?!

Let's remove the comments, the PrintC, the everything_I_Added...


Aaaand... it works as intended... I just spent many hours chasing a ghost.


Now... my thoughts about it...

I already noticed that if you change a GameMode quest script and then you reload the same savegame you often have issues, like it does behave as you would expect, sometimes it's better if you even quit the GECK and try NV on its own. Or as Tomm told me once, rebooting pc too...

But my wrong assumption was that a code could lead you in mistakes like this if IT'S ACTUALLY EXECUTED when you save the game. I mean... my chunks of code are behind conditions. My assumption is the code isn't executed until I don't verify the condition SO even a fake problem like this can't be shown. Well it seems it's wrong. Still, my feeling leads me to think that adding those PrintC - Print, forced the engine to somewhat re-execute the script or at least check what the hell I changed.

For god's sake, if something strange is happening and your script seems correct, just quit your GECK, reboot pc too eventually, make a clean save or reload a savegame made before adding your mod. You won't waste hours chasing ghosts... -_-




PS this whole post has the purpose only to describe an experience, without spamming the 101 with this long thing

Link to comment


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • 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