Jump to content

Early running scripts?


ah42

Recommended Posts

I've been unable to figure this out for a few days (but I'm still new to Papyrus).

 

My issue is that SetWorldModelPath doesn't apply to what's already rendered onscreen, which is not an issue during the game, but not when loading a save.

 

Is there any way to make a script run during the main menu, or at least ensure that it finishes running before the loadscreen is done? Nothing I do seems to even start the script until after the loadscreen is gone.

 

I'd like for this to do its initializations during the main menu time, and then when a save is loaded, it just needs to call the relevant SetWorldModelPath's... before the scene is rendered.

 

Will I be forced to create an SKSE plugin? (Might be better anyway. the 128 element array limit is going to kill me. I think I'm going to need 100x that...)

Link to comment
Share on other sites

  On 2/24/2015 at 5:57 PM, icecreamassassin said:

I would think that OnInit() would fire before OnCellAttach() which runs when content loads into a cell. Have you tried setting a script on an active on game startup quest?

 

True enough, OnInit() fires plenty early... only on a new game, but not on loading a save. So at least my carriage-ride gets the desired effect.

 

I've tried OnPlayerLoadGame(), but that doesn't seem to work. (I mean, I can get it to work, It just looks like it fires too late, so doesn't work for this)

 

Is it possible to make OnInit() run every time a save is loaded? If so, I can't, for the life of me, figure out how.

Link to comment
Share on other sites

My experience is OnInit() only fires the first time a script is activated - then whatever events were called "OnInit()" is stored in the following saves.

 

If you want something which runs everytime you load a save - even if your game is already loaded - you could try "OnCellAttach()" or "OnCellDetach()". Not sure it would work if you're loading a save previously made in the same cell where you currently are though - but it should work if you're loading changing cells.

Link to comment
Share on other sites

Another thing you may try is to disable and enable the reference and see if it queues up the correct model, or even manually move the object to a utility cell and then back again (object.moveto()) and then movetoeditorlocation() to put it back. It may just be an issue that the model change function fires after the cell load because it's an SKSE command (I assume) and by essentially reloading the reference after the model has been reassigned may refresh it properly
Link to comment
Share on other sites

  On 2/25/2015 at 8:19 PM, icecreamassassin said:

Another thing you may try is to disable and enable the reference and see if it queues up the correct model, or even manually move the object to a utility cell and then back again (object.moveto()) and then movetoeditorlocation() to put it back. It may just be an issue that the model change function fires after the cell load because it's an SKSE command (I assume) and by essentially reloading the reference after the model has been reassigned may refresh it properly

 

I see where you're going... but with that idea, I think I'd be better off moving the /player/ to a utility cell. Unsure what problems *that* might cause.

 

I'm not replacing one object. I'm replacing the base model for all uses of that model...

 

I suppose I should come clean. I've been very vague about where I'm thinking with this...

 

http://i.imgur.com/nUTnOBTm.jpg http://i.imgur.com/kV81CuLm.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

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