[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: 295
Joined: Wed, 4. Jan 06, 00:31

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

Post by jth » Tue, 11. Nov 14, 20:49

16 November 2015

I have just uploaded version 0.11 to the Nexus mod site, Steam version updated.

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

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.

This is a maintenance release that fixes the cause of the Unknown Defence Officers. It also improves the cleanup routine which should delete them all from a station as you finish Comm with that station

It also provides an option to search for them all and delete them from the Tools - Repair Service menu - Unknown Defence Officer The unknown Defence Officers are listed to the debug.log and the summary of the cleanup is posted to the player log under Upkeep

So you have two options

1) Fly around as normal and let the improved cleanup deal with it one station at a time without you doing anything

2) Count and clean them all up in one go via the new Tools option

If you get some seriously large numbers ( 3 figures +) then please post them for my info :)

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 releases the original Construction Vessel (Recycle) or sells the wares from the builder CV (Recycle + sell).

You can then use the released CV (with the recycled materials as cargo and with a working Architect) 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. This can be done from the Comm button in the Zone map or Property Owned. Then select the Defence Manager
Or
Land on one of your builder (attached to a station) Construction Vessels
Pick the Destroy or Recycle Backdoor

Then
Pick the Destroy or Recycle Station menu option

Then pick either Destroy Station or Recycle Station or Recycle + sell
Confirm your action
NEW - Construction Vessel is now released from the station and is no longer destroyed, so it can be reused.
Sit back and watch the explosions and decide what to do with the recycled wares [optional]
or
Pick the Release Construction Vessel which will detach the CV from your station and let you use it elsewhere

or
Pick the Tools menu
Diagnostics to provide orders on how to resolve "Destroy or Recycle Station" options being greyed out
Transfer Engineer to station to transfer the engineer from the attached Construction Vessel to the station.
Repair Service provides fixes or cleanups for this mod - now includes Unknown Defence Officer which will remove unknown Defence Officers from all stations
Reset main cue to clear the working flag (if ordered to)

Known issues
From v0.09 the Defense Manager now has the "Recycle or Destroy station" menu instead of the Trade Manager. This gets out of the way of the Trading and Manager scripts and improves the chances of getting to the "Recycle or Destroy station" menu.

The dummy Defense Manager is there to allow you to get at the "Destroy or Recycle Station" menu. You will be charged the max price which is refunded as it is destroyed. It should be deleted as you close the "Zone map" or "Property Owned" menus.
There are still some informational messages in the code
Will not recycle a station that has no building CV but it will destroy it. Egosoft provide an option to attach a new CV to an existing station. Once this is done you will be able to recycle the station.
Releasing the CV keeps the existing CV and all of its crew except the Architect which is cloned with the same skills as the original

Known issues specific to Recycle and sell Wares
The ware selling mission doesn't currently update any status info.
Recycling a moderate size station with defense drones and missiles will produce 14 wares which means that it will take 25 minutes plus and some work on your part to load it into another CV
You have to be in the same zone as the station to recycle it, you need to stay there until the selling mission starts then you can leave.
If you are using another CV to offload the wares into then I suggest that you leave the zone when the selling mission starts to speed things up as CV's loading cargo don't seem to like being watched.

ToDo
A proportion of the wares stored inside the station should be ejected into space for salvage - medium
Improve the "Recycle + sell" mission - low

Release history
- [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
Last edited by jth on Thu, 3. Mar 16, 15:44, edited 34 times in total.

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

Post by NZ-Wanderer » Fri, 14. Nov 14, 22:40

Possible bug:
Not sure if this is a conflict or not, but when one of my ships reports to me about having a profit and it going to transfer the credits to me (YAT mod) all of a sudden I get the "Destroy or Recycle Station menu option" come up on screen.. - Never had it before, so I am not sure if it is this update or the fact that Beta 3 is out that is causing it.

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Sat, 15. Nov 14, 20:13

NZ-Wanderer wrote:Possible bug:
Not sure if this is a conflict or not, but when one of my ships reports to me about having a profit and it going to transfer the credits to me (YAT mod) all of a sudden I get the "Destroy or Recycle Station menu option" come up on screen.. - Never had it before, so I am not sure if it is this update or the fact that Beta 3 is out that is causing it.
Thanks for reporting this

It might well be a bug. I had a few of those pop up when station managers transferred excess funds back to the player while developing v0.02 they caused the top level Recycle\Destroy menu to appear.

If your ships are also doing a lot of reporting then that would tend to multiply up the problem.

If I remember correctly then it was one of the reasons that I added a condition to the triggering of v0.02 to only butt into conversations of managers that were in the same zone as the player. That eliminated it for out of zone managers which got rid of most of it.

Are the ships in the same zone as the player when they report back ?

jth

Vim Razz
Posts: 1797
Joined: Tue, 2. Nov 10, 03:20

Post by Vim Razz » Sat, 15. Nov 14, 20:48

jth wrote:If I remember correctly then it was one of the reasons that I added a condition to the triggering of v0.02 to only butt into conversations of managers that were in the same zone as the player. That eliminated it for out of zone managers which got rid of most of it.
That makes sense -- though, thinking about it, we both totally forgot to specify that it should only trigger for the particular NPC that we've initiated conversation with when we were talking about this earlier...

like with: <event_conversation_started actor="event.object" />

It might be something worth trying, at any rate.


@NZ - did you ever get the shiptraders off your ship? I was never able to find anything that might have caused the little button thing I made to not work, so that's still got me baffled.

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

Post by NZ-Wanderer » Sat, 15. Nov 14, 23:26

jth wrote:Are the ships in the same zone as the player when they report back ?jth
Nope, they are elsewhere in the galaxy :)
Vim Razz wrote:@NZ - did you ever get the shiptraders off your ship? I was never able to find anything that might have caused the little button thing I made to not work, so that's still got me baffled.
Oopps, sorry, I completly forgot to check on them, I been too busy testing things and updating my list of working mods.. - Will try to remember to check that out once I start playing properly again (testing is just no saves and closing down)

Vim Razz
Posts: 1797
Joined: Tue, 2. Nov 10, 03:20

Post by Vim Razz » Sat, 15. Nov 14, 23:39

@NZ -
np -- that was just meant a quick-and-dirty fix to try and avoid the slog of manual save editing, not as a permanent mod or anything. I was just curious.

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

Post by NZ-Wanderer » Sun, 16. Nov 14, 00:18

well it looks like I cannot find out for sure at the moment, something has broken my game :(
I can get to the menu but shortly after I start loading my last save (which worked yesterday) I get an instant CTD..

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Sun, 16. Nov 14, 14:22

Vim Razz wrote:
jth wrote:If I remember correctly then it was one of the reasons that I added a condition to the triggering of v0.02 to only butt into conversations of managers that were in the same zone as the player. That eliminated it for out of zone managers which got rid of most of it.
That makes sense -- though, thinking about it, we both totally forgot to specify that it should only trigger for the particular NPC that we've initiated conversation with when we were talking about this earlier...

like with: <event_conversation_started actor="event.object" />

It might be something worth trying, at any rate.

Code: Select all

    <cue name="RecycleSt" instantiate="true" >
      <conditions>
	    <check_any>
          <event_conversation_started actor="event.object"/>
	    </check_any>
        <check_value value="event.object.type" exact="entitytype.manager" />
        <check_value value="event.object.owner" exact="faction.player" />
        <check_value value="event.object.container.class" exact="class.station"/>
      </conditions>
    ...
    </cue>
Doesn't pop up at all :( did I put it in the right place ?

In v0.02 I was looking for a solution that would just trigger for conversations that the player initiated but the start_conversation parameters didn't provide anything obvious so I fudged it with event.object.zone == player.zone. I also felt that if I was going to the trouble of exploding the station then the player should be around to watch. I probably should have mentioned this when I explained how it all works.

If you can come up with a condition that does only trigger for the particular NPC that we've initiated conversation with then I would certainly like to use it.

Alternatively how about rotating the conditions a bit

At the moment we have

Code: Select all

    <cue name="RecycleSt" instantiate="true" >
      <conditions>
	    <check_any>
          <event_conversation_started />
	    </check_any>
        <check_value value="event.object.type" exact="entitytype.manager" />
        <check_value value="event.object.owner" exact="faction.player" />
        <check_value value="event.object.container.class" exact="class.station"/>
      </conditions>
     ...
    </cue>

     <cue name="RecycleSt_Menu" instantiate="true"  >

                                    selectable="event.object.zone == player.zone and @RecycleSt_Main.$working != 1" />
If we swopped the second condition and the first part of the selectability condition

Code: Select all

    <cue name="RecycleSt" instantiate="true" >
      <conditions>
	    <check_any>
          <event_conversation_started />
	    </check_any>
        <check_value value="event.object.type" exact="entitytype.manager" />
        <check_value value="event.object.zone" exact="player.zone" />
        <check_value value="event.object.container.class" exact="class.station"/>
      </conditions>
    ...
    </cue>

     <cue name="RecycleSt_Menu" instantiate="true"  >

                                    selectable="event.object.owner == faction.player and @RecycleSt_Main.$working != 1" />
That repeats the fudge from v0.02 and gets the player.zone condition into play to reject all out of zone conversations and does the selectability with owner == player

The instantiate="true" is still there and I think that that does most of the work in making the menu option appear reliably.

The fourth condition prevents it from popping up if there is a manager travelling in the Skunk.

What do you think ?

EDIT

I did miss the implication of moving the player.zone condition when implementing the code from Vimm Razz

Vim Razz
Posts: 1797
Joined: Tue, 2. Nov 10, 03:20

Post by Vim Razz » Sun, 16. Nov 14, 19:38

jth wrote:Doesn't pop up at all :( did I put it in the right place ?
You are correct, I screwed it up. Sorry about that. I should have tried it in game before posting. I also screwed up the section return condition last week, which makes sense why you didn't use it.

An iscontrolentity check is something worth considering that would catch the whole employees-waiting-around-for-you-as-passengers-somewhere possibility that you, I, and various others have threatened to mod in at some point.

Give this a shot, and see what you think:

Code: Select all

    <cue name="RecycleSt" instantiate="true" >
      <conditions>
        <check_any>
          <event_conversation_started conversation="default" />
          <event_conversation_returned_to_section section="default" />
        </check_any>
        <check_value value="event.object.type" exact="entitytype.manager" />
        <check_value value="event.object.owner" exact="faction.player" />
        <check_value value="event.object.container.class" exact="class.station" />
        <check_value value="event.object.iscontrolentity" />
      </conditions>
      <actions>
        <add_player_choice_sub text="'Destroy or Recycle Station'"
                               section="st_main" />
      </actions>
	</cue>
And a little thing when you get around to updating next time: starting a new thread for every version number makes things a little confusing to keep track of.... ^.^;; (at least for me...)

EDIT: changed defencecontrol to manager -- I'd forgotten to check that when I copied it in.

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Sun, 16. Nov 14, 22:11

Version v0.04 posted 16 Nov 2014

- [16.11.2014 - V0.04 Public Beta]
Only pop up Recycle or Destroy menu when conversation is default (player comms manager)
Also pops up for conversation section return
thanks for fixing the above to Vimm Razz
Fix lost "one of your stations .." message
No longer transports entitytype.smallshiptrader to Skunk as they cannot be fired
Changed ownership of dummy CV used for estimates to Canteran to remove unwanted CV destruction messages from player log

Hopefully this will help with the messages from player ships. The standard communications when the player calls the manager use a conversation of "default" when the station reports excess funds it uses "speak". I hope that the communications from the ships use something other than "default", if not I may have to introduce player.zone as a condition after all.

Regards

jth

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Sat, 20. Dec 14, 18:39

Version v0.05 posted 20 Dec 2014

- [20.12.2014 - V0.05 Public Beta]
Added debug_text logging of information messages plus some extra info
Added Are you sure? menu options before station is destroyed or recycled
Added back door access to top level Destroy or Recycle Station menu option menu that does not use a
control entity comms slot, works by adding conversation with Betty when you land on your target station's builder CV
Added checks to see if you are going to blow yourself up by being on the CV or station that is being
recycled or destroyed. Triggers new mini mission that gives you 60 seconds to vacate the CV or station.

Hopefully this will allow everyone to use this mod even if there are no spare manager comms slots and not blow themselves up so often :)

Regards

jth

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

Post by DaveDee » Wed, 24. Dec 14, 11:58

Thx for mod.
I was forced to use it after getting stuck with plot station. It helped a lot, saving me from starting game again. I decided to leave it, cause you have made really nice job with directing things like they should be from the begining. (except final 'Boom', it was a little 'meh', but think it's just engine limitation)

There was a little weird moment for me.
So about several hours later i got another message about self destruction process from unknow station, Every string was 'null', and that was'nt station in my current sector (Even Temper, as i remember). My own station were save to.

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

Post by Archaeosis » Fri, 26. Dec 14, 19:20

This really is very handy, used it to relocate a few stations today. Thanks very much for your work.

Just by-the-by, do you know what happens if you remove your last station in one of the new empty-space zones - will the empty-space zone disappear again?

jth
Posts: 295
Joined: Wed, 4. Jan 06, 00:31

Post by jth » Fri, 26. Dec 14, 23:41

DaveDee wrote:There was a little weird moment for me.
So about several hours later i got another message about self destruction process from unknow station, Every string was 'null', and that was'nt station in my current sector (Even Temper, as i remember). My own station were save to.
There is a section in the Readme.txt called Diagnosing issues which might shed some light but you would need to be running in debug mode at the time to get a debug.log file, that's a bit chicken and egg :) but if you were then that might establish if it was this mod that was doing something at the time or if something else is self destructing stations ....

This mod does create and destroy stations in other zones to get the ware estimate but it should only do it during the recycling of one of your stations and it does log it in debug.log (if you are creating one).

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

Post by NZ-Wanderer » Sat, 27. Dec 14, 03:50

Any chance you could let me recycle/destroy a station that is building another part?
I got a station that is stuck at 25% building the second part, but your mod will not let be recycle or destroy it cause it building..

Post Reply

Return to “X Rebirth - Scripts and Modding”