Supporting Multiple Versions of NVSE

From GECK
Jump to: navigation, 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

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

See Also