[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 » Thu, 12. Mar 15, 14:20

Thanks for helping me with this, its much less stressful getting the bugs out before they go live on Nexus and Steam.
Aranov wrote:Tested the newest version, and everything seems to be working smoothly with regards to bugs 1 and 3.

Upon sending an L ship to salvaged, all crew on the station and ship were successfully converted using the new method.
Subsequent salvaging of L ships went as expected, No problems there.

The first XL ship to be salvaged did create 6 crew instead of 3, but following ships worked normally.
I had a nasty thought last night about the conversion, I think that I need to check that the version 1 NPC's are on the shipyard before I convert them or you may loose some working ship captains ... About the only thing that I can do with the crew that are working is to skip them and to pop something in the log for the player to deal with.

If I have some spare time then I will see if I can reproduce the XL glitch but at least its a one off.
Aranov wrote:After this I checked the newly spawned NPCs(all 40 or so of them) and they appeared to be dressed correctly for their jobs.

However in the time of writing this post and letting X:R run in background, I found something else that maybe a problem.
The converted crew are now disappearing from stations after some time if I don't hire them.
I'm assuming this is do to same cleanup routine that changes out the various characters on the NPC stations every so often.
Hopefully that is issue 3 dealt with OK, I would agree with you about cleanup, at least you got paid for them this time :)

It might be possible to stop the NPC cleanup script on a player shipyard .. if we can find it
Aranov wrote:As for bug No.2, was my explanation confusing? I was hesitant to report it as I even found it a bit confusing.

I'll try to make it clearer what happens.

1. A shipyard fails the check to be able to salvage a ship.
In my case, a newly built shipyard had no food or drones as I had forgotten I needed them.

2. If that happens, The ship that the check failed on can not be targeted for salvage again.
Which is to say the "Select" button is greyed out and unclickable when choosing a ship to be sold or salvaged. This persists across all shipyards.

3. And the real problem IMO, The ship is stuck with the orders it had at the time of the failed salvage.
When calling the captain all possible orders are once again greyed out and unclickable. I can only tell them to leave or join my squad.
Now upon joining my squad I do have the option to give them orders, but they do not follow them.

That is the extant of what I know concerning bug No.2.

And thank you again for making this mod, and for continuing to update it.
This is easily one of my favorite mods for X:R, I can't believe Egosoft didn't do something like this in vanilla.
Now I have a way to finally remove ships that are stuck needing wares in the NPC shipyards, and it makes playing a pirate so much more satisfying.
I am going to add the extra conditions onto the conversion first then will see if I can reproduce issue 2 and the XL issue.

Thanks again

jth

Aranov
Posts: 134
Joined: Mon, 3. Jun 13, 23:08
x4

Post by Aranov » Thu, 12. Mar 15, 15:09

jth wrote: I had a nasty thought last night about the conversion, I think that I need to check that the version 1 NPC's are on the shipyard before I convert them or you may loose some working ship captains ... About the only thing that I can do with the crew that are working is to skip them and to pop something in the log for the player to deal with.
Just popping in to confirm this.
While I didn't have any crew from V.1 on ships due to the original bug, I did load my test save and tossed some of them on to a ship for testing.
When the cleanup script fires they are removed from the ship and I'm reimbursed.

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

Post by jth » Thu, 12. Mar 15, 18:27

Aranov wrote:
jth wrote: I had a nasty thought last night about the conversion, I think that I need to check that the version 1 NPC's are on the shipyard before I convert them or you may loose some working ship captains ... About the only thing that I can do with the crew that are working is to skip them and to pop something in the log for the player to deal with.
Just popping in to confirm this.
While I didn't have any crew from V.1 on ships due to the original bug, I did load my test save and tossed some of them on to a ship for testing.
When the cleanup script fires they are removed from the ship and I'm reimbursed.
Is what you just found actually a reasonable outcome ?

It leaves the ship in a dodgy position without crew although it does cleanly remove the ship's NPC's and get them re-created in a state that works better with the game.

If I exclude ship crew from conversion then the player could still convert them by putting them on a ship and recycling it and the ship(s) continue flying although they are vulnerable to getting their crew cleaned up as you originally reported

I can see both sides of this

what do you think ?

Regards

jth

Aranov
Posts: 134
Joined: Mon, 3. Jun 13, 23:08
x4

Post by Aranov » Thu, 12. Mar 15, 21:07

I agree, both sides do seem valid.

One thing to consider is if anyone else has reported the original issue with disappearing crew.
I never used crew from V.1 after I found out what was happening as I couldn't trust them to be there when I needed them.
But I haven't seen any other reports of the V.1 bug here or on steam, as such I would guess most folks aren't using this with the player shipyard mod.

From what I can see only crew from the V.1 salvaging method are removed, It'd be a one time thing unless another mod does something similar with crew.
So with a warning in the mod's description and maybe a message that pops up ingame the first time the mod is loaded everything should be fine.

However checking if they're on station could be a good idea, As if someone is using salvaged V.1 crew without issues then they wouldn't need to be replaced.
But as I said, another mod could come along that tries something similar to the way V.1 used the crew, so removing them from all player owned ship and stations might cause a mod conflict down the line.

But really IMO the bigger problem is informing the steam workshop users there's a gonna be a hiccup in updating, I'd like to think the best of people but the workshop makes it too easy to not know what a mod update may contain.

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

Post by jth » Fri, 13. Mar 15, 18:54

Aranov wrote:I agree, both sides do seem valid.

One thing to consider is if anyone else has reported the original issue with disappearing crew.
I never used crew from V.1 after I found out what was happening as I couldn't trust them to be there when I needed them.
But I haven't seen any other reports of the V.1 bug here or on steam, as such I would guess most folks aren't using this with the player shipyard mod.

From what I can see only crew from the V.1 salvaging method are removed, It'd be a one time thing unless another mod does something similar with crew.
So with a warning in the mod's description and maybe a message that pops up ingame the first time the mod is loaded everything should be fine.

However checking if they're on station could be a good idea, As if someone is using salvaged V.1 crew without issues then they wouldn't need to be replaced.
But as I said, another mod could come along that tries something similar to the way V.1 used the crew, so removing them from all player owned ship and stations might cause a mod conflict down the line.

But really IMO the bigger problem is informing the steam workshop users there's a gonna be a hiccup in updating, I'd like to think the best of people but the workshop makes it too easy to not know what a mod update may contain.
A lot of good points, thanks

You are the only person to report the missing crew issue though that does not mean that nobody else has seen it :( What you are saying makes sense and I can see the mechanism for the issue. I am also a lot happier creating re-hireable NPC's as I think that it fits into the game much better although it was a lot of work.

I was asked by BlackRain to collaborate on this functionality to go with the player shipyards, the fact that it also works with the NPC shipyards is a bonus :) If you keep re-using the same set of crew to go out and capture more ships then I suspect that you might not see the lost crew issue at all. Frankly I just don't know how many people are using it in what way, I just have a total.

I agree that the Steam notification is probably the key factor and keeping their ships going should be a priority. Its quite a responsibility changing things when you can't really tell the end users effectively. It does make it more important to test it properly first. so thanks again.

So have decided to go for notifying and replacing the NPC's if they are still on the shipyard and skipping them but notifying the user during conversion if they are on a ship (and writing the skipped ones to the log book). The logbook information include the role, ship name and where it is. I do know what NPC's were created by each shipdealer so will only convert those.

I have updated the code accordingly and put it up on dropbox

EDIT
I think that I have found and fixed the second issue that you spotted with a failed recycle due to resource constraints locking that ship out for good. The bug also affects version 1. The UI writes a $shiptrader_docking attribute to the ships pilot's blackboard, deleting that allows it to recycle later. I can't retrospectively fix any ships but i can stop any more getting locked out.
Aranov wrote:The first XL ship to be salvaged did create 6 crew instead of 3, but following ships worked normally.
I have also looked at the XL ship issue and I think that its actually OK. The conversion works by individual shipdealer and happens once for each shipdealer. So the creation that you saw was the XL shipdealer conversion of 3 crew from version 1 ( one XL ship was recycled under version 1 with 3 crew) plus the creation of 3 crew which equals 6. I have adjusted the wording a bit on the messages to be a bit clearer about conversion and recycling. Hope this makes sense.

If you try it again then I hope the messages will be clearer


Regards

jth
Last edited by jth on Fri, 13. Mar 15, 21:46, edited 1 time in total.

Aranov
Posts: 134
Joined: Mon, 3. Jun 13, 23:08
x4

Post by Aranov » Fri, 13. Mar 15, 21:05

Well so far almost everything that I'm seeing is working as intended.

The conversion skipped the crew that were on a ship, and gave a clear message in the log.
There is something going on with defense officers that have been assigned to the station.
After some testing, I found it'll remove defense officers if they meet the conditions for conversion, even if they somehow got assigned to the station.

The ship lockout is fixed totally, absolutely no problems there.

And I suspected the XL issue was just the conversion script, but I wasn't sure.

EDIT:Just thought of something, have you done anything for architects that are on ships or the shipyard?
I got an extra architect on my shipyard at some point, and she's not converting. I honestly have no idea where she came from as I can't recall salvaging a CV.

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

Post by jth » Fri, 13. Mar 15, 21:31

Aranov wrote:Well so far almost everything that I'm seeing is working as intended.

The conversion skipped the crew that were on a ship, and gave a clear message in the log.
There is something going on with defense officers that have been assigned to the station.
After some testing, I found it'll remove defense officers if they meet the conditions for conversion, even if they somehow got assigned to the station.

The ship lockout is fixed totally, absolutely no problems there.

And I suspected the XL issue was just the conversion script, but I wasn't sure.
Well spotted. Defense officers are usable by the station and the first one in via pod seems to install OK in theory the first Engineer should also be usable but doesn't seem to be :(

Might be a good idea to say in the known issues that it will remove a Defense Officer if they were recycled and installed in v1

Not quite sure exactly how it works but the mechanism for switching a running script seems to pop a complete list of every NPC recycled by that shipdealer (running version 1) in the group that I use to get the ship crew. The strange thing is that it normally seems to overwrite the group running version 1 from fresh or version 2 from fresh, it only happens when the script is switched.

Somehow maybe ??? the ships crews gets added (not overwritten) into the same group in the root cue and then appears the first time that v2 script replaces the v1 script. So it gives me a complete list and I don't have to go searching which gives me the confidence to do the cleanup en mass. Bit strange but very convenient :)

EDIT2

At the moment it finds all the Control Entities on the recycling ship which is pilots, captains, defense officers, engineers and I think Architects. The cue that does the actual recycling ought to be able to recycle any type of NPC.

Just realised that your Architect is probably virtual and is a pointer to the one on the CV that built/is building your shipyard, so its not really on the shipyard.

I did recycle a CV as part of the latest save game but didn't have an Architect on there, will try it soon for completeness.

EDIT3

Actually I did have an Architect on the CV and she recycled fine :)

Regards

jth

Conbadicus
Posts: 217
Joined: Sat, 13. Feb 10, 09:31

Post by Conbadicus » Sun, 22. Mar 15, 17:02

After installing this mod, CV shipyards only sell drostans.

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

Post by jth » Sun, 22. Mar 15, 18:05

Conbadicus wrote:After installing this mod, CV shipyards only sell drostans.
Just tried to build a few things myself in an XLV cradle, I was offered a CV, Arawn, Taranis and a Scaldis. I chose the CV and it built fine. Also tried out the LV cradle and that gave what I think is the full range of possibilities and built a Fedhelm OK. That confirms to me that the ship building functionality still works fine.

This mod goes nowhere near the ship definitions and doesn't change any code around ship building.

You might want to disable the mod from the Extensions and confirm that the problem doesn't go away to eliminate it from your investigation.

Regards

jth

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

Post by jth » Sun, 22. Mar 15, 18:27

Hi

22 March 2015

I have just uploaded version 0.02 to the Nexus mod site and have published it on Steam as Ship Recycle

www.nexusmods.com/xrebirth/mods/428/

Regards

jth

Conbadicus
Posts: 217
Joined: Sat, 13. Feb 10, 09:31

Post by Conbadicus » Mon, 23. Mar 15, 09:25

I just tested it. Vanilla new game with just this mod installed. CV small ship stations only offer drostan.

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

Post by jth » Mon, 23. Mar 15, 13:25

Conbadicus wrote:I just tested it. Vanilla new game with just this mod installed. CV small ship stations only offer drostan.
I assume X Rebirth 3.51
I assume the latest version of the Shipyard and Player Shipyard - Ship recycling mod which is 0.02 released yesterday (it hasn't got anything in there that should make a difference compared to 0.01 but its the current code as far as I am concerned)

Which start ?
Which shipyard in which zone ?

what other mods do you have installed ?

then I will give it a go and see if I can see anything

Alternatively if you would like to do an F5 and then zip up the quicksave.xml file and pop it up on dropbpox, then I will take a look. You can post the link here or send me a private message by clicking on the "You have no new messages" link on the right and going from there.

Regards

jth

Conbadicus
Posts: 217
Joined: Sat, 13. Feb 10, 09:31

Post by Conbadicus » Tue, 24. Mar 15, 15:36

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

Vanilla w/ shipyard mod, Free Play - latest versions.

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

Post by Requiemfang » Wed, 25. Mar 15, 04:11

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?

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

Post by Sparky Sparkycorp » Wed, 25. Mar 15, 08:01

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.

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.

Post Reply

Return to “X Rebirth - Scripts and Modding”