schlangster/skyui

OnVersionUpdate does not trigger

Tjorriemorrie opened this issue · 4 comments

int function GetVersion()
    return 3
endFunction

event OnVersionUpdate(int a_version)
    {Called when a version update of this script has been detected}
    OnConfigInit()

    ; Version 2 specific updating code
    if (a_version >= 2 && CurrentVersion < 2)
        Debug.MessageBox("test2")
    endIf

    if (a_version >= 3 && CurrentVersion < 3)
        Debug.MessageBox("test3")
    endIf

    ; ...
endEvent

I've had this on 1 and 2 and 3 but the messagebox never show. What am I doing wrong?

Did you create the player alias for the script to make sure OnGameReload is called on reload? That's where OnVersionUpdate is triggered from.

Thanks, I can't fine OnGameReload, is that in the MCM API?

I've managed to attach SKI_PlayerLoadGameAlias to the PlayerReference, but when I did so, it said it could not find the psc. Is that normal?

It works as you explained, thanks