Jump to content

Something more useful than GetGameLoaded?


Asterra

Recommended Posts

I have a script that I need to run pretty much the first frame a game is live. My approach to this was to set an exceedingly low quest delay, then use GetGameLoaded, and SetQuestDelay to 0 therein. This seems to have two major drawbacks:

 

1. GetGameLoaded seems to like to start after a random span of time, despite the quest delay being essentially just a couple of frames. I've had it start up to a second late.

2. On top of that, the use of GetGameLoaded evidently modifies the quest's delay so that even if I then reload a save that has not yet modified the quest's delay, the modification is in place. This is the only way to explain why if I load a save after SetQuestDelay has had a chance to execute, it then takes a solid 5 seconds for GetGameLoaded to ping.

 

Given what I'm trying to do here, this circumstance is pretty useless. I am forced to have a script running on a ~33ms cycle just to ensure that the delay after loading is minimized. Really hoping there are some functions I've overlooked or some methods I'm unaware of. I really can't be the only person who has ever needed their script to run once immediately. A flag specifying this need (as opposed to quests running their scripts on load after their delay by default) would have been pretty helpful.

Link to comment
Share on other sites

I'm a little puzzled by what you are trying to accomplish ... But as a maybe not relevent question ...

 

Would having your script within an ESM then placed high in the load order ... alleviate what appears to be random delaying in when "GetGameLoaded" seems to execute and give you a response ?

Link to comment
Share on other sites

I'm a little puzzled by what you are trying to accomplish

 

Nothing more involved than what I've already mentioned. Script needs to process immediately. To elaborate a little: I need to make changes to the environment, and this needs to occur before the player has a chance to identify the pre-change state of the environment. A full second, or even half a second, is, unfortunately, too long.

 

 

Would having your script within an ESM then placed high in the load order ... alleviate what appears to be random delaying in when "GetGameLoaded" seems to execute and give you a response ?

 

I'm willing to give that a shot, but is that how this normally works? A higher load order would help script execution?

 

I'll still be stuck with the issue of being unable to use SetQuestDelay because of how it affects save loads that never encountered the function at all.

Edited by Asterra
Link to comment
Share on other sites

 

I'm a little puzzled by what you are trying to accomplish

 

Nothing more involved than what I've already mentioned. Script needs to process immediately. To elaborate a little: I need to make changes to the environment, and this needs to occur before the player has a chance to identify the pre-change state of the environment. A full second, or even half a second, is, unfortunately, too long.

 

 

Would having your script within an ESM then placed high in the load order ... alleviate what appears to be random delaying in when "GetGameLoaded" seems to execute and give you a response ?

 

I'm willing to give that a shot, but is that how this normally works? A higher load order would help script execution?

 

I'll still be stuck with the issue of being unable to use SetQuestDelay because of how it affects save loads that never encountered the function at all.

 

 

Honestly I don't know ... only using a seems to me method on how I've seen various quests load up upon game start.

Was just a mention with thinking this is about quest notification ...

Mentioning this is about environment changes ... now I'm more puzzled ... why would the player be able to detect a pre-change to the environment ... what sort of environment change?

Is this about you have some assets that seem to have a problem upon loading being delayed ... is it a level of detail kind of thing ?

Seems like once something is placed/enabled it would always be there in view upon loading a save game. ^shrug^

Edited by Mktavish
Link to comment
Share on other sites

Mentioning this is about environment changes ... now I'm more puzzled ... why would the player be able to detect a pre-change to the environment ... what sort of environment change?

 

I'll give an example. Let's say the player saved their game right next to an unlocked door. But you have a script that you want to use to instantly lock all nearby doors. So the player loads in. In the ~0.5+ seconds available to him, not only can he identify that the door in front of him is not locked (due to script execution delay), but he can even travel through the door before the script has had a chance to do anything to prevent it.

 

It's just a hypothetical example, but not dissimilar to the problem I'm facing. I still entreat anyone reading this thread to offer suggestions. Conspicuously missing from the toolset for this game is any variation of "begin GameLoad".

Edited by Asterra
Link to comment
Share on other sites

I'm sure the Docta is on to something better than I could think of.

But maybe since what controls this change is from within a quest ... could be your problem with it delaying.

Therefore don't use a quest to make the actual change ... :unsure:

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.

Link to comment
Share on other sites

 

 

I'll give an example. Let's say the player saved their game right next to an unlocked door. But you have a script that you want to use to instantly lock all nearby doors. So the player loads in. In the ~0.5+ seconds available to him, not only can he identify that the door in front of him is not locked (due to script execution delay), but he can even travel through the door before the script has had a chance to do anything to prevent it.

 

Just thought of ... to fix this hypothetical situation incase it helps ...

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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