[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

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

Post by jth » Wed, 25. Mar 15, 17:48

Requiemfang wrote:hrm noticing an issue with DV shipyard. It has all the resources it needs but it appears you can't recycle XL ships, I've tried doing it with both a Teranis and a Titural. Keeps giving back the error the ships are too large for the XL dockyard what?
There is a bit in the readme.txt called Diagnosing issues about how to get a debug trace. Can you please save the game seconds before trying the recycle, then shut down X Rebirth and come out of steam. Then start up X Rebirth with the logging on and load the save game and then try the recycle

The bits that interest me start with [Scripts] *** Context:md.NPC_Shiptrader in the debug log

Please can you reply with them

Thanks

jth

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

Post by jth » Wed, 25. Mar 15, 17:52

Sparky Sparkycorp wrote:I've not unlocked enough info points on the DV shipyard in my current game enough to check but could it be that it has almost full storage for some recyclable wares? Maybe the error relates to the shipyard having no room for more wares.
The other one that is worth looking at is if you have ordered a ship but it can't build it because its missing some materials. If that's the case then you have no choice but to provide the materials to get the ship built and out of your way

Regards

jth

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

Post by jth » Wed, 25. Mar 15, 18:44

Conbadicus wrote:https://www.dropbox.com/s/4ai92v89umm91 ... 2.xml?dl=0

Vanilla w/ shipyard mod, Free Play - latest versions.
Thanks for the save game. It saved me a lot of effort getting set up and immediately revealed the cause of your problems.

Tried to load it and got a very informative message

Missing, old or disabled extensions:
-Build Shipyards (BkBuildShipyards - 2.02) missing

What I have on my copy of X Rebirth is BlackRain's Player Shipyards - 1.80

and this ship recycling mod is for vanilla shipyards and BlackRain's Player Shipyard (playershipyards)

I think that BkBuildShipyards is Berserk Knight's equivalent.

I think that you have found that this mod is not compatible with Berserk Knight's BkBuildShipyards

At this point it gets messy

What is obvious is that both mods patch NPC_Shiptrader.xml

If they are colliding then I suspect that they have since version 0.01 was released.

what to do about it is also messy, I could be simplistic and say please use BlackRains's version but I do note that Berserk Knight's seems to have been downloaded rather a lot too .......

I will look a little deeper at what the net effect is on NPC_Shiptrader.xml

Regards

jth

Vim Razz
Posts: 1797
Joined: Tue, 2. Nov 10, 03:20

Post by Vim Razz » Wed, 25. Mar 15, 19:08

Berserk Knight's shipyard mod is completely out of date at this point.

In addition to BlackRain's shipyard, there's a recent shipyard project on the German forum by Cappy1401, but I haven't tried it to see if it works with with this mod or not.

(EDIT: Cappy1401's SY mod uses a completely separate, customized script for player-owned ship builders and doesn't seem to affect this mods changes to NPC shiptraders.)
Last edited by Vim Razz on Thu, 26. Mar 15, 18:15, edited 3 times in total.
Human Resources -- my menu-mod-project-thing for X Rebirth

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

Post by Requiemfang » Wed, 25. Mar 15, 21:03

jth wrote:There is a bit in the readme.txt called Diagnosing issues about how to get a debug trace. Can you please save the game seconds before trying the recycle, then shut down X Rebirth and come out of steam. Then start up X Rebirth with the logging on and load the save game and then try the recycle

The bits that interest me start with [Scripts] *** Context:md.NPC_Shiptrader in the debug log

Please can you reply with them

Thanks

jth
alrighty here's what the log says

[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: <event_conversation_next_section> section: 'cArch_recycleshipconfirmed'
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: Titurel selected for Recycling
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: Titurel is of size dock_xl
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: Peter Jordan has an XLV Ship Cradle
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: XLV Ship Cradle is capable of building [tag.dock_l,tag.dock_xl] ships
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:387ad>: Initial Station Cargo, shp_s_torpedo_01 2, shp_m_canteran_02 4, shp_m_crystal_transporter 4, shp_m_container_transporter 4, shp_m_plasma_transporter 4, shp_m_energy_transporter 4, shp_m_plasma_collector 4, shp_m_nividium_collector 4, shp_m_ice_collector 2, shp_m_hydrogen_collector 4, shp_s_canteran_01 2, shp_m_canteran_01 4, swarmmissile 21, dumbfiremissile 117, drp_overrun_mk2 3, drp_overrun_mk1 7, drp_intrepid_mk2 9, drp_intrepid_mk1 10, drp_interceptor_mk2 6, drp_interceptor_mk1 10, drp_assault 13, shotgunturret 21, shieldgenerator 98, plasmaturret 50, machinegunturret 251, dumbfireturret 22, plasmaflowregulator 948, bioopticwiring 3885, scanningarray 3070, microchips 6700, foodrations 57373, fusionreactor 841, holtzmanfieldgenerator 22, energycells 158362,
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:3896b>: Build wares for Titurel - 9 Wares, units_size_xl_cargo_hauler_2_macro, Ware: Bio-Optic Wiring - 106, Ware: Energy Cells - 1070, Ware: Food Rations - 520, Ware: Fusion Reactors - 28, Ware: Podkletnov Generators - 62, Ware: Microchips - 132, Ware: Plasma Flow Regulators - 34, Ware: Reinforced Metal Plating - 108, Ware: Scanning Array - 116,
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:3896c>: RoC BTO Ship Line I, Station Construction drones 48, Station energy 158362, Station food 57373, Energy needed 1070, Food needed 520, Ship cradle size dock_l, Ship size dock_xl, Ship location Darned Hot Air, Pre-reqs met 0
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:3896d>: Recycling Issues, Your ship does not fit in my dock., , Recycling aborted for Titurel

hope that helps.

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

Post by Requiemfang » Thu, 26. Mar 15, 03:35

Right coming back to report no XL ships can be recycled at the DV shipyard or it appears that way as I only tested 3 types of XL ships, the Teranis, Titurel and Succelus. Small question though... would any mods conflict and cause this sort of issue?

Edit: it appears all XL dockyards won't recycle for me. I'm curious, since I noted this earlier about if a mod would cause an issue I am using the Enable XL AND L Ships to dock at XL Docks by UniTrader. Would that cause issues?

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7036
Joined: Tue, 30. Mar 04, 12:28

Post by Sparky Sparkycorp » Thu, 26. Mar 15, 11:44

Sorry for off-topic:

Requiemfang, do you think that the Enable Docking mod is working in 3.51 or 3.52 beta otherwise? I'll update the list of currently working mods if that is the case.

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

Post by jth » Thu, 26. Mar 15, 15:44

Requiemfang wrote:
jth wrote:There is a bit in the readme.txt called Diagnosing issues about how to get a debug trace. Can you please save the game seconds before trying the recycle, then shut down X Rebirth and come out of steam. Then start up X Rebirth with the logging on and load the save game and then try the recycle

The bits that interest me start with [Scripts] *** Context:md.NPC_Shiptrader in the debug log

Please can you reply with them

Thanks

jth
alrighty here's what the log says

[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: <event_conversation_next_section> section: 'cArch_recycleshipconfirmed'
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: Titurel selected for Recycling
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: Titurel is of size dock_xl
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: Peter Jordan has an XLV Ship Cradle
[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: XLV Ship Cradle is capable of building [tag.dock_l,tag.dock_xl] ships
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:387ad>: Initial Station Cargo, shp_s_torpedo_01 2, shp_m_canteran_02 4, shp_m_crystal_transporter 4, shp_m_container_transporter 4, shp_m_plasma_transporter 4, shp_m_energy_transporter 4, shp_m_plasma_collector 4, shp_m_nividium_collector 4, shp_m_ice_collector 2, shp_m_hydrogen_collector 4, shp_s_canteran_01 2, shp_m_canteran_01 4, swarmmissile 21, dumbfiremissile 117, drp_overrun_mk2 3, drp_overrun_mk1 7, drp_intrepid_mk2 9, drp_intrepid_mk1 10, drp_interceptor_mk2 6, drp_interceptor_mk1 10, drp_assault 13, shotgunturret 21, shieldgenerator 98, plasmaturret 50, machinegunturret 251, dumbfireturret 22, plasmaflowregulator 948, bioopticwiring 3885, scanningarray 3070, microchips 6700, foodrations 57373, fusionreactor 841, holtzmanfieldgenerator 22, energycells 158362,
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:3896b>: Build wares for Titurel - 9 Wares, units_size_xl_cargo_hauler_2_macro, Ware: Bio-Optic Wiring - 106, Ware: Energy Cells - 1070, Ware: Food Rations - 520, Ware: Fusion Reactors - 28, Ware: Podkletnov Generators - 62, Ware: Microchips - 132, Ware: Plasma Flow Regulators - 34, Ware: Reinforced Metal Plating - 108, Ware: Scanning Array - 116,
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:3896c>: RoC BTO Ship Line I, Station Construction drones 48, Station energy 158362, Station food 57373, Energy needed 1070, Food needed 520, Ship cradle size dock_l, Ship size dock_xl, Ship location Darned Hot Air, Pre-reqs met 0
[Scripts] *** Context:md.NPC_Shiptrader.LogWriter<inst:3896d>: Recycling Issues, Your ship does not fit in my dock., , Recycling aborted for Titurel

hope that helps.
That's extremely useful thanks

The problem line is

[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: XLV Ship Cradle is capable of building [tag.dock_l,tag.dock_xl] ships

The reason why I check this is that in order to get the material estimate I actually build one of whatever you are recycling using that cradle (and then destroy the dummy ship before you can see it). If I can't build it then I can't recycle it.

There are two issues

The API call that gets this info returns a list although I have only ever seen a single entry in it. So I haven't coded for it which is generating the refusal.

The second is that what is being returned is not actually allowed, you can't build large ships (Rahanas etc) in an XL dock. The vanilla game does not allow it, just checked 3.51 just in case ... but its still not allowed.

In practical terms an XL ship doesn't fit in an L ship cradle although to be fair an L ship would fit in an XL ship cradle but might look a little dwarfed. So it made sense for only one entry to ever be returned. The ship dealers have been set to be specialists by Egosoft and it does keep things simple.

EDIT
Requiemfang wrote:Edit: it appears all XL dockyards won't recycle for me. I'm curious, since I noted this earlier about if a mod would cause an issue I am using the Enable XL AND L Ships to dock at XL Docks by UniTrader. Would that cause issues?
Ah, Yes it would :(

Does it allow you to build an L ship in an XL ship cradle or just to dock ?

jth

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7036
Joined: Tue, 30. Mar 04, 12:28

Post by Sparky Sparkycorp » Thu, 26. Mar 15, 15:51

jth wrote: Does it allow you to build an L ship in an XL ship cradle or just to dock ?
I don't think so. Unitrader's dropbox link for the mod is 5 months ago and 4 months ago Unitrader said (s)he wasn't going to change the mod to allow L ships to be built at XL docks.

http://forum.egosoft.com/viewtopic.php?t=354044

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

Post by Requiemfang » Thu, 26. Mar 15, 16:40

jth wrote:
That's extremely useful thanks

The problem line is

[Scripts] *** Context:md.NPC_Shiptrader.SectionHandler<inst:387ac>: XLV Ship Cradle is capable of building [tag.dock_l,tag.dock_xl] ships

The reason why I check this is that in order to get the material estimate I actually build one of whatever you are recycling using that cradle (and then destroy the dummy ship before you can see it). If I can't build it then I can't recycle it.

There are two issues

The API call that gets this info returns a list although I have only ever seen a single entry in it. So I haven't coded for it which is generating the refusal.

The second is that what is being returned is not actually allowed, you can't build large ships (Rahanas etc) in an XL dock. The vanilla game does not allow it, just checked 3.51 just in case ... but its still not allowed.

In practical terms an XL ship doesn't fit in an L ship cradle although to be fair an L ship would fit in an XL ship cradle but might look a little dwarfed. So it made sense for only one entry to ever be returned. The ship dealers have been set to be specialists by Egosoft and it does keep things simple.

EDIT
Requiemfang wrote:Edit: it appears all XL dockyards won't recycle for me. I'm curious, since I noted this earlier about if a mod would cause an issue I am using the Enable XL AND L Ships to dock at XL Docks by UniTrader. Would that cause issues?
Ah, Yes it would :(

Does it allow you to build an L ship in an XL ship cradle or just to dock ?

jth
hrm I'll run a test without it then to see if it resolves it... if not well I'll just leave it to you to patch the problem :P

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

Post by Requiemfang » Thu, 26. Mar 15, 20:39

Alrighty, removing that mod did indeed solve the issue!!! :D

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

Post by jth » Fri, 27. Mar 15, 20:56

Requiemfang wrote:
hrm I'll run a test without it then to see if it resolves it... if not well I'll just leave it to you to patch the problem :P
EDIT tweaked some of the words below to hopefully make things clearer

Strictly I don't fix interoperability issues for code that isn't up on Nexus or Steam but will make an exception just this once as its example code and just in case someone else incorporates it.

It was a bit of a pig as there were a few extra complications that I wasn't expecting (like the L ships heading for a free dockslot at the XL shipyard when recycled by the L shipdealer).

A preliminary test patch is here for testing only. You shouldn't play the game plot with this dropbox version.

https://www.dropbox.com/s/oyggi19aibe5q ... 3.zip?dl=0

Please let me know if it fixes it

Don't know when I will go public with it, I generally don't release single fixes but wait to bundle a few bits up together

Regards

jth

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

Post by jth » Thu, 2. Apr 15, 18:22

Conbadicus wrote:I just tested it. Vanilla new game with just this mod installed. CV small ship stations only offer drostan.
The reasons behind this issue have been bugging me rather a lot so I decided to spend some time and get to the bottom of what is going on

I finally worked out how to recreate what you are seeing.

The devil is in the detail :(

I created my own save game with vanilla free play and no mods whatsoever and flew the skunk over to the Civ Ship Dockyard at Cuspid Splint and saved the game. The game positions the skunk right over a medium shipyard cradle

https://www.dropbox.com/s/2u6wgvt1gxloi ... e.zip?dl=0

Comm the small shipdealer and select Buy ships and there are couple of screens of available ships including the Drostan

I then added the BuildShipyards mod and restarted the game and repeated the conversation with the small shipdealer - only one ship left the Drostan

I then disabled the BuildShipyards mod and added the ShipRecyle mod and restarted the game - there are couple of screens of available ships including the Drostan

I then re-enabled the BuildShipyards mod - only one ship left the Drostan

From that I conclude that its the BuildShipyards mod that is incompatable with X Rebirth 3.5 and that ShipRecyle makes no difference.

Looking at the code from BuildShipyards shows that it modifies the NPC_Shiptrader.xml file but does not touch the NPC_Shiptrader_Small.xml which is what drives the medium ship dealers in later versions of X Rebirth. I suspect that it broke about the time that Egosoft started doing things with NPC_Shiptrader_Small.xml

I did try to get the BuildShipyards mod going with a version of X Rebirth 2.51 but that is missing all the ships except the Drostan too.

This ties up well with
Vim Razz wrote:Berserk Knight's shipyard mod is completely out of date at this point.
The two questions that I wanted answers to were

1) Does ShipRecyle break BuildShipyards and my answer is No it doesn't

2) Does ShipRecyle work with BuildShipyards - I created a save game with a Capital Shipyard using BuildShipyards and gave it a go and it appears to work

Should you use BuildShipyards - not really as the Civ Ship Dockyard is toast with X Rebirth 3.5 but if you have save games with it installed then you seem to be able to recycle L and XL ships in the Capital Shipyard. Will you get any support from me - nope :(

From that I wondered how to get the small ships back and whether it is possible to switch from BuildShipyards to BlackRains's PlayerShipyards

As I had created the save game (has the Teladi Outpost in it - sorry but it took 4 hours to create so not going back to create a completely vanilla one)

https://www.dropbox.com/s/8dhxq9c89oksf ... 2.zip?dl=0

I thought that I would have a little play, so I disabled the BuildShipyards mod and the save game refused to load which I guess is fair enough as the save game contains stuff that was created using BuildShipyards.

So the question is can you get the shipyards created by BuildShipyards out and if so will that then allow you to disable the BuildShipyards mod.

Well I do have a StationRecycle mod so I thought that I would give it a go at recycling and the Capital Shipyard recycled OK and I got a CV full of materials. Then I disabled the BuildShipyards.

However the results wasn't what I was hoping for, it still refused to load.

So I thought how about chain sawing the BuildShipyards mod files, so I deleted everything except content.xml from BuildShipyards and re-enabled BuildShipyards. I got the mod from Nexus not Steam. That lets it load but do nothing and returns all of the medium ships. Note Do the station recycling FIRST. When you knobble the BuildShipyards mod all the player shipyards created by it vanish immediately.

Job done and at this point I reckon that you could install Blackrain's PlayerShipyards and use the materials in the CV to rebuild your shipyard

Edit 03/04/2015 I wondered if the player shipyards would come back if you load BlackRain's PlayerShipyards mod with the chain sawed BuildShipyards mod and they do :) So you don't have to use StationRecycle on them first. The available ships will almost certainly be different though.

Regards

jth
Last edited by jth on Fri, 3. Apr 15, 14:37, edited 2 times in total.

Vim Razz
Posts: 1797
Joined: Tue, 2. Nov 10, 03:20

Post by Vim Razz » Thu, 2. Apr 15, 19:17

Very nice investigation. :thumb_up:

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

Post by Requiemfang » Sat, 4. Apr 15, 03:41

Noticing something odd and I am not sure if it's been reported. When I go to recycle a ship at a shipyard has 2 or more dockyards. If one of the dockyards/drydocks is occupied by a ship being built and the other yard is free and I choose that one to recycle the ship, the ship in question goes to the dock yard where the ship that's currently being built is located instead of going to the free one. It's a bit of an annoying bug.

The issue is consistent with shipyards that have the 2 large ship dockyards as the two times it happened I tried to recycle Rehannas I capped. Each time one of the dockyards was not currently being used to build a ship by NPC factions.

Edit:

Small question of course is... will this work with Blackrains player shipyard mod? I couldn't figure out if I should or could from the post made about it.
Last edited by Requiemfang on Sat, 4. Apr 15, 03:49, edited 1 time in total.

Post Reply

Return to “X Rebirth - Scripts and Modding”