Jump to content

MCM - OnVersionUpdate vs OnConfigInit vs OnGameLoad


trepleen

Recommended Posts

If OnGameLoad() is always executed, why would anyone want to use OnConfigInit?

 

Actual adjusted values should be stored in your mods quest script, and this mcm menu simply gets and sets values from your mods quest script.  Right?

 

If I have an array that needs to get set one time, that array should only exist in my mods own quest script, in the oninit() event, correct?

 

Let's say you update your mod and modify the mcm menu. Why even check for versions? Why not simply add the new code to OnVersionUpdate so everything is up to date?

 

event OnConfigInit()

;why use this event

endEvent
 

event OnVersionUpdate(int a_version)

;or even this event

endEvent

 

event OnGameReload()

;when you can simply use this event that always executes and skip checking for versions

 

;configure pages
Pages = new string[1]
Pages[0] = "Page 1"
Pages[1] = "Page 2"

;various personalities for katreena
katreenapersonalitylist = new string[1]
katreenapersonalitylist[0] = ""
katreenapersonalitylist[1] = "Loving"

 

endevent

 

If you want persistent values throughout MCM menu versions, shouldn't you just store the important values in your own script from a quest for example?

Link to comment

If OnGameLoad() is always executed, why would anyone want to use OnConfigInit?

 

The OnVersionUpdate seems to be bugged for me, so I had to make a work-around with several safety checks to make sure the mod's script updates correctly. The OnConfigInit is useful for first-time run scripts to initialize values, even if there are other event functions that do the same thing. I haven't used or heard of OnGameLoad() before, so I can't speak on that, but I have used OnPlayerLoadGame(), and that falls under one of my update safety checks since it runs every load game (I would rather use this for version checking than for initializing values).

 

I assume that OnConfigInt is usually used in conjunction with other event functions to handle certain situations. I would assume in case someone wanted to implement a version roll-back system that they would use it to avoid overwriting older scripts and recall the values if necessary.

 

Regardless, whatever it's used for, it's just an option and that's up to the person doing the scripting to decide what to use for what purpose. I'm horrid at scripting anyway, so I'm not one to judge others on their scripting choices.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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