[MOD] Shipyard and Player Shipyard - Ship recycling v0.07 (6 Apr 2017)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 3206
- Joined: Thu, 16. Jul 09, 12:24
Thanks for providing some detail on what is happening and letting me have the exact version. Looks like we are getting close to the final release.
That should save me a lot of time and help me to avoid fixing the wrong problem
I have been thinking about making this mod more 4.00 as far as the Recycle cost menu is concerned as it doesn't have any context sensitive help as its based on an Egosoft 3.60 menu. I did that to make sure it was 3.60 and 4.00 compatible but most people should be onto 4.x by now. Might look at that too and set a minver of 4.00
jth
That should save me a lot of time and help me to avoid fixing the wrong problem
I have been thinking about making this mod more 4.00 as far as the Recycle cost menu is concerned as it doesn't have any context sensitive help as its based on an Egosoft 3.60 menu. I did that to make sure it was 3.60 and 4.00 compatible but most people should be onto 4.x by now. Might look at that too and set a minver of 4.00
jth
Found the problem
I use a call to lua function GetVersionString() to find the current version of the game to compensate for an issue where the number of parameters to AddUITriggeredEvent changes from 3.6 to 4.x
which works fine when characters 7 to 12 are the version number which they are in the production version
But 4.1 RC3 is returning
4.10 Beta (232953) and the version is in characters 12 to 17
which upsets things and will also break several of my other mods that use the same compensating lua code
The good news is that when the Beta goes out of the version string then they "should" all work again
Or I could change the code to compensate and maybe find what is between the () and ignore everything else or look in a different place when it sees Beta. Lots of ways to do this.
Hmmmm
Anybody have any strong opinions on the best way to go ?
jth
I use a call to lua function GetVersionString() to find the current version of the game to compensate for an issue where the number of parameters to AddUITriggeredEvent changes from 3.6 to 4.x
Code: Select all
local version = tonumber(string.sub(GetVersionString(), 7, 12))
But 4.1 RC3 is returning
4.10 Beta (232953) and the version is in characters 12 to 17
which upsets things and will also break several of my other mods that use the same compensating lua code
The good news is that when the Beta goes out of the version string then they "should" all work again
Or I could change the code to compensate and maybe find what is between the () and ignore everything else or look in a different place when it sees Beta. Lots of ways to do this.
Hmmmm
Anybody have any strong opinions on the best way to go ?
jth
Last edited by jth on Wed, 5. Apr 17, 18:14, edited 3 times in total.
i would say using find to locate the brackets is the safest way for future compatibility (or maybe get the build number/Version Number of the Game directly, but i cannot access the function overview currently so no idea if there is such a function exists). But note i am not the best lua scripter around, in fact i consider myself crappy in this regard (i spent 3 weeks writing a Menu defined entirely via parameters to avoid having to mess with it too much in the future - this way i can define all Menus i could ever need entirely in MD )
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Thought I had a coded fix that grabbed what was between the brackets for a minute
then tried it on 4.00 and got
4.00 (208311 - 64-bit) as the version
I am definitely going off text strings for versions
jth
EDIT
Changed it to six characters after the left bracket ...
Not particularly happy but it works on 4.00 now need to retest on 4.10 ...
Code: Select all
local version = tonumber(string.sub(GetVersionString(), string.find(GetVersionString(), '(',1,true) + 1, string.find(GetVersionString(), ')',1,true) - 1))
4.00 (208311 - 64-bit) as the version
I am definitely going off text strings for versions
jth
EDIT
Changed it to six characters after the left bracket ...
Code: Select all
local version = tonumber(string.sub(GetVersionString(), string.find(GetVersionString(), '(',1,true) + 1, string.find(GetVersionString(), '(',1,true) + 6))