[MOD] Shipyard and Player Shipyard - Ship recycling v0.07 (6 Apr 2017)

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Requiemfang
Posts: 2743
Joined: Thu, 16. Jul 09, 12:24

Post by Requiemfang » Tue, 15. Mar 16, 21:57

I can confirm what eMYNOCK is saying, noticed it broke after eMYNOCK updated his combined mod and said so on Steam. Might as well say it here. Hope a fix comes ASAP.

User avatar
eMYNOCK
Posts: 1906
Joined: Thu, 21. Aug 03, 10:37

Post by eMYNOCK » Wed, 16. Mar 16, 02:46

Okay... mea culpa... You can scratch that report.

I've accidentally broke something in my own Mods, to be xact i included the Shiptraders into a Mod that depends on my Shipyard Mod (and that messed the whole stuff up).

Should be sorted now.

Sorry for all the Confusion and thanks for the patience.
For my Steam Workshop, klick below:
Image
MynoCorp. Technologies:
We Build it, you life with it.
X³TC/AP Cockpit Callback Mod

Requiemfang
Posts: 2743
Joined: Thu, 16. Jul 09, 12:24

Post by Requiemfang » Wed, 16. Mar 16, 03:29

:lol: sucks when that happens

erfan2333
Posts: 3
Joined: Thu, 9. Jun 16, 05:17

Post by erfan2333 » Wed, 5. Apr 17, 13:58

this is a bug in 4.10 RC3.
when I select the ship then click "recycle" button,but recycle cost menu didn't appear.And pressing any key does not respond, except "esc".
in case I removed the other mod,but the problem still exists.
:) By the way,the mod is good,thanks for your nice work!

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Wed, 5. Apr 17, 14:11

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

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Wed, 5. Apr 17, 16:49

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

Code: Select all

local version = tonumber(string.sub(GetVersionString(), 7, 12))
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
Last edited by jth on Wed, 5. Apr 17, 18:14, edited 3 times in total.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13817
Joined: Sun, 20. Nov 05, 23:45

Post by UniTrader » Wed, 5. Apr 17, 18:11

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 :D )
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 ;)

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Wed, 5. Apr 17, 18:14

Thought I had a coded fix that grabbed what was between the brackets for a minute

Code: Select all

	local version = tonumber(string.sub(GetVersionString(), string.find(GetVersionString(), '(',1,true) + 1, string.find(GetVersionString(), ')',1,true) - 1))
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 ...

Code: Select all

	local version = tonumber(string.sub(GetVersionString(), string.find(GetVersionString(), '(',1,true) + 1, string.find(GetVersionString(), '(',1,true) + 6))
Not particularly happy but it works on 4.00 now need to retest on 4.10 ...

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Thu, 6. Apr 17, 15:55

- [6.4.2017 - V0.07 Public Beta]
shiprecycle_menu_cost gui - Compensate for format of game version string changing in 4.10 RC3 and add extra paranoia when checking version to prevent crashing the GUI

User avatar
alexalsp
Posts: 782
Joined: Fri, 18. Jul 14, 05:28

Post by alexalsp » Thu, 14. Dec 17, 19:47

Mod works in XR 4.30. :)

Haribo187
Posts: 28
Joined: Fri, 8. Feb 08, 22:46

updates

Post by Haribo187 » Sat, 3. Mar 18, 17:38

This program does not work as it is with updates,

:cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

Post Reply

Return to “X Rebirth - Scripts and Modding”