[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: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Wed, 25. Mar 15, 16: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: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Wed, 25. Mar 15, 16: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: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Wed, 25. Mar 15, 17: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: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Wed, 25. Mar 15, 18: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, 17:15, edited 3 times in total.

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

Post by Requiemfang » Wed, 25. Mar 15, 20: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: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Thu, 26. Mar 15, 02: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: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Thu, 26. Mar 15, 10: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: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Thu, 26. Mar 15, 14: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: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Thu, 26. Mar 15, 14: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: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Thu, 26. Mar 15, 15: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: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

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

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

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Fri, 27. Mar 15, 19: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: 296
Joined: Tue, 3. Jan 06, 23:31
x3

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: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

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

Very nice investigation. :thumb_up:

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

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.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sat, 4. Apr 15, 03:48

BerserkKnights Build shipyards was downloaded a lot because it was the first mod out that allowed building shipyards. My version is a continuation of Berserk's work since Berserk is no longer around. Berserks mod is not supported any more.

Also, JTH, the reason you couldn't load your save when you were using the buildshipyards mod is because it gets added as a dependency in the save file. Editing the save file and removing the small line at the top where it says buildshipyards would allow you to load the save without the mod active.

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Sun, 5. Apr 15, 15:06

Requiemfang wrote: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.
It hasn't been reported yet, so thanks :)

Are you running the preliminary test patch of version 0.03 ? if not please try it. The test patch should cope better than version 0.02 with two L ship cradles with one caveat.

Known issues

"Using multiple ShipTraders at the same time may have unfortunate consequences, do not attempt to recycle two ships at the same time."

what it probably should say is

"Using multiple ShipTraders at the same time may have unfortunate consequences, do not attempt to recycle two ships or build/repair/modify one ship and recycle another at the same time ."

The reason for me saying this is that I think the NPC_Shiptrader script uses global variables for controlling ship movement and detecting when a ship has arrived in a cradle and each ship dealer runs their own copy of the script, so they can upset each other. So two L cradles equals two copies of the script, two L cradles plus an XL equals 3 copies of the script. The medium ships use a different script NPC_Shiptrader_Small. The medium ship dealers could potentially upset each other too.

Do both L cradles recycle with the ships going to the right cradle if nothing else is happening in the other cradle(s) ?

This mod was intended for use with BlackRain's player shipyard mod.

jth

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Mon, 14. Dec 15, 18:54

- [10.12.2015 - V0.04 Public Beta]
Completely rewrote the ship selection user interface using customised versions of menu_property.lua and menu_buildcost.lua
Moved ship selection logic out of md script and into the GUI
This means that you cannot select a ship for recycling that does not fit in the ShipTraders cradle unlike previous versions where this was allowed initially but detected later and the process aborted
RecycleCostMenu checks the shipyard prerequisites before allowing you to OK which again avoids a later abort for lack of ShipTrader resources
The GUI API calls can get the shields and turrets from a ship that is Out Of Zone (OOZ) so the restriction on the recycled ship being in the same zone as the player has gone
No longer shares the sellship confirm menu so it makes one less change to ShipTrader.xml
Now recycles installed drones, ammunition and cargo
When recycling cargo it pays the full price for any wares that will fit in station storage and 50% if they do not fit or are not standard wares for a shipyard
When cloning the crew to the shipyard bar it now keeps their original names
Now multi lingualwhich means that a lot of the messages will have changed subtly to fit existing translated words
Now makes a single fund transfer for all crew contracts to cut down on event monitor messages
Now uses the FormatThousands library to format the money amounts with a separator between thousands
Removed ship selection logic and its event monitor messages from md script
Removed ship building ware estimate code from md script as this is now done in the RecycleCostMenu lua script which means that it no longer builds a dummy ship to find the necessary wares
Removed ship turret and shields finding code from md script as this is now done in the RecycleCostMenu lua script
Modified the station stocking code to use the less complicated array that RecycleCostMenu creates
Replaced the turret and shields stocking code with a simple loop that adds the drones, ammunition and cargo to the station from another array that RecycleCostMenu creates

Reaperxvii
Posts: 357
Joined: Thu, 29. May 14, 19:03
x3ap

Post by Reaperxvii » Mon, 11. Jan 16, 01:04

So I tried a standard construction vessel and it let me bring up the menu (I didn't try it yet though)

but when I tried recycling a Heavy sul I got the same error as I posted on the steam workshop link :/

I don't know if it matters but the shipyard being used is a BTO line that builds behemoths (from black rains CWIR mod)

The script works fine on non player owned shipyards though :)

**EDIT**

I just realized something, can you recycle a ship if it isn't constructed at that station?

I'm testing this theory now, waiting on a shipyard to build.

**EDIT 2**

The light sul didnt work, I just got these errors

Code: Select all


[gamestart: 1] - [01/11/16 01:14:12]: Error: UI::ICom::PointOfInterestSink::IsMessageBlocked() - Invalid state. We tried to retrieve the representative component for a POI which has been removed already. Fallback to not blocking the message.

[gamestart: 1] - [01/11/16 01:15:08]: Error: shiprecycle_menu_cost Recycling - Light Sul

[gamestart: 1] - [01/11/16 01:15:08]: Error: Error while executing onEvent script for event: showShipRecycle_CostMenu.
Errormessage: [string "extensions/shiprecycle/ui/shiprecycle/shiprec..."]:216: attempt to compare nil with number
Could a mod I have running cause these errors? I have quite a few on including the fighters mod which makes fighters able to dock at carriers, going to try a regular rahana now

**EDIT 3**

Sorry for the spams of editing haha, but I got the same error :/

Code: Select all

[gamestart: 2] - [01/11/16 01:24:58]: Error: shiprecycle_menu_cost Recycling - Rahanas (Container)
"We are the middle children of History. Born too late to explore the earth, born to early to explore the stars."

"Time is the fire in which we burn"

Reaper's Mod Index

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Mon, 11. Jan 16, 13:27

Thanks for posting over here.

As far as recycling is concerned if it fits in the dock then it should recycle and it will tell you if it doesn't fit and won't let you select it.

I did most of my testing in an NPC shipyard in Darned Hot Air just because it was there and had L and XL docks then tried a few ships through one of mine and they all worked.

They were standard ships though Rahamas, Titurel, CV, Taranis

I was more concerned with whether it did the drones, wares and weapons and even then that took a horrendous amount of time

The shipyard should not matter at all although I did find a few things with player shipyards that did not work at the same speed (much slower)

It shouldn't matter where they were built the recycling shipyard just has to understand them .......

My guess is that some piece of data is not coming back which is upsetting the gui if I can work out what it is then I may be able to compensate

Things like

Error: shiprecycle_menu_cost Recycling - Light Sul

actually are not errors it just that the lua command to log stuff sticks "Error:" on the front

DebugError("shiprecycle_menu_cost Recycling - " .. GetComponentData(menu.recycledship, "name"))

From what you are saying it sounds like a bigger problem

The big problem with this stuff is reproducing the fault so I have something that I can debug

Do you have a save game that I could have ? a dropbox link would be ideal you can PM it to me

Otherwise I think that I may have some more save games somewhere with a larger player shipyard

jth
EDIT Might have spotted something

Is your player shipyard essentially empty of wares ?

EDIT2 Found it - happens if the station has zero food or energy which would be true for a brand new player station

EDIT3 Did test if the player shipyard didn't have enough of the two wares but not if it had none at all. Oops :(

Fixed - v0.05 released on Nexus and Steam
Last edited by jth on Mon, 11. Jan 16, 16:01, edited 5 times in total.

Post Reply

Return to “X Rebirth - Scripts and Modding”