Mod for build storage transfer?

The place to discuss scripting and game modifications for X4: Foundations.

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

Post Reply
Drake
Posts: 40
Joined: Wed, 28. Nov 18, 14:16
x4

Mod for build storage transfer?

Post by Drake » Tue, 16. Aug 22, 17:43

Anyone aware of a mod that will auto transfer wares from a station to the build storage of that station (or even another you may own)? I was using variants of the Mule mod but kept running into issues. Any pointers would be greatly appreciated and I thank you in advance for your reply.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13293
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Mod for build storage transfer?

Post by euclid » Wed, 17. Aug 22, 01:05

Not sure there is a mod for that but if you want to give it a go coding it yourself then this sniplet

Code: Select all

<find_object name="$MyStations" space="player.galaxy" multiple="true"  class="class.buildstorage" owner="faction.player" /> 
<do_if value="@$MyStations">
   <do_all exact="$MyStations.count" counter="$i">
       <set_value name="$BuildModule" exact="$MyStations.{$i}.buildmodule"/>
       <set_value name="$BuildWares" exact="$BuildModule.buildprocessor.neededsequenceresources.list"/>
	    <do_all exact="$BuildWares.count" counter="$k">
	        <add_cargo object="$MyStations.{$i}" ware="$BuildWares.{$k}" exact="$BuildModule.buildprocessor.neededsequenceresources.{$BuildWares.{$k}}.count"/>
            </do_all>
   </do_all>
</do_if>
should be all you need to order your traders to deliver the wares required. ;-)

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Drake
Posts: 40
Joined: Wed, 28. Nov 18, 14:16
x4

Re: Mod for build storage transfer?

Post by Drake » Wed, 17. Aug 22, 02:57

euclid wrote:
Wed, 17. Aug 22, 01:05
Not sure there is a mod for that but if you want to give it a go coding it yourself then this sniplet

Code: Select all

<find_object name="$MyStations" space="player.galaxy" multiple="true"  class="class.buildstorage" owner="faction.player" /> 
<do_if value="@$MyStations">
   <do_all exact="$MyStations.count" counter="$i">
       <set_value name="$BuildModule" exact="$MyStations.{$i}.buildmodule"/>
       <set_value name="$BuildWares" exact="$BuildModule.buildprocessor.neededsequenceresources.list"/>
	    <do_all exact="$BuildWares.count" counter="$k">
	        <add_cargo object="$MyStations.{$i}" ware="$BuildWares.{$k}" exact="$BuildModule.buildprocessor.neededsequenceresources.{$BuildWares.{$k}}.count"/>
            </do_all>
   </do_all>
</do_if>
should be all you need to order your traders to deliver the wares required. ;-)

Cheers Euclid
Well no time to learn like the present, thank you sir! Much appreciated!

Post Reply

Return to “X4: Foundations - Scripts and Modding”