Repack construction vessel

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Repack construction vessel

Post by mihaib » Sat, 5. Sep 15, 16:30

I've been working on a mod to repack the construction vessel, but I have a problem. I modified the architect script to allow players to repack the construction vessel when not building. I have been using the "clear_buildmodule" and "disconnect_from_build_location" functions to achieve this, and it works, mostly.

The problem is that the ship build module is full of build plans by now and the "clear_buildmodule" function won't really clear this queue. This can be seen in a save file just bellow the <component class="buildmodule" ...> line. As a side effect, the construction vessel won't work correctly when deployed to a built station and it will build automatically without you being able to decide what modules and in what order if you use it to build a new station.

I already spent a few days on this problem trying to access various properties, but I can't find any way to clear this build queue.

Does any one know how can you really clear the CV build module? Can it be cleared? Is there any property that gives you access to this queue to clear it?

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Sat, 5. Sep 15, 16:37

jth recently added that functionality to the Space Station Recycling mod. Haven't taken a look at the new code, but you could take a look at how it's done with that mod.

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

Post by UniTrader » Sat, 5. Sep 15, 17:46

IIRC <disconnect_from_build_location/>
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 ;)

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Post by mihaib » Sat, 5. Sep 15, 19:13

I just tested that mod and they have the same issue :(.

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Post by mihaib » Sat, 5. Sep 15, 19:17

I already call <disconnect_from_build_location>, right after <clear_buildmodule>.

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

Post by UniTrader » Sat, 5. Sep 15, 19:24

ah, sorry - didnt read your post properly cause i anserwed from the phone first... i think the keyword you have to search for is
buildplan
which you can find in both the scriptproperties.html and in the aiscript/md/common xsd files
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 ;)

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Post by mihaib » Sat, 5. Sep 15, 21:16

Unfortunately I found nothing valuable related to the buildplan neither in common.xsd or scriptproperties. I've been trying and searching for three days now and it seems you can only add build plans to a build module <add_build_plan> but you can't clear or reset the list. Also, I found no property in scriptproperties that allows you to access the current build plan list for the buildmodule or any of it's parent types.

The only way I managed to get rid of that queue was to use <destroy_object> on the build module, but I found no way to create the build module back, so the CV is useless after that.

I'm thinking that repacking CVs just isn't supported, but maybe someone has a good idea for a workaround, other than cloning the ship and destroying the original :).

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Sun, 6. Sep 15, 18:56

Hi mate,

An idea can be force the buildplan clean by put on it a empt buildplan after clear_buildmodule" and "disconnect_from_build_location . Try it and let we know!

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Post by mihaib » Sun, 6. Sep 15, 20:36

Rubini wrote:Hi mate,

An idea can be force the buildplan clean by put on it a empt buildplan after clear_buildmodule" and "disconnect_from_build_location . Try it and let we know!
I just tried that, and it doesn't work. I also tried calling <clear_buildmodule> again after adding the new build plan, but there is no change.

I'm thinking this is the same behavior when you create a new station using the repacked CV. The new station macro is used, but with the old build plan from the previous station.

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

Post by UniTrader » Sun, 6. Sep 15, 20:42

where did you use the <clear_buildmodule/> on? (what did you specify as buildmodule?) was it the Construction Ship?
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 ;)

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Post by mihaib » Mon, 7. Sep 15, 10:14

UniTrader wrote:where did you use the <clear_buildmodule/> on? (what did you specify as buildmodule?) was it the Construction Ship?
I specified the CV build module. It is something like this:
<clear_buildmodule buildmodule="$actor.container.buildmodule" />

This script is patched to the NPC_Architect.xml file where that variable makes sense. They also use it in the file to get the build module.

Also, I am certain it has some effect, because if I don't call <clear_buildmodule> the CV is not released from the station.

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

Post by UniTrader » Mon, 7. Sep 15, 10:55

hmm, what about this:

Code: Select all

<destroy_object object="$actor.container.buildmodule" explosion="false"/>
<patch_object object="$actor.container"/>
?

note that it may be necesary to re-assign the Architect when using this because he may still try to use the (cached) old build module


also it may be worth a try to use .buildingmodule instead of .buildmodule - the former seems to be used for stations, the latter for ships..
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 ;)

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

Post by UniTrader » Mon, 7. Sep 15, 10:57

hmm, what about this:

Code: Select all

<destroy_object object="$actor.container.buildmodule" explosion="false"/>
<patch_object object="$actor.container"/>
?

note that it may be necesary to re-assign the Architect when using this because he may still try to use the (cached) old build module


also it may be worth a try to use .buildingmodule instead of .buildmodule - the former seems to be used for stations, the latter for ships..
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 ;)

mihaib
Posts: 36
Joined: Sat, 5. Sep 15, 12:36

Post by mihaib » Mon, 7. Sep 15, 12:04

UniTrader wrote:hmm, what about this:

Code: Select all

<destroy_object object="$actor.container.buildmodule" explosion="false"/>
<patch_object object="$actor.container"/>
?

note that it may be necesary to re-assign the Architect when using this because he may still try to use the (cached) old build module


also it may be worth a try to use .buildingmodule instead of .buildmodule - the former seems to be used for stations, the latter for ships..
This looks promising. I'll try it as soon as I get home and I'll let you know how it goes.

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

Post by jth » Mon, 7. Sep 15, 13:42

mihaib wrote:I just tested that mod and they have the same issue :(.
I would have to disagree with that :( as my released CV's do build from scratch successfully in all my tests destroying stations, recycling stations or just detaching the CV. The build locations are also releasing properly.

The buildplan does appear to belong to the buildmodule inside the CV which makes it stick to the CV and not the architect

I managed to get the whole thing to work by doing a combination of things

The first was to to clear the CV's buildmodule before destroying the station and before attempting to detach the CV. That seemed to help a lot athough you might have to wait a bit too. Without doing that the CV was indeed unusable whatever I did to the architect. It took me a couple of days trial and error to find that out.

I was hoping that the architect would work at that point but it did not. They run their own copy of the NPC_Architect script and in there are some variables that probably need to be reset for an existing architect to start a new station. The only way that I could do that without patching the NPC_Architect script was to clone the architect.

If you blow the build module then I don't think you will be building any stations with that CV.

jth

Post Reply

Return to “X Rebirth - Scripts and Modding”