[MOD] Station Recycle or Destroy - v0.11 (16 November 2015)

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

Re: Can't get it to work

Post by jth » Sun, 26. Jul 15, 13:02

normntaz wrote:I can't seem to get this to work.

Because of other mods, I have to use the "Backdoor" option.

When on the CV, I have the option to Destroy, Sell, or Recycle+Sell. If I choose any of these, I get a 1 minute countdown, and a prompt to return to my ship. Once I do, nothing happens.

If I don't return to my ship, nothing happens, also.

What am I doing wrong?
You are doing everything right as far as I can see. Its probably debug time (see readme.txt for how to do this) but here is what should happen

Destroy station

If you don't return to the ship then after 60 seconds the game should end as you have been killed when the CV blows up. If it doesn't then its debug time [edit] or could be a larger problem.

If you do return to the ship then the station and builder CV will be wrecked and destroyed over the course of a few minutes depending on station size. Watch the status messages on the Event monitor.

Recycle Station

If you don't return to the ship then after 60 seconds the game should end as you have been killed when the CV blows up. If it doesn't then its debug time [edit] or could be a larger problem.

If you do return to the ship then the builder CV should be cloned and the station recycled over the course of a few minutes depending on station size. Watch the status messages on the Event monitor. The very first thing that it does is to rename the builder CV to "Construction Vessel" and no longer have the corners sticking out. If it doesn't then its debug time.

Recycle + Sell

You may still get the 60 second mini return to ship but if you don't return then nothing will happen for a while as the CV is destroyed much later.

The station will then be wrecked over the course of a few minutes depending on station size and at the end of that the recycled wares should appear in the builder CV and a mission should pop up telling you to unload the builder CV. At the end of the mission then the station will be destroyed and the CV wrecked then destroyed.

I suspect that its going to be debug file time, so please have a look at the readme.txt and follow the instructions to generate a debug file. Remember to filter it to only show messages from StationRecycle. Then compare what you get with the examples in the readme.txt

You can also post your filtered debug file here

Hope this helps

Regards

jth

[edit] Its possible that you could have a larger problem as you don't get blown up after 60 seconds.

[edit2] By larger problem I mean mods interacting, corrupt save game, broken installation or worst case OS issues. To identify mods issues then please disable all non Egosoft mods except this one and load a couple of different save games and see if it works, if it does then narrow in on which other mod this one is fighting and let me know.

normntaz
Posts: 52
Joined: Mon, 21. Nov 05, 00:04
x4

Post by normntaz » Tue, 28. Jul 15, 19:38

Thank you,

I will try to experiment this weekend to see if I can find any other mods that conflict.

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

Post by jth » Sun, 16. Aug 15, 13:08

kelmenwong wrote:suggest a new feature
- to dislodge attached CV from station
- station repair can be done by another mod - station engineer

now we can reuse the CV, and the finished station do looks like other station, without the need of forever attached cv
I have spent a fair bit of time coding away and have managed to come up with two new options in the Tools menu for the next release v0.09

Destroy CV

This will destroy the Builder CV if the station is finished and teleport the engineer to the station. I have done some rudimentary testing and it does then successfully repair the station. Interestingly it doesn't need the station engineer mod to do this although you will still need station engineer mod to manually drop off an engineer.

At the moment you need to do this one station at a time and the station has to be finished. That means fully extended including production and storage modules, defense and communications. I am thinking about letting you have a Destroy it even if its not finished button too.

On a broader front I think that a cleanup script for existing stations is quite doable but it probably wants to be a seperate mod. It would also be very important to make a final decision about what to do with all the crew on the Builder CV as once they are cleaned up its going to be expensive and time consuming to go back. I still haven't found that Egosoft announcement or whatever that talked about this.

I am inclined to go with a destroyed CV and let the Captain and Architect go with it as that goes better with the encyclopaedia. Egosoft have locked out the comms menu options that would allow you to get these two back off the Builder CV. The Engineer definitely goes across to the station. Not sure about Defence Officer.

Any thoughts anyone ?

Reattach CV

This attaches a new CV to a station when the existing one does not exist. This is something that I have been meaning to do for a while as No Builder CV = no Recycling at the moment. Thanks for asking for the Destroy option which reminded me to deal with this.

It should also help if you accidentally delete a Builder CV or change your mind later. Also if the enemy destroyed your Builder CV.

This option takes a CV from your squad and flies it into position which gets a bit hairy when other ships are around. It seems to be happy to end up hundreds of metres above or below the correct position. It will have several goes until its within 1500m of the right position. So far the record is 6 tries ..... but it did get there in the end :)

So when is version 0.09 being released ?

v0.09 with the two new options basically works. Its in the testing and polishing phase which is taking longer as this mod gets bigger. Probably not this weekend sorry.

Regards

jth

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

Post by Sparky Sparkycorp » Mon, 17. Aug 15, 11:18

Hi jth,

Good luck with the next version. Not needed to move a station yet but I may later and in any case, this removal of CV idea would be great.
jth wrote: I am inclined to go with a destroyed CV and let the Captain and Architect go with it as that goes better with the encyclopaedia. Egosoft have locked out the comms menu options that would allow you to get these two back off the Builder CV. The Engineer definitely goes across to the station. Not sure about Defence Officer.

Any thoughts anyone ?
Transferring at least some Architect functionality sounds important if it is the only way to equip drones later. Although maybe the Transfer order for capital trade ships can do the same thing - sorry, I missed your post yesterday and now cannot test until this evening.

Not sure about the CV's Captain and DO. NPCs are unlimited, their cost is relatively small next to station construction, and I don't tend to think a CV Captain is worth training and/or hunting for good ones. if easier, I'd be inclined to just have them disappear or maybe appear on the station as either waiting to be told to go back on the Skunk or be hireable.
jth wrote: Also if the enemy destroyed your Builder CV.
I may be missing a subtlety here but I was under the impression attaching a replacement CV was an vanilla option now. Or I guess the vanilla function isn't possible if we have used the Destroy CV option? Then I understand :)
jth wrote: This option takes a CV from your squad and flies it into position which gets a bit hairy when other ships are around. It seems to be happy to end up hundreds of metres above or below the correct position. It will have several goes until its within 1500m of the right position. So far the record is 6 tries ..... but it did get there in the end :)
Hehe, bringing back X2-style station construction for the nostalgic :D

Would it be possible to tell a CV to 'fly it my position', then leave the zone and issue the attach order? Maybe loss of collision detection/avoidance OOZ could help.

Regards,
Sparks

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

Post by jth » Mon, 17. Aug 15, 13:19

Sparky Sparkycorp wrote:Hi jth,
jth wrote: Also if the enemy destroyed your Builder CV.
I may be missing a subtlety here but I was under the impression attaching a replacement CV was an vanilla option now. Or I guess the vanilla function isn't possible if we have used the Destroy CV option? Then I understand :)


Sparks
The destroy option just destroys the CV in the same way as an enemy would so there is nothing special there.

You have me worried there especially as it was a lot of work and a fairly large piece of code :(

I thought that it was a vanilla option too as I am sure that I remember Egosoft announcing it as such sometime back in version 1.

However I can't actually find out how to do it :(

The only way to build a station is when one of those building icons is around and if the station is built then there is no icon for that build location any more. So there is nothing to double click.

I attached a CV with Architect to my squad and tried various things but couldn't trigger any conversations that said re-attach. The Architect on the CV that you want to attach is the obvious choice but there is no Re-Attach option in the menu.

I then went through the Egosoft code looking for the API call of <connect_to_build_location> which is what does the actual attaching. Its in five md scripts of which four just use it to create stations, the other is NPC_Architect and there is no menu in there about re-attaching.

Just had a sinking feeling what about if its embedded in the UI code but there doesn't seem to be an equivalent LUA function for <connect_to_build_location> :)

I wonder whether it got removed later on when space got tight in the Architect menu. Its a nuisance that there is no real way to look at the old versions of the md scripts without saving your own copies as each version comes out.

Regards

jth

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 17. Aug 15, 13:26

jth wrote:I attached a CV with Architect to my squad and tried various things but couldn't trigger any conversations that said re-attach. The Architect on the CV that you want to attach is the obvious choice but there is no Re-Attach option in the menu.
Not in-game right now, so couldn't check, but isn't this the "Deploy to" conversation option with the Architect?

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

Post by jth » Mon, 17. Aug 15, 13:32

w.evans wrote:
jth wrote:I attached a CV with Architect to my squad and tried various things but couldn't trigger any conversations that said re-attach. The Architect on the CV that you want to attach is the obvious choice but there is no Re-Attach option in the menu.
Not in-game right now, so couldn't check, but isn't this the "Deploy to" conversation option with the Architect?
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah

Obviously didn't try that one :( and yes you are right

Oh well that option can come out then

Thanks

jth

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

Post by jth » Thu, 20. Aug 15, 18:37

Version v0.09 posted 20 August 2015

Changed Trigger actor from Trade Manager to Defense Manager to get out of the way of the Trading and Manager scripts and improve chances of getting to the "Recycle or Destroy station" menu.

[20.8.2015 - V0.09 Public Beta]
Adjusted RecycleSt_SellWares mission steps to translate engineer and defencecontrol
Adjusted RecycleSt_SellWares mission description to use Egosofts translations for all CV crew types and changed Pickup to Collect
Adjusted RecycleSt_SellWares mission description to make the text inside the () and brackets appear
Added Russian translation file from alexalsp
Added Tools - "Destroy Construction Vessel" to remove attached Builder CV
Modified RecycleSt_Menu to cope with being passed a station, CV or actor object
Modified RecycleSt_CheckSafe to cope with being passed a station, CV or actor object
Changed Trigger actor from Manager to Defense Manager to get out of the way of the Trading and Manager scripts and improve chances of getting to the "Recycle or Destroy station" menu.
Added RecycleSt_DummyNPC which will dynamically create a dummy Defense Manager on whatever station is selected from "Property Owned - Comms" or "Zonemap - Comms", destroying the dummy Defense Manager when no longer needed
Lower cased script and folder names to help with unix compatability
Extended mini mission timeout from when you are about to blow yourself up from 60 to 120 seconds

Regards

jth

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

Post by jth » Tue, 25. Aug 15, 17:42

Just added a Flow Chart to the pictures up on Steam and Nexus

I hope this will help people to navigate through the mod a bit more easily and make it easier to report exactly where things are going wrong

probably shouldn't link to a specific server but ....

http://static-4.nexusmods.com/15/mods/1 ... 514374.jpg

jth

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

Post by Sparky Sparkycorp » Tue, 25. Aug 15, 17:57

Nice one. I shall test it out with a station I want to keep, just to see how it works.

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

Post by jth » Tue, 1. Sep 15, 19:31

Version v0.10 posted 1 September 2015

- [1.9.2015 - V0.10 Public Beta]
Destroy Station now destroys the station 5 times faster than normal rather than everything at the same time to keep the frame rate up
Destroy Station now releases the Builder CV so that it can be reused instead of destroying it. The crew remain the same except for the Architect who gets cloned (including skills).
Recycle Station now releases the Builder CV so that it can be reused instead of cloning it. The crew remain the same except for the Architect who gets cloned (including skills).
Recycle + sell Station now releases the Builder CV so that it can be reused instead of cloning it. The crew remain the same except for the Architect who gets cloned (including skills).
Release Construction Vessel created to reuse Construction Vessel. The crew remain the same except for the Architect who gets cloned (including skills).
RecycleSt_SellWares - No longer removes crew from selling CV as it is going to be reused and not destroyed
RecycleSt_SellWares - Change messages to remove references to moving crew from selling CV as it is going to be reused and not destroyed
RecycleSt_SellWares - Removed cue RecycleSt_SellWares_ControlEntityMove as crew no longer need to be removed from selling CV
RecycleSt_DummyNPC - Now looks for existing Defense Officers in all personnel docks not just Administration
RecycleSt_DummyNPC - Now makes you pay max fee for the dummy Defence Officer whatever their skill levels as they are essentially hired by you at that point and refunds when they are destroyed
RecycleSt_Main - Added "fast" and "instant" as options when destroying stations.
RecycleSt_Menu - Release Construction Vessel added to first level menu and Destroy Construction Vessel removed from Tools menu
RecycleSt_Menu - Return added back into Tools menu
RecycleSt_Menu - Detects Litauen_ShowBalance and puts help message about how to reattach CV into the event monitor instead of using show_help
RecycleSt_Fns RelocateCrew - Removed transfer of player owned station crew onto other stations when recycling and skunk full - game really doesn't know what to do with them
RecycleSt_Fns - removed CloneCv code as its now released instead of destroyed

Regards

jth

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

Post by jth » Tue, 1. Sep 15, 19:47

kelmenwong wrote:suggest a new feature
- to dislodge attached CV from station
- station repair can be done by another mod - station engineer

now we can reuse the CV, and the finished station do looks like other station, without the need of forever attached cv
Hopefully the new Release Construction vessel is what you were looking for

I have also added an option under the Tools menu to

Transfer Engineer to station to transfer the engineer from the attached Construction Vessel to the station.

Regards

jth

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

Post by jth » Thu, 3. Sep 15, 15:32

Two new flow charts. One for triggering the mod and the other for using it.

I suspect that a large amount of my "your mod doesn't work" issues have always been with triggering the menu so seperated that out into its own flow chart.

It also makes the flow charts marginally easier to maintain.

Triggering
http://static-3.nexusmods.com/15/mods/1 ... 287299.jpg

Using
http://static-3.nexusmods.com/15/mods/1 ... 287300.jpg

Regards

jth

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

Post by jth » Wed, 7. Oct 15, 14:49

I am currently thinking about adding a Structural Rebuild option to the Tools menu.

The objective of this option would be to completely rebuild your station on the same location. Its kind of like an enhanced Repair option for the Architect but one that also puts back any missing bits.

Would probably charge a flat fee of 10% of the value of the station at whatever stage it is.

How I am going to do it is to move the crew somewhere else and then delete the exisiting station and use the plot station api calls to rebuild it to the same stage on the same spot. The CV would remain untouched.

Issues that I can see with implementing this

There is an alternative API call that Egosoft use to build the plot stations but I have a feeling that it will give me max shields + max weapons + 100% hull. I don't know any way to actually remove shields or weapons in such a way that they appear to have never been installed. I do know how to destroy them but then you get a pile of smoke and some wreckage which is not really what I want.

I think that I can save the crew and cargo but any production in progress is going to be toast.

I don't want to unbalance the game but am conscious that there could be a lot of stations with bits missing. So I don't want to provide a magic wand that ignores resources but at the same time the player did provide the resources when the station was initially built.

Upside

Hopefully the rebuilt / repaired station would then have all the bits that its meant to :) This would save a fair amount of time and materials for the player as my current offering takes 20% of the resources and several hours per station to Recycle and then rebuild big stations.

Keeping the crew would leave the same station manager in charge which should minimise issues with subordinate ships.

Initial Work around

To get around the build API limitations its probably going to be necessary, at least for the first attempt, to insist that the station hull is at 100% and that it has the full complement of shields and weapons for that stage of build.

Anybody see any big holes in my logic or know of another mod or game command that already does this ?

Regards

jth

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

Post by Sparky Sparkycorp » Wed, 7. Oct 15, 15:10

I'm feeling a bit dumb, possibly as a result of beer last night...so apologies in advance for silly question!

Why would someone want to rebuild the same station at the same location?

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

Post by jth » Thu, 8. Oct 15, 12:30

Sparky Sparkycorp wrote:I'm feeling a bit dumb, possibly as a result of beer last night...so apologies in advance for silly question!

Why would someone want to rebuild the same station at the same location?
Because it doesn't work properly, won't expand, doesn't produce one of the wares, has bits missing like one of the docks, you unpack or detach the CV and then attach a new one and it rebuilds the first stage. :(

jth

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

Post by Sparky Sparkycorp » Thu, 8. Oct 15, 13:48

Ah, I see. Thanks for the explanation and nice idea :)

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

Post by jth » Thu, 12. Nov 15, 17:41

I am going to post something here from a Steam message from eMYNOCK (MadHwK) as its rather a long answer and the answer may be useful to other people running this mod
eMYNOCK (MadHwK) wrote:Heya jth,

i just found a full dock of Player owned People.. all of them Marked in the Savegame as "$RecycleSt_comms"

I know for fact that these ones are relics from Salvaged Stations.. but i really have no clue how they come on board of the Teladi Overwatch.

relating ew-tech... i assume he was talking about the ? Symbol over the Heads of his people.

Greetings, Regards and would be awesome if you could find out why these beggars pillage the TU Overwatch.
There should only be one "$RecycleSt_comms" on each station and they should be a Defence Officers.

They are dynamically added as you open communication (Comm button on zone menu or property owned menu) with one of your stations that does not have a Defence Officer. When you close comms then they should be removed. They are there to allow you to trigger this mod via their comms menu. I tagged them so that I could distinguish them from other mods that spawn NPC's.

If you look in the debug.log file then there are a couple of messages

If you already have a Defence Officer then you should get
Context:md.RecycleStation.RecycleSt_DummyNPC<inst:1abc1>: Defence Manager already exists on Foodstuffs Supply I

If you don't have one BUT have a manager and architect then there are two messages

The first is when you open Comms when it should say
[Scripts] *** Context:md.RecycleStation.RecycleSt_DummyNPC<inst:4b455>: Foodstuffs Supply I - Creating dummy Defence Manager Zuzuamis Ugalirias Lotunis VIII at Station Administration

You will get charged money for them

When you exit the conversation then you get a refund and the dummy Defence Oficer should be removed
[Scripts] *** Context:md.RecycleStation.RecycleSt_DummyNPC<inst:4c90b>: Foodstuffs Supply I - Removing dummy Defence Manager Zuzuamis Ugalirias Lotunis VIII

To write this post I have re-checked the logic and have just got a great big sinking feeling :(

Just tried it against Crystal castle station in DeVries


[Scripts] *** Context:md.RecycleStation.RecycleSt_DummyNPC<inst:6de4f>: RoC Crystal Castle - Creating dummy Defence Manager Warron Selek at Station Administration
[General] ======================================
[=ERROR=] Trying to set DefenceControlEntity of 'struct_bt_dv_home_station_macro', which already has one - skipping. (@CBJ)
[General] ======================================
[General] ======================================
[=ERROR=] Error in MD cue md.RecycleStation.RecycleSt_DummyNPC<inst:6de4f>: Property lookup failed: $fee
* Expression: ($fee)ct * 100ct
[General] ======================================
[General] ======================================
[=ERROR=] Error in MD cue md.RecycleStation.RecycleSt_DummyNPC<inst:6de4f>: Property lookup failed: $fee
* Expression: (-$fee)ct * 100ct

The code doesn't check that you actually own the station before creating the dummy Defence officer ........ Oops, very sorry about that :(

Well at least it didn't charge you :) and it doesn't seem to remove the excess Defence officers when you close the Comms :(

I will look into a fix that also cleans up the excess Defence Officers

jth

User avatar
eMYNOCK
Moderator (DevNet)
Moderator (DevNet)
Posts: 2061
Joined: Thu, 21. Aug 03, 10:37
x4

Post by eMYNOCK » Thu, 12. Nov 15, 18:32

No worry about any bugs that can happen... if i wasn't in Verdant Profit to get some Teladi Crew i've never noticed that the station was full of Player NPCs.

Anyway, thanks for looking into this and i hope you will find out soon how to fix it. :)


Regards
MynoCorp Technologies - We build it, you're stuck with it.

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

Post by jth » Mon, 16. Nov 15, 14:47

- [16.11.2015 - V0.11 Public Beta]
RecycleSt_DummyNPC Now checks that player owns station before adding a dummy Defence Officer to trigger mod via Comm menu
RecycleSt_DummyNPC Will now cleanup unknown dummy Defence officers from any station owner
RecycleSt_DummyNPC Got rid of fee for dummy Defence Officer - improved cleanup should deal with things
RecycleSt_DummyNPC_Clean added to provide search and cleanup for unknown dummy Defence officers from Tools - Repair Service menu
RecycleSt_Fns Clone Architect now also copies their name

Return to “X Rebirth - Scripts and Modding”