• Welcome to Freedom Reborn Archive.
 

_missionvar.pyd

Started by Conduit, September 18, 2007, 08:25:13 PM

Previous topic - Next topic

Conduit

Recently, I noticed that whenever I loaded a saved game for a mission that had MLOG activated, the game crashed.  I managed to track this down to _missionvar.pyd.  Apparently, whenever that file is imported, the game crashes.  Does anyone know why this could be happening?

stumpy

That module loads for any campaign mission you run. It's possible that there is something corrupt in your saved game that is giving it trouble, since, while it doesn't specifically do anything with saved games, it is what lets mission and object long variables be stored in a saved-game safe way.

It is also sensitive to the order in which modules are loaded and employs some tricks to avoid a circularity. But, as best I recall, all those kinks were worked out a while ago. I am playing right now from an FFX 3.2 mid-mission saved game and didn't have any trouble...

Does it crash as in stop loading the mission and just sit there, or did it give some sort of in-game error, or did it crash to the desktop? Does it crash every time after any saved game is loaded or just after a particular one? (And, FFX 3.2 isn't compatible with saved games from previous versions.) If you start a mission, play for thirty seconds or so, save, then load that saved game, does it still crash? You should post your script.log from that last scenario.

Conduit

It works like this: I load a saved game in a mission where the MLOG was enabled, the mission loads up, then the screen displays for a second before crashing to desktop.  It happens on any saved game in any mission where the MLOG reader is enabled.  It does not give out any error in the script log or anywhere else.  Just so you know, this is in a mod where, for a few reasons, I don't activate FFX_Init() at the start of a mission.  I just activate MLOG_Init() by itself.  I think I installed FFX 3.2, but I might not have.  Could you give me a download link for that?

stumpy

So, your saved game is in the middle of a mission, not at a base or at the summary screen at the end of a mission? Your log files should have something in them, then.

I guess I still don't quite see what you are up to, since the mlogreader module's MLOG_Init() by itself doesn't start FFX or anything. Do you mean you aren't running an FFX-enabled mission? Why are you be starting MLOG_Init() then?

If you are trying to start FFX sometime after the mission starts, then that could be a problem. For one thing, as mentioned, calling MLOG_Init() doesn't start FFX. Secondly, FFX is a little finicky about being started at the beginning of the mission because of the module loading dependencies. In fact, it's a circular dependence between mlogreader and _missionvar that requires some care. If anything, I would guess that your trouble may be related to using mlogreader functions before _missionvar has been properly initialized.

If you are intentionally not running FFX, then maybe FFX is getting started some other way. Without it, I am not sure why _missionvar would ever be called.

BTW, I assume you already have FFX 3.2, since that's where the _missionvar module was introduced. (I guess you could have it by having manually updated missionobjvar module, though. Or have a beta version...) That is another reason to post your script.log, since most of the FFX modules announce what version they are and when they are being loaded.

Anyway, the site for FFX 3.2 is http://ffx.freedomforceforever.com/.

Conduit

I've checked and I do indeed have ffx 3.2 installed.

Well, here's my script.log.

>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
Starting ffx.py v. 3.2.0 build 11; branch = Gold / Release
Loading m25ai.py v. 3.2.0 build 8; branch = m25 branch 1
loading datfiles version 0.251000
Importing MLOG reader module version 0.995 with ['animator']
Loading m25cutscene.py v.3.2.0 build 6; branch = m25 branch 2
CustomHeadCurrentTime 1190248410.843000
Starting Height Check module 1.4
Starting System Utilities 1.4
Starting General Utilities 1.0
OBJECTS_HEIGHT: 604 entries
NIF_OBJECTS: 482 entries
BUILDINGS_IN_OBJECTS_DAT: 30 entries
BUILDING_DIMENSIONS: 30 entries
Starting skXMapInfo.py  v 0.79 beta
skXMapInfo: m25ai available
Mission_GetVar: no <registeredCustomCommands> found in MSVNames
FFX Mission Plugin 'firehydrant' imported
FFX Mission Plugin 'zombie' imported
Loading freeroam_keepbuildingdamage.py v.1.0.0 build 0; branch = main
Mission_GetVar: no <_event_freeroam_initmission> found in MSVNames
Mission_GetVar: no <_event_freeroam_exitmission> found in MSVNames
FFX Mission Plugin 'freeroam_keepbuildingdamage' imported
FFX Mission Plugin 'm25ai_lowjumper' imported
FFX Mission Plugin 'm25ai_realitymanipulation' imported
Mission_GetVar: no <_event_pstory_cutsceneline> found in MSVNames
FFX Mission Plugin 'cutscene_power' imported
Loading     m25enc_OPENDOOR.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'm25enc_opendoor' imported
Loading     m25enc_simplechoice.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'm25enc_simplechoice' imported
Starting Built-In Function Wrapper 1.5
('Object_CalcPrestige', 'js')
importing MLOG Reader 1.0 alpha 17
>>> C:\Documents and Settings\Owner\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py executed
MLOG_Read: likely mid-mission load
1
x


I'm still importing the ffx module, though I don't call FFX_Init().  The 1 and x at the end are comments I placed in the various functions to find out precisely where the game crashed.

Quote from: stumpy on September 19, 2007, 03:12:53 PM
If you are intentionally not running FFX, then maybe FFX is getting started some other way. Without it, I am not sure why _missionvar would ever be called.

When it loads a save game, the MLOG reader calls HandleSavedGameCallbacks(GameTime), which calls datfiles.GetLoadedSavedGame(GameTime), which imports _missionvar, which crashes the game.  By the way, is the adjusting for saved games thing (or just the HandleSavedGameCallbacks function) actually necessary for tracking animations?

stumpy

This is seeming like almost certainly a case of imports being called out of order or ambiguous import namespace.

First, though, maybe someone with a clearer head can tell me why it looks like the old mlogreader 0.995 is loading, then later on the current version (1.0 alpha 17) shows up? Did you rename the old version and import it as something else?

Your log shows several calls to mission long variables that it doesn't think exist, probably because they aren't in the cache table. One of the first things that happens when a saved game is loaded is that we scan the saved game for saved mission long variables and update the cache so it can handle calls for the variables properly. That's one of the things HandleSavedGameCallbacks(GameTime) is doing.

There is sort of an intricate labyrinth of things that need to happen for the process to work smoothly, and I don't want to go through all the details of why things depend on one another the way they do. But, the fact that those mission long variable calls are being made makes it seem like FFX was running when the game was saved and, when you loaded it, the timer sinks continued to try and run, but this time not all the expected modules were loaded the way they ought to have been. In all likelihood, _missionvar crashed because it was trying to call some functions defined in the newer version of mlogreader and they weren't there, maybe because the out-of-order import sequence messed things up or because there was an old version of mlogreader hanging around which doesn't have those functions.

Anyway, it might be helpful if you to mention what it is you want to do here. If you want the animator MLOG module turned on, then the easiest thing has to be just to let FFX start up normally, since it uses animator. All the animator logging info will be in your ff.log. All the mlogreader sinks will be available if you are using them.

If you want animator but are avoiding FFX for whatever reason, then the cleanest way to do that would be to start the game (with logging enabled in the shortcut) without FFX and start the animator MLOG module without any reference to mlogreader. That is, just call EnableMLOG(1) and MLOG('animator') from your mission script or whatever.