Supporting Multiple Versions of NVSE
Jump to navigation
Jump to search
Whilst it is sensible to simply complain to the user with a message box, if they are using an outdated stable version of NVSE, some modders may be reluctant to force their users to use a beta version. Scripts will fail if they reference unavailable functions in the installed version of NVSE. However, it is possible to safely support multiple versions by incorporating the new functions in a UDF with its calls enclosed within a version condition.
Example[edit | edit source]
Suppose you wish to support at minimum NVSE 4, but optionally 4.5 for some particular feature:
if GetNVSEVersion > 4 || GetNVSERevision >= 5 call MyNewCodeUDF else call MyLegacyCodeUDF endif