[MOD] Space Station Recycling v0.01

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

[MOD] Space Station Recycling v0.01

Post by jth » Sat, 25. Oct 14, 16:13

Hi

This turned out to be a rather larger project than anticipated so its taken a while

All of the nice to do bits are not 100% finished yet but I think the core of it is at a stage where it could be used so .....

I have just published version 0.01 on Nexus as Station Recycle or Destroy

www.nexusmods.com/xrebirth/mods/422/

Objective

To add a way to recycle or cleanly destroy player space stations that are

No longer needed
In 20:20 hindsight have been put up in the wrong place
Where the wrong type of station was built and the build location could be better used by something else
Didn't build properly the first time but are so far back in the save games that you can't face loosing all the work to get them out


This frees up the build location and provides a new Construction Vessel with the recycled materials as cargo and with a working Architect. You can then use it to rebuild the same or a different station on the same or a different spot. Alternatively you could just sell the wares.

How to Use

Fly to the zone that contains your station that you want to recycle or destroy
Open communications with your station manager
Pick the Destroy or Recycle Station menu option
Then pick either Destroy Station or Recycle Station
Sit back and watch the explosions and decide what to do with the recycled wares


Features

The cloned CV has the following in common with the original

Appears in the same place
The same number and type of crew (but not the same people)
The same number and type of drones
The same cargo

The Recycle Station option also provides

Recycles 80% of the build materials that went into the station. These wares are 'bioopticwiring', 'plasmapumps', 'fusionreactor', 'reinforcedmetalplating'
It also recycles enough 'energycells' to rebuild the first stage of the station that you are recycling
Recycles 100% of the operational shields and turrets that were on the station
Recycles 100% of the V Crusher missiles that were in the station ammunition storage
All recycled materials appear as cargo in the cloned CV
Relocates station crew via pod either to the Albion Skunk (if room) or to another player station or to the zones NPC station. Non player owned crew are directed to the NPC Station.

Regards

jth
Last edited by jth on Sun, 26. Oct 14, 13:18, edited 2 times in total.

User avatar
Litauen
Posts: 193
Joined: Fri, 22. Nov 13, 21:09
xr

Post by Litauen » Sat, 25. Oct 14, 16:53


User avatar
YorrickVander
Posts: 2708
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Sat, 25. Oct 14, 18:41

Nice idea :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

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

Post by jth » Sat, 25. Oct 14, 18:46

Thanks for digging that direct link out :)

I have just updated the long description on Nexus mods to be a bit more of a sales pitch and to say how to use the mod.

Regards

Jth

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Sat, 25. Oct 14, 19:26

Have two questions:
Is it possible to make opportunity to clean space from destroed npc station?
Example - i want that plutarch station get the F*CK out of my space. My fleet anihhilate it, but spot is still not empty.

Is it possible to let nps fix wrecked parts of station? Maybe even with trade operations of needed building stuff.

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

Post by Sparky Sparkycorp » Sat, 25. Oct 14, 23:57

Great idea, great post from DaveDee too :)

Thank you!

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Re: [MOD] Space Station Recycling v0.01

Post by Vim Razz » Sun, 26. Oct 14, 02:59

jth wrote:This turned out to be a rather larger project than anticipated so its taken a while
I warned you that this sounded like an ambitious project. :p Grats on getting it running!

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

Post by jth » Sun, 26. Oct 14, 11:56

I warned you that this sounded like an ambitious project.
Quite right too, its been a major learning experience.

I had been thinking about releasing something for several weeks but was quite happy coding and adding features. Then realised that time was flying along and I needed to produce something to prove that I was actually working on the problem.

jth

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

Post by jth » Sun, 26. Oct 14, 13:15

DaveDee wrote:Have two questions:
Is it possible to make opportunity to clean space from destroed npc station?
Example - i want that plutarch station get the F*CK out of my space. My fleet anihhilate it, but spot is still not empty.
Hi DaveDee

I will attempt to answer this based on my understanding of scripting blowing things up.

The destroy_object function has a single parameter called explosion which can be true or false

Code: Select all

<destroy_object object="$SR_CV" />
This blows up a Construction vessel without an explosion and it totally vanishes

Code: Select all

<destroy_object object="$SR_Module"  explosion="true" />      
This blows up a station module with an explosion and you get a wrecked module occupying the space. There is then an attribute called iswrecked which is true.

When you blow up an object with an explosion the object is still there it doesn't work any more and also looks different. If you look in save games its still there.

That is why my script goes through two stages blowing up the station, the first step gives a nice explosion and wrecks the modules and the final step destroys the station without an explosion which actualy empties the space. To rebuild you need an empty space.

That is the easy part of the answer which is that with a script you can totally destroy a station and leave no traces.

It then gets a bit more fun, by default the game scripts don't let you build on NPC build locations. Obviously if its your script then you can and I do build a dummy station on an NPC slot to get the recycling estimates. It is also possible to patch Egosofts scripts to allow building on NPC slots and I think that I have seen a mod to do that.

I have a feeling that the core of the Putarch Overwatch is not destroyable as several people have mentioned in other posts. So the only way to remove it would be a script or some save game editing. :(

From playing the game I assume that there are some Egosoft scripts that do wrecked ship cleanup from time to time or the place would be littered with wrecked ships. I don't know if they cleanup wrecked stations but I suspect that the Plutarch OverWatch is not 100% wrecked having set a few destroyers on it myself :)
DaveDee wrote:Have two questions:

Is it possible to let nps fix wrecked parts of station? Maybe even with trade operations of needed building stuff.
I did a few experiments a few months ago on version 2.20 although I don't guarantee the results as I may have missed the best way to do this

There are function calls to repair stations that can be called from scripts, if you look inside Egosoft's NPC_Architect.xml you can see them used. They do generate a list of required wares.

A wrecked station module does not appear to be repairable in terms of asking the Architect to repair it. It shows up as not built, so it may be possible to re-build rather than repair it.

There is a restore_object function call to unwreck objects and I have played with it for a few hours and I think that it returns production modules to the Architects list and then you could goto the whole station repair and hopefully that would do it. I haven't actually told it to restore_object a whole station.

Unwrecking a single station module did seem possible with version 2.20 but one thing has changed with version 2.50 and that has to do with the modules and how it counts them. In 2.20 if you wrecked a module then it still existed in the wrecked state and you could restore_object it or destroy it without explosion. In 2.50 when you destroy a module the module count now reduces so you can't access the wrecked module. I only found this out a few weeks ago and haven't had time to see if there is a work around.

At the moment I am NOT claiming this one as a project although I do admit to looking at the Canteran stations and thinking they do need repairing and it might make a nice mission.

Regards

jth

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Sun, 26. Oct 14, 13:36

Woah!

Thanks for suсh detailed response.
Think something may change with 3.0, but for now, i totally dont see global goal for Ren. The worlds most "dangerous" AI cant even build stations, giving us some challenge in Maelstorm. War with factions has no benefits. Your enemy doesn't even going to attack your stations.

So, basically, giving NPC the ability to repair stations and player - siege and capture NPC station would give a little more targets for developing.

swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti » Sun, 26. Oct 14, 14:53

Great mod, just what i needed!

EDIT: nexus doesnt seem to work atm, can you put this on steam workshop too?

Archaeosis
Posts: 328
Joined: Sat, 3. May 14, 12:36
x4

Post by Archaeosis » Tue, 28. Oct 14, 16:04

Amazing work implementing a vital yet absent feature, sounds like it's needed quite a bit of effort on your part - thanks very much. Perhaps sometime Egosoft will make something of their own, or incorporate this, but this'll do very nicely for now as it stands. If you ever have time to put this on the workshop I'm sure it'd be appreciated there too. I never really thought anyone would manage to implement a proper system like this, very nicely done.

Thanks again. :thumb_up:

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

Post by jth » Tue, 28. Oct 14, 17:51

swatti wrote:Great mod, just what i needed!

EDIT: nexus doesnt seem to work atm, can you put this on steam workshop too?
I will do some investigation and see if I can get my head round the mechanics of the steam workshop. No promises yet ....

jth

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Tue, 28. Oct 14, 18:40

The X Rebirth Tools Sticky at the top of this forum has a link to the Steam Workshop for X Rebirth guide, where it is explained how you can upload mods to the Workshop.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

User avatar
wysiwyg
Posts: 585
Joined: Thu, 26. Feb 04, 00:08
x4

Post by wysiwyg » Tue, 28. Oct 14, 20:03

It's a doddle! and when the mod is uploaded it will only be visible to you so you can test it before changing its visibility to either friends only or public when you are happy it's working. I was really nervous about publishing a mod there until I realised it was private until you set it otherwise :) The actual mechanic of putting the mod there form your hard drive is very straightforward! Great mod - good luck with progress.

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

Post by jth » Tue, 28. Oct 14, 21:00

Thanks for the replies about how to get the mod onto steam

It should be up there now publicly visible

Its at the bottom of page 3

Also thanks for the feedback saying that you like it

Now all I have to do is finish off the bells and whistles :)

Enjoy

jth

swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti » Sun, 2. Nov 14, 19:10

Something is off, i used this once, worked fine, now the converstation options no longer appear... ?

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

Post by jth » Tue, 4. Nov 14, 19:33

swatti wrote:Something is off, i used this once, worked fine, now the converstation options no longer appear... ?
Sorry about that I had a feeling that the triggering bit isn't as good as it could be. I will try and spend some time on it tomorrow and see if I can do something about it or come up with a work around.

Regards

jth

User avatar
NZ-Wanderer
Posts: 1623
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer » Tue, 4. Nov 14, 20:56

Great mod, thank you :)
Just one little query if I may, I recycled one of my stations, but now I have 3 ship dealers camped out in the back of my skunk with no way to get rid of them.. Any ideas??
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth

NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Tue, 4. Nov 14, 21:31

...It was a shipyard, right?

Just making sure.... :wink:
Irrational factors are clearly at work.

Post Reply

Return to “X Rebirth - Scripts and Modding”