[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

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 ;)

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.

Post Reply

Return to “X Rebirth - Scripts and Modding”