Jump to content

Almost certainly no but need confirmation


Recommended Posts

Some further explanation as to what you are trying to do would be helpful. But, as far as I know, there is no equivalent to the Linux 'source' command functionality in Papyrus. You could approximate it by calling functions from outside scripts, however.

Link to comment
Share on other sites

I have a very long mcm script, there are 4 pages but two of them have a total of about 60 states in them, I was wondering if those states could be written in another script/file and imported/sourced. I'm fairly certain it can't from everything I read over the past few months, but obviously I haven't read eveything:) and if you don't ask, you don't find out!

 

 

diziet

Link to comment
Share on other sites

You cannot offload your states to another script. MCM scripts will get rather large. They will hit a point where they will no longer load fully in the Creation Kit. You could write functions that can handle some of the work and have them on another script but not really worth the hassle to do that honestly.

 

While here, here is a tip I learned when doing MCM scripts: Do not process your stuff at the option selection. Instead use the OnConfigClose event to register for a single update and process all your stuff based upon the final value of the various option variables. Why? Some processing is latent and causes the script to hang waiting for the menu to close which in turn leads to issues when switching to another MCM menu without fully exiting.

Link to comment
Share on other sites

While here, here is a tip I learned when doing MCM scripts: Do not process your stuff at the option selection. Instead use the OnConfigClose event to register for a single update and process all your stuff based upon the final value of the various option variables. Why? Some processing is latent and causes the script to hang waiting for the menu to close which in turn leads to issues when switching to another MCM menu without fully exiting.

Ah, in another MCM menu one of the toggles applies a spell. At this point I have to return to the game before I can do any more in the MCM. Will this allow me to avoid this, or will it still stop me from using other MCM menus?

 

diziet

Link to comment
Share on other sites

If you put off applying the spell until the player exits the menu system, any other menu from any other mod can be accessed. The spell will not actually be applied until the menu system is completely exited. This is because the update timer does not count while the game is paused which it is paused when in the MCM menu system.

Link to comment
Share on other sites

this is the code that applies the spell:

Function dz_activate_changing(Bool var)

spell my_spell

my_spell = dz_outfits_grant_ability_spell



If var == True

  my_spell.cast(PlayerRef,teammate_ref_slot[index])

EndIf

EndFunction

as you can see the spell is applied to teammate_ref_slot[index], it occurs to me that if I can visit other pages of my menu then a user would quite possibly also toggle this function for a different teammate_ref_slot[index], meaning that the OnConfigClose would need to be aware of the multiple targets for the spell?

 

There are multiple pages all with the same states, on each page there is one state that will apply the spell to the target corresponding to that page (teammate_ref_slot[index]). So if I'm waiting for OnConfigClose, then I have to queue up the cast commands, if I understand how the state thing works?

 

diziet

Link to comment
Share on other sites

  • Recently Browsing   0 members

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