EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
[MOD] Shipyard and Player Shipyard - Ship recycling v0.07 (6 Apr 2017)
Post new topic Reply to topic Goto page 1, 2, 3, 4, 5, 6  Next
View previous topic :: View next topic
Author Message
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
modified
PostPosted: Tue, 16. Dec 14, 17:57    Post subject: [MOD] Shipyard and Player Shipyard - Ship recycling v0.07 (6 Apr 2017) Reply with quote Print

6 Apr 2017

Changes from v0.06

Compensate for format of game version string changing in 4.10 RC3 and add extra paranoia when checking version to prevent crashing the GUI

Changes from v0.05

Got the calculator out to check the sums on recycling and found that they were actually broken as of v0.04 and far too generous. Fixed.

Add remote logging via md script to remove false positive Error messages, caused by lua DebugError logging commands, in debug.log that were actually informational
Compensate for parameter changes to Encyclopaedia API in 4.00 RC2 to prevent Encyclopaedia buttons crashing the GUI
Apply a 90% recycling factor to ship hull wares
Rebalance prices to track what shipbuilders pay to buy back ships (80%), drones (85%) and ammunition (90%)
Add an extra 10% handling charge to wares that could be sold to the station by the player before the ship is recycled. As the Teladi say "time is money".
Changed API call used for calculating free space to take into account the available space for the ware instead of total available space
Fix issue with calculating refund when recycling where there is no storage space for a specific ware. Now correctly refunds 50%
Adjusted on screen messages a litle for when ware doesn't all fit into shipyard storage
Suppress Drone section when there are no drones

I have just uploaded version 0.06 to the Nexus mod site. Steam also updated

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

This mod adds the ability to Recycle a ship. It changes the ShipTrader menu option Sell a ship to Sell or recycle a ship

This should allow you to operate in Pirate mode and use the recycled wares to build your own ships.

It will also integrate the NPC shipyards better into the local economy as the wares from ship recycling will be used by NPC shipyards rather than the sold ship just sailing off and never being seen again.

The mod patches Egosoft's ShipTrader.xml file to add the extra option and back end code.

How to Use

Fly to the zone that contains the shipyard that you want to use to recycle your ship
Open communications with the right Ship Trader for the size of vessel that you are recycling
Pick the "Sell or recycle a ship" menu option
Select the ship and then click on either the Recycle or Sell button.
The Sell button sells the ship in the normal way using standard Egosoft code at the standard price
The Recycle button opens up the Recycle Cost menu for the selected ship where you can see the recycling information
Then pick "Yes, recycle this ship"
Sit back and watch the ship move into the docking cradle and then observe the hull and weapons getting recycled

Features

Allows recycling of L and XL ships in Player Shipyards and NPC Shipyards
Uses a customised version of Egosoft's PropertyMenu and BuildCostMenu GUI menus to select the ship to be recycled and show you what wares will be recovered
Checks a number of pre-requisites to make sure that recycling can proceed and notifies player if there are any problems before allowing the player to continue.
PropertyMenu checks that the recycling ship will fit into the individual ShipTrader's ship cradle.
BuildCostMenu checks that the shipyard has enough food, energy and construction drones present and that the recycling ship is in the same zone as the player (needed if you want the weapons and shields back).
Recycles hull wares taking into account the state of the hull at the time
Recycles operational Weapons and Shields plus 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
If the Shipyard is NPC owned then the player is paid for the ship in the same way as the current Sell a ship
Consumes energy and food rations to carry out recycling
Moves ship into appropriate ship cradle and chops the hull up piece by piece
Pays player for crew and recreates NPC's with same skills as ship crew on shipyard where they can be hired by player. This means that if you spend time training crew then their replacement will also have the benefit of the training.
The types of NPC that are recycled are the ship Control Entities which include pilot, captain, defense officer, engineer and architect.
Will try to put recreated crew in the bar if it can find it and there is room otherwise picks any personnel docking bay that has space.
Maintains individual ShipTrader locking so that an individual ship trader can only do one thing at a time
Aborts recycle if ship is destroyed before it gets into dock just like the other ShipTrader operations.
Logs ship recycling in player log book
Logs a lot of information to debug.log so that the recycling process can be checked and diagnosed


Known issues
If there is no space on the shipyard for recreating the crew then they will not be recreated but you will still be paid for the old crew.
The amount that is paid for a crew contract is calculated by calling the Egosoft FeeCalculation cue from NPC_Staff without applying any recycling factors as its going to be pretty random anyway. To quote from the code <!-- 1/4 = skill based, 3/4 = random -->. It will almost definitely be different to what you paid for that crew member in the first place.
If you leave recycled crew on the shipyard for too long then they will eventually get cleaned up by the Egosoft station crew script and replaced by someone else with different skills.
Using multiple ShipTraders from the same shipyard at the same time may have unfortunate consequences, do not attempt to recycle two ships at the same time.
When recycling there is no check that recycled wares can fit in station storage for anything except ship cargo. There were no checks at all before v0.04

To Do

Small ShipTraders if suitable case made by players and enough demand, ware amounts are rather small for m ships.
Fly some construction drones around during chop up phase
Look at simultaneous multi ship recycling

=== Release history ===
- [24.2.2016 - V0.06 Public Beta]
shiprecycle_menu_cost gui - Add remote logging via md script to remove false positive Error messages, caused by DebugError logging commands, in debug.log that were actually informational
shiprecycle_menu_cost gui - Compensate for parameter changes to Encyclopaedia API in 4.00 RC2 to prevent Encyclopaedia buttons crashing the GUI
shiprecycle_menu_cost gui - Apply a 90% recycling factor to ship hull wares
shiprecycle_menu_cost gui - Rebalance prices to track what shipbuilders pay to buy back ships (80%), drones (85%) and ammunition (90%)
shiprecycle_menu_cost gui - Add an extra 10% handling charge to wares that could be sold to the station by the player before the ship is recycled. As the Teladi say "time is money".
shiprecycle_menu_cost gui - Changed API call used for calculating free space to take into account the available space for the ware instead of total available space
shiprecycle_menu_cost gui - Fix issue with calculating refund when recycling where there is no storage space for a specific ware. Now correctly refunds 50%
shiprecycle_menu_cost gui - Adjusted on screen messages a litle for when ware doesn't all fit into shipyard storage
shiprecycle_menu_cost gui - Suppress Drone section when there are no drones

- [11.1.2016 - V0.05 Public Beta]
shiprecycle_menu_cost gui - Fixed failure to recycle any ships when there was zero energycells or foodrations on the shipyard which will happen with a brand new player shipyard

- [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
Checks selling price of NPC's and if greater than max allowed then compensates by dividing by 100

- [27.3.2015 - V0.03 Public Beta]
Interoperability - added support for Combined Docks example code by UniTrader even though its not on Steam or Nexus

- [13.3.2015 - V0.02 Public Beta]
Major change - Removed use of boarding pods to transport crew onto shipyard, crew contracts now sold to the shipdealer and they stay on board ship
Pays player for crew and recreates NPC's with same skills as ship crew on shipyard where they can be hired by player.
Tries to put recreated crew in the bar if there is room otherwise picks any docking bay that has space.
Converts the player owned NPC's that were transported to the shipyard via boarding pod while running version 1 of this script into hireable NPC's and pays player for them
Fixes an issue where recycling was refused due to insufficient shipyard resources caused the commander of the ship that was being recycled to get a blackboard entry of $shiptrader_docking added which prevented that ship from ever being recycled or sold.

- [14.12.2014 - V0.01 Public Beta]
Initial Release

Regards

jth



Last edited by jth on Thu, 6. Apr 17, 15:54; edited 9 times in total
Back to top
View user's profile Send private message
Sparky Sparkycorp
Moderator (English)
Moderator (English)



Joined: 30 Mar 2004
Posts: 6731 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 18:11    Post subject: Reply with quote Print

Sweet, will test with an NPC shipyard this evening. Thanks Smile


_________________
X:R mod list. X:R Wiki.
Updated TC/AP Bonus Pack. AP TS efficiency.
Back to top
View user's profile Send private message
w.evans





Joined: 18 Nov 2014
Posts: 2953 on topic

Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 18:15    Post subject: Re: [MOD] Shipyard and Player Shipyard - Ship recycling Reply with quote Print

Sounds cool! Proof that environmentally friendly measures can be good for the economy! (at least in space)

Have a question about this though:
jth wrote:
Evacuates crew via boarding pod to the Shipyard

If I were to recycle a ship in an NPC shipyard (not ready to make the leap to Player Shipyards yet) will my crew remain hired? Can they act as trade agents/spies in the Shipyard? Will I have to re-hire them?

edit: "friendly"

Back to top
View user's profile Send private message
dez505





Joined: 06 Nov 2002
Posts: 154 on topic
Location: United Kingdom
Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 18:26    Post subject: Reply with quote Print

As cool as this is I think it needs a recycle penalty like -20%/30% on return otherwise it may very much unbalance the economies only sink-hole Razz


Other than that this is an amazing peace of work!


_________________
Back to top
View user's profile Send private message AIM Address
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Dec 2003
Posts: 5023 on topic

Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 21:29    Post subject: Reply with quote Print

dez505 wrote:
As cool as this is I think it needs a recycle penalty like -20%/30% on return otherwise it may very much unbalance the economies only sink-hole Razz


Other than that this is an amazing peace of work!



This is really intended for player shipyards so no penalty is needed. While you can recycle ships at an NPC shipyard, you do not have to. If you do not want to recycle at an NPC shipyard you can just sell it. It is your choice.

Back to top
View user's profile Send private message
NZ-Wanderer





Joined: 05 Aug 2004
Posts: 1462 on topic
Location: Christchurch, New Zealand
Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 21:34    Post subject: Reply with quote Print

Oooo, I like the sound of this...
One silly question tho, I still have blackrains player shipyard installed as well as this one right Smile (told ya it was silly question)


_________________
Link to the list of Mods working in 2.50 - 4.3x

Back to top
View user's profile Send private message Send e-mail
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
modified
PostPosted: Tue, 16. Dec 14, 22:24    Post subject: Reply with quote Print

dez505 wrote:
As cool as this is I think it needs a recycle penalty like -20%/30% on return otherwise it may very much unbalance the economies only sink-hole Razz


Other than that this is an amazing peace of work!


The state of the hull is also used to limit recycling, so if your hull is 70% then you only get 70% of the wares. That stops you getting paid for the missing 30%.

You do get charged the full food and energy requirements independent of hull state. Not sure what that is as a percentage.

Bit undecided about whether to also add say an 80% factor on top of that like the station recycling. As you would only get 56% if you started with a 70% hull and then added a recycling efficiency of 80%. A shipyard ought to be better at recycling that a Construction Vessel.

The station recycling has the bonus that 80% gets everything to fit in the CV even for big stations Smile

Might give 90% some thought. What do you think ?



Last edited by jth on Tue, 16. Dec 14, 22:32; edited 1 time in total
Back to top
View user's profile Send private message
NZ-Wanderer





Joined: 05 Aug 2004
Posts: 1462 on topic
Location: Christchurch, New Zealand
Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 22:27    Post subject: Reply with quote Print

Personally, I would say, if the ship is damaged at all, then you get the % that the ship is..
If the ship is 100% then maybe you get 80% recycled..

This IMHO would be the fairest thing to do Smile


_________________
Link to the list of Mods working in 2.50 - 4.3x

Back to top
View user's profile Send private message Send e-mail
jth



MEDALMEDAL

Joined: 04 Jan 2006
Posts: 295 on topic
Location: England
Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 22:31    Post subject: Re: [MOD] Shipyard and Player Shipyard - Ship recycling Reply with quote Print

w.evans wrote:
Sounds cool! Proof that environmentally friendly measures can be good for the economy! (at least in space)

Have a question about this though:
jth wrote:
Evacuates crew via boarding pod to the Shipyard

If I were to recycle a ship in an NPC shipyard (not ready to make the leap to Player Shipyards yet) will my crew remain hired? Can they act as trade agents/spies in the Shipyard? Will I have to re-hire them?

edit: "friendly"


I have to admit that I don't know. I was more concerned with keeping them around even if I had to rehire them.

What happens with the station recycle (uses the same API call) is that they end up on the Skunk and retain their loyalty to you and can be told to work elsewhere, so no rehire fees. I don't think that they will act as trade agents/spies.

Back to top
View user's profile Send private message
w.evans





Joined: 18 Nov 2014
Posts: 2953 on topic

Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 22:45    Post subject: Reply with quote Print

Sounds good. Thanks for taking the time to answer. Will take 'er for a spin.

Back to top
View user's profile Send private message
Sparky Sparkycorp
Moderator (English)
Moderator (English)



Joined: 30 Mar 2004
Posts: 6731 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 16. Dec 14, 23:31    Post subject: Reply with quote Print

jth wrote:

You do get charged the full food and energy requirements independent of hull state. Not sure what that is as a percentage.

Funnily enough, I was thinking about the same thing this afternoon and did some quick calculations for all the non-TO civilian M-XL ships as I had all their build requirements in a spreadsheet. Food+ECs is typically about 0.3-0.8% of base build costs. I agree it is a good idea to retain the ECs and Food as they sound like construction costs but it isn't a substantial amount.

jth wrote:

Might give 90% some thought. What do you think ?

Tricky question since as I understand things, shipyards essentially work for free because ships only seem to cost 'resources' rather than 'resources+build fee'. If that is correct, it might be most logical to factor that it first. Although in any case, since no process is 100% efficient, loosing a few % of each resource would be logical.

I guess what I would imagine as nice in an idea world would be that you add a cost to all ships in the game equal to x% that a shipyard charges as a profit on ship construction. Then have that fee be waved at player-owned shipyards when players build stuff and have that fee not given to the player when they recycle a ship at an NPC station. As long as their is a suitable penalty applied when ships are sold to NPC stations (as is currently), it should prevent generating free money though building and selling.


_________________
X:R mod list. X:R Wiki.
Updated TC/AP Bonus Pack. AP TS efficiency.
Back to top
View user's profile Send private message
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Dec 2003
Posts: 5023 on topic

Thank you for registering your game
PostPosted: Wed, 17. Dec 14, 03:09    Post subject: Reply with quote Print

Sparky Sparkycorp wrote:
jth wrote:

You do get charged the full food and energy requirements independent of hull state. Not sure what that is as a percentage.

Funnily enough, I was thinking about the same thing this afternoon and did some quick calculations for all the non-TO civilian M-XL ships as I had all their build requirements in a spreadsheet. Food+ECs is typically about 0.3-0.8% of base build costs. I agree it is a good idea to retain the ECs and Food as they sound like construction costs but it isn't a substantial amount.

jth wrote:

Might give 90% some thought. What do you think ?

Tricky question since as I understand things, shipyards essentially work for free because ships only seem to cost 'resources' rather than 'resources+build fee'. If that is correct, it might be most logical to factor that it first. Although in any case, since no process is 100% efficient, loosing a few % of each resource would be logical.

I guess what I would imagine as nice in an idea world would be that you add a cost to all ships in the game equal to x% that a shipyard charges as a profit on ship construction. Then have that fee be waved at player-owned shipyards when players build stuff and have that fee not given to the player when they recycle a ship at an NPC station. As long as their is a suitable penalty applied when ships are sold to NPC stations (as is currently), it should prevent generating free money though building and selling.


You aren't getting free money from building and selling. Again, the idea was to capture ships and recycle them at your own station. You would make more money by just selling ships you captured once their hull was mostly repaired.

Also, the amount of resources you get is not substantial. You have to consider the following, the idea was that you could play as a pirate, completely independent from any faction. This means, you could build ships, and stations, all without ever buying any resources (except for initial start up cost of food and energy but later you could build stations to give you this).

In order to build stations, you need to capture and recycle ships. You can then shift resources around (with your transports by moving them from shipyard to ship and then to CV's when constructing, etc.). This requires a lot of resources. Given that boarding is difficult to begin with and takes a lot of time, plus the requirements of resources when building ships and stations, it will take a substantial amount of time and energy to build up a real empire but this is part of the fun in my opinion. However, lowering the amount of resources received further would be to the detriment of this play style. I assure you, it already is difficult enough with the current resources given but I think it is just right.

To add further to my point, you would make more money by selling the captured and repaired ships then by selling the resources you obtain from recycling. It would be much more profitable to just sell all the ships you board given the fact that you would have to trade in various resources and always at substantial gain. It is just much more profitable to board and quickly sell, rinse and repeat. Therefore, no change is necessary in limiting resources gained any further.

Now, I can just easily change the script to my own liking, but it is in my opinion that the way it is now is sufficient for good game play.

Back to top
View user's profile Send private message
Sparky Sparkycorp
Moderator (English)
Moderator (English)



Joined: 30 Mar 2004
Posts: 6731 on topic
Location: UK
Thank you for registering your game
PostPosted: Wed, 17. Dec 14, 09:19    Post subject: Reply with quote Print

Thank you very much for taking the time to reply in detail. I didn't understand the system properly and appreciate the info. Sound's great.


_________________
X:R mod list. X:R Wiki.
Updated TC/AP Bonus Pack. AP TS efficiency.
Back to top
View user's profile Send private message
Aranov





Joined: 03 Jun 2013
Posts: 29 on topic

Thank you for registering your game
PostPosted: Wed, 17. Dec 14, 22:33    Post subject: Reply with quote Print

Hi, just wanted to thank you and everyone who helped for making and releasing this mod.

My biggest problem with X:R was being unable to build or repair my ships do to a faulty economy, while the AI got ships spawned in for free most of the time(I'm Looking at you, Marauder Titurels and PMC Wardens).

I've tested it out in the HoA shipyard, everything worked perfectly. Soon I'll have my own shipyard and I'll be seeing how it works there.

Thank you again!

Back to top
View user's profile Send private message
dez505





Joined: 06 Nov 2002
Posts: 154 on topic
Location: United Kingdom
Thank you for registering your game
PostPosted: Wed, 17. Dec 14, 22:44    Post subject: Reply with quote Print

Question can it be done so hull% = resource amount returned?


_________________
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3, 4, 5, 6  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Mon, 16. Jul 18, 20:27

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.17323 seconds, sql queries = 29