Repack construction vessel
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Repack construction vessel
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?
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?
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.
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
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

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

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
.
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

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.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'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.
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
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

I specified the CV build module. It is something like this:UniTrader wrote:where did you use the <clear_buildmodule/> on? (what did you specify as buildmodule?) was it the Construction Ship?
<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.
hmm, what about this:
?
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..
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
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

hmm, what about this:
?
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..
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
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

This looks promising. I'll try it as soon as I get home and I'll let you know how it goes.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..
I would have to disagree with thatmihaib wrote:I just tested that mod and they have the same issue.

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