[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

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

Post by Requiemfang » Sun, 12. Apr 15, 01:02

Bug I noticed when recycling a station and the new clone of the CV is up the high skilled defense officer working on the CV gets replaced by a low skill one. I don't know if this is a bug from this mod or caused by Human Resources. But I thought I'd report in on it.

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

Post by Vim Razz » Sun, 12. Apr 15, 03:25

This mod does destroy the old CV and all staff on it order to provide a new, clean CV -- which also has newly generated crew members.

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

Post by Requiemfang » Sun, 12. Apr 15, 03:27

That's very odd... because my engineer onboard remains being a 5 star engineer.

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

Post by jth » Sun, 12. Apr 15, 13:07

Well spotted. It might be a bug or a known issue - haven't decided yet.
Vim Razz wrote:This mod does destroy the old CV and all staff on it order to provide a new, clean CV -- which also has newly generated crew members.
Vim Razz is quite right it doesn't sync the skills, I wrote this before training was available. I was more concerned with making sure that you got a nice new working CV with functional crew.

If you got the same 5 star rating then you got lucky Requiemfang :)

I will try and decide how to handle this in the next release which I hope is going to make you provide the replacement CV via a small mission. There are quite a few ways to do it with differing amounts of coding.

If I can just persuade the mission to advertise itself ......

jth

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

Post by Requiemfang » Sun, 12. Apr 15, 18:15

I see, well at least you are trying to work at it. It's a PITA to have to waste all those credits to buy the high star workers to only loose them as well as loose the seminars you spent to train them, especially since seminars are hard to come by. Granted no so much with the mod that allows you to gain them by doing missions but still it's a pain the the arse.

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

Post by jth » Mon, 13. Apr 15, 13:37

Requiemfang wrote:I see, well at least you are trying to work at it. It's a PITA to have to waste all those credits to buy the high star workers to only loose them as well as loose the seminars you spent to train them, especially since seminars are hard to come by. Granted no so much with the mod that allows you to gain them by doing missions but still it's a pain the the arse.
Its probably less of a PITA for the building CV than trading ships. The skills of the captain are irrelevant as the building CV goes nowhere, then it depends upon whether the building CV gets attacked or not, if not then the engineer and defence don't do anything. The Architect will have some effect if you do some building otherwise not.

I tend to put my least capable crew on station building CV's and leave them there and a lot of the building CV's have no defense officer or engineer. Its cheaper that way.

I will still try and come up with a fair way of dealing with the skills of CV crew for the next release

jth

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

Post by jth » Fri, 15. May 15, 19:21

Version v0.06 posted 15 May 2015

- [15.5.2015 - V0.06 Public Beta]
Fixed issue with RecycleSt_CheckSafe_Cleanup where dropping off an NPC (manager etc) onto a player station after recycling another player station caused it to try to recycle the second station
Fixed issue with RecycleSt_CheckSafe to allow things to go a bit further if there is no building CV
If RecycleSt_Destroy is selected and there is no builder CV then just destroy the station
If RecycleSt_Destroy is selected don't provide a replacement CV and destroy the builder CV with explosion
If RecycleSt_Destroy is selected destroy all station modules simultaneously suppressing individual module destruction messages
If RecycleSt_Recycle is selected and there is no builder CV then pop up a message, refuse to go any further and reset the cue. It needs a builder CV attached to the station.
Allow station destruction or recycling even if its in the middle of being upgraded
Added Tools menu to provide information on state of mod and somewhere to put any tools
Added Reset option within Tools menu to allow main cue working state to be reset - greyed out if mod not actively destroying or recycling
Station storage modules are now destroyed with explosions
Added debug_text logging of station self destructed to give closure in debug log file
Tidied up formatting of small station messages
Tidied up messages about where NPC on recycling station are going. To cope with non existent second player or NPC stations
Removed un-used function DetachCV from RecycleSt_Fns as I can't get it to fully detach the CV so can't use it

Regards

jth

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

Post by jth » Fri, 12. Jun 15, 20:46

Version v0.07 posted 12 June 2015

- [12.6.2015 - V0.07 Public Beta]
Added "Recycle and sellwares" option to sell wares from builder CV instead of cloning it
Added "One of your ships has self-destructed" voice message for when CV is wrecked
Recycling stations using the cloned CV now charges you for the cloned CV
Fixed issue with RecycleSt_Fns causing error message in debug logs "ShipGenerator: <defence> node missing" and "ShipGenerator: <engineer> node missing"
Fixed issue with RecycleSt_Main causing error message in debug logs "Evaluated value 'md.RecycleStation.RecycleSt_Main' is not of type component"
Back buttons on menu now take you back a level instead of exiting the conversation completely
Given extra priority to event monitor messages about Wrecking modules to get them to line up better with the actual wrecking
Removed unused clone turret numbers code as it didn't work the way I wanted it to

Regards

jth

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

Post by jth » Fri, 12. Jun 15, 20:49

This release concentrates on the new Recycle and sell wares option.

What this does is to recycle the materials storing them in the original builder CV. It then allows you to buy the materials back from it for a limited time. The selling is done as a simple time limited mission.

This was not how I was intending to do it in December but it does fit in better with the encyclopedia. Its also a useful foundation to ejecting some of the storage wares

The beauty of this approach is that the crew are no longer cloned so the issue of skills is avoided.

The original idea of offering recycling as a mission, advertised in the same way as the combat or transport missions and setting the first part to buy a CV instead of using a cloned CV turned out to be a lot more difficult than anticipated although I haven't given up yet.

I am still trying to get the advertising to work properly, I can get the mission offer suitcase to appear but getting it to call someone and activate a mission is still work in progress

Ship delivery missions are also far more complicated than in previous versions ( the Egosoft GM_Buy_Ship.xml testing script is a bit of an eye opener). How its triggered requires an answer to the advertising.

I think that I may have to cover the Egosoft scripts in debug_text statements and invest in some caffeine ......

I think that I may still try and create a mini mission that replaces any missing builder CV and get it to advertise itself in the same way as the combat or transport missions provided that I can get past the two very large problems

Regards

jth
Last edited by jth on Fri, 12. Jun 15, 21:22, edited 3 times in total.

User avatar
alexalsp
Posts: 1839
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Fri, 12. Jun 15, 21:17

Are you planning multilingual support ?

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

Post by jth » Sat, 13. Jun 15, 11:46

alexalsp wrote:Are you planning multilingual support ?
It isn't currently on my todo list although I have done a few easy things

There is some support for multilingual in the game API but I have only used a couple of things so far.

The initial mod description in the starting menus is in 2 languages and I guess that Google translate could be used to add the rest of the languages that the game supports as a one off effort.

The self destruct messages are part of the multi lingual support that Egosoft have put in and they should be coming out in one of the supported languages. There is a very limited number of phrases in there although the files could be patched. Some of the phrases have audio and some don't. I think that adding or editing audio is beyond my resources.

This mod uses the event monitor a lot as a way of avoiding customising the phrases in the language support. I could probably improve the language support by removing some of the info screens. I could also try and simplify the words further to put as little language specific out as possible but that will take out the detail.

I would have to do some further digging to see if its possible to substitute a few keywords such as "wreck" into "wrack" (german) or "épave" (french) but I am no linguist and the results might be less understandable than English plus it would require rather a lot of multi lingual testing assistance :)

Regards

jth

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

Post by jth » Fri, 26. Jun 15, 15:01

Version v0.08 posted 26 June 2015

- [26.6.2015 - V0.08 Public Beta]
Added multi lingual support to most menus and patches for language files for French, Spanish, Italian and German
Rename "Recycle and sell Wares" to "Recycle + sell" to try and keep the length down
Add multi lingual support to most messages on event monitor adjusting messages to use words that have been translated by Egosoft
Tidied up event monitor messages and added titles where possible
Debug text remains mainly in English
Display description instead of macro name to add multi lingual support to Drones + Ammunition list on event monitor
Display description instead of macro name to add multi lingual support to Turrets + Shields list on event monitor
Display description instead of macro name to add multi lingual support to Recycle Wares list on event monitor
Fix issue with certain types of Drones not being added to cloned or builder CV cargo when game not in English
Fix issue with certain types of Turrets and Shields not being added to cloned or builder CV cargo when game not in English
Provide a default price for a cloned CV (v2.51 compatability where get_object_value not available)
Provide Diagnostics "Orders" for what to do if Recycle or Destroy buttons greyed out
Fix RecycleSt_SellWares_Cleanup now correctly displays "Mission aborted" on event monitor when triggered from RecycleSt_SellWares_Aborted

Regards

jth

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

Post by jth » Sun, 28. Jun 15, 15:48

alexalsp has created a Russian translation file for me called 0001-L007.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<language>
	<page id="360000" title="StationRecycle" descr="Texts for StationRecycle." voice="no">
	     <t id="1">Действия со Станцией</t>
         <t id="5">Разобрать</t>
         <t id="40">Инструменты</t>
         <t id="70">Диагностика</t>
         <t id="80">Сброс главного cue</t>
         <t id="320">Действия со Станцией</t>
         <t id="600">Подрыв всех модулей</t>
         <t id="730">Купить весь товар у {20101,4001} через меню торговли, при помощи ваших торговых кораблей.\n\n{1004,18} на {20101,101} {20208,701} и {20208,1501}. {20208,903} сам эвакуируется на </t> 
         <t id="760">. {20208,501} погибнет вместе с {20101,4001}\n\nПри отказе/провале миссии - вы потеряете товары и/или экипаж.</t>
         <t id="780">Вы получаете товары и экипаж.</t>
	</page>
</language>
If anyone is prepared to translate the following file for language codes 82 (Korean), 86 and 88 (Chinese simplified and traditional) I would appreciate it. Please ignore the \n's and whats inside the {} and just do the English words.

Otherwise I may just see what Google translate does to them ......... :)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<language>
	<page id="360000" title="StationRecycle" descr="Texts for StationRecycle." voice="no">
	     <t id="1">Destroy or Recycle Station</t>
         <t id="5">Recycle</t>
         <t id="40">Tools</t>
         <t id="70">Diagnostics</t>
         <t id="80">Reset main cue</t>
         <t id="320">Destroy or Recycle Backdoor</t>
         <t id="600">All modules are now self destructing</t>
         <t id="730">Offload builder {20101,4001} cargo into a suitable transport\n\n{1004,18} {20208,701} and {20208,1501} \(if present\) \n{20208,903} will evacuate herself to </t>
         <t id="760">\n{20208,501} goes down with {20101,4001}\n\nMission can be aborted - you will just loose un-collected wares or crew</t>
         <t id="780">The recycled wares and crew</t>
	</page>
</language>
If there is something particularly bad with the French, Spanish, Italian or German translations then please let me know.

Regards

jth

kelmenwong
Posts: 197
Joined: Sat, 17. Mar 12, 17:40
x3tc

Post by kelmenwong » Sun, 19. Jul 15, 02:01

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

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

Post by jth » Mon, 20. Jul 15, 15:09

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
Thanks for the suggestion, the station engineer mod looks very useful

I have a few niggling issues :) You still need the CV to extend any station, I am not sure how to re-attach a CV from within a vanilla game (does anyone know the sequence of game actions/commands?) and reusing the CV kind of goes against the encyclopaedia entry for CV's

Its possible to reuse the CV in two ways which is to genuinely reuse or simply to clone the CV and delete the original. If you do a good enough cloning job nobody notices. If you look closely then you will see that the current cloning changes the name, crew names, crew training and gets the wrong number of shields and turrets. I have got code from the ship recycle mod to fix the crew training but not the rest.

I could fairly easily provide the option to just blow up the CV .....

Genuinely reusing the CV is a bit of a pig to do :( If I remember correctly there are four things to do
jth wrote:1) Detach the CV from the build anchor to release that location

There is an API call to attach a CV to a build anchor but there isn't one to detach it.

2) Persuade the CV captain to take orders again

I have a feeling that I might have managed this a long time ago

3) Re-activate the Architect

I know how to do this

4) Reverse or complete the animation sequence for the CV to get the arms to go back in

The animation for a CV does seem to have a sequence that would retract the arms again but I don't know how to run it
To re-use the CV I need an answer to all four issues. Hand editing the save game obviously works but isn't an option ..... That's why I went down the cloning route.

To be truer to the encyclopaedia I started to look at the player providing their own CV in v0.08 which dodges the reuse issues :)

Sample code or pointers Wanted

If anyone has some sample code to drive one of the animation sequences or can point me to an Egosoft one then I would really appreciate it as I would like to use it in the ship recycle mod to un-build the ships. The animations seem to have a time stamp on them so it might be as simple as advancing to a certain time.

I seem to remember a few comments from Egosoft about re-attaching a missing CV to a station but can't find them. Does anyone know the sequence of actions and commands to do this ? If you can't then I was thinking about adding the option to the Utilities menu as there is an API call and without a CV a station can't currently be recycled

Regards

jth

kelmenwong
Posts: 197
Joined: Sat, 17. Mar 12, 17:40
x3tc

Post by kelmenwong » Mon, 20. Jul 15, 15:54

i think egosoft may have hardcoded something about the cv and architect

i ran into a problem with architect
i can't reuse architect to start new station, have to hire a new one
end up i move the old architect back to the cv, alone

imo, once the station is fully upgraded = all stages done + station wpn sys max, then a command to move the architect/other crews to stay on station, and then just destroy/remove the cv

at least the fully done station, will look like any other station, without the funny and useless cv sticking there

though i doubt the architect can reuse for new station, probably something hardcoded in game

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

Post by w.evans » Mon, 20. Jul 15, 18:16

kelmenwong wrote:i think egosoft may have hardcoded something about the cv and architect

i ran into a problem with architect
i can't reuse architect to start new station, have to hire a new one
end up i move the old architect back to the cv, alone

imo, once the station is fully upgraded = all stages done + station wpn sys max, then a command to move the architect/other crews to stay on station, and then just destroy/remove the cv

at least the fully done station, will look like any other station, without the funny and useless cv sticking there

though i doubt the architect can reuse for new station, probably something hardcoded in game
Not so much hardcoded, as much as Egosoft didn't anticipate anyone trying to reuse an architect and, since the ai scripts all apply on characters controlling things or parts of things in the game, the code that was active on the architect is still active when you move the architect somewhere else. A simple <abort_scripts/> set on the architect when it's moved away should clear it up, but haven't tried so couldn't say for sure.

@jth, sadly, my one and only experiment with animations blew up in my face and gave me a huge headache, so can't help you there. You're welcome to the station engineer code if you want, though. If I remember correctly, it's just two parameters changed.

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

Post by jth » Mon, 20. Jul 15, 22:44

kelmenwong wrote:i think egosoft may have hardcoded something about the cv and architect

i ran into a problem with architect
i can't reuse architect to start new station, have to hire a new one
end up i move the old architect back to the cv, alone

though i doubt the architect can reuse for new station, probably something hardcoded in game
give this a try for the architect

Code: Select all

              <!-- Activate the Builder ship Architect -->
              <signal_cue_instantly cue="md.NPC_Architect.Base" param="[$Architect, false, true]"/>
I found it in some Egosoft code where $Architect is the architect and I use it to activate the Architect in the cloned CV
kelmenwong wrote:imo, once the station is fully upgraded = all stages done + station wpn sys max, then a command to move the architect/other crews to stay on station, and then just destroy/remove the cv

at least the fully done station, will look like any other station, without the funny and useless cv sticking there
I thought that I saw something on one of the news groups around version 1 of X Rebirth that said that this was the case and it was also supposed to shift the engineer too but by the time I got a complete station it didn't do this any more. I do agree with you that tidying up the CV and its crew is the correct thing to do when the build is complete

I don't know if anyone else saw the post or maybe my memory is going :)

Regards

jth

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

Can't get it to work

Post by normntaz » Sat, 25. Jul 15, 17:56

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?

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Sat, 25. Jul 15, 18:15

Regarding Language support: if you call a t-file simply 0001.xml without any language indicated it will be used as non-specific language file in case no lang-specific file is present - so you can use the language support without having to translate into all available languages ;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Return to “X Rebirth - Scripts and Modding”