Jump to content

Something more useful than GetGameLoaded?


Asterra

Recommended Posts

I would use different doorRefs. One set pre-change ... then disable / Enable the second doorRefs .

 

Thank you for the suggestion. My script needs to operate dynamically though, meaning I'd need to set up duplicates of everything in the game world that might conceivably need to be changed. And then, unless I'm mistaken, I'd still need to make the swap with a script.

 

Yeah, it really looks like, based on my own troubles and what I've seen in other mods out there, that the necessity of keeping script delay low (0.1) permanently, plus the variability of actual time of execution, are just facts of life in NV modding.

Link to comment
Share on other sites

 

Perhaps you can get some use out of the LoadGame or PostLoadGame event handler. Not sure what the difference is, tbh. You'll need to register it while in the main menu, ofc, before players can load the game.

 

I actually did try those out, as they sounded promising. They also seem to be afterthoughts on that Wiki page, with no associated links. In any event, using those two the same way the others on that list are used nets no result -- the associated script never gets utilized. I get the feeling they were ideas that never got finalized.

 

 

The required parameters for the UDFs weren't added to the wiki before; they are now.

Link to comment
Share on other sites

The required parameters for the UDFs weren't added to the wiki before; they are now.

 

Do you mean

sSaveFileName iSaveFileNameLength bSuccessfullyLoaded

? I tried 'em. Perhaps there's something wrong with my syntax?

begin MenuMode 1007
   SetEventHandler "PostLoadGame" LoadGameScript
end
scn LoadGameScript

int fSuccess

begin function {fSuccess}
   PrintC "LoadGameScript actually accessed successfully."
end
Link to comment
Share on other sites

Hm. Just tested and neither event seems to work. I'll ask hlp about it.

 

I did a bit more testing. LoadGame doesn't do anything, but PostLoadGame will run the moment a save file is chosen (user clicks "yes"). Not quite what I was hoping for, but interesting.

 

I incidentally discovered that the event handler for OnOpen works very differently from how the vanilla OnOpen is used. Completely different timing.

Link to comment
Share on other sites

Event handlers on objects are invoked before the actual event happens; hence the different timing for them compared to script blocks.

I did some more testing too: the PostLoadGame event does indeed trigger, but because my earlier test used Print to notify me, and the console seems disabled during the loading screen, my notification probably wasn't written to it. The same goes for how you tested it at first. I'm still not getting anything for LoadGame.

 

If you are certain PostLoadGame is triggered as soon as you click "yes", that may mean the world is stil not entirely constructed though. So for your purposes, if it's similar to checking if a door's loaded before you've had a chance to affect it, perhaps an OnLoad event handler might be better, filtered to the ref/base or formlist of either that you want to check.

Link to comment
Share on other sites

Event handlers on objects are invoked before the actual event happens; hence the different timing for them compared to script blocks.

 

In the case of OnOpen, it seems as though the event handler implementation was done backwards. If I use OnOpen directly in a script attached to a container, it triggers the moment said container's animation begins. The event handler, on the other hand, does not trigger its OnOpen until the animation is complete and the inventory menu is already open.

 

If you are certain PostLoadGame is triggered as soon as you click "yes", that may mean the world is stil not entirely constructed though. So for your purposes, if it's similar to checking if a door's loaded before you've had a chance to affect it, perhaps an OnLoad event handler might be better, filtered to the ref/base or formlist of either that you want to check.

 

OnLoad is something I've leaned away from for a couple of reasons. There's no guarantee there will be anything I'm looking for loading into the cell, which I'd have to account for. Also the wiki warns against using OnLoad when looking for a lot of things, and stresses that the event definitely lags the loading procedure. Without question, I'd be looking for dozens of specimens on occasion.

 

Whatever I do, it will probably (ironically) involve taking advantage of PostLoadGame to pinpoint when a quest can go into overdrive.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...