[help] Trying to add Container Storage to existing ship

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

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

TheLoneUmbreon
Posts: 2
Joined: Tue, 29. Aug 23, 17:12

[help] Trying to add Container Storage to existing ship

Post by TheLoneUmbreon » Tue, 29. Aug 23, 17:20

So I've got the X3 ATF-USC Ship Pack (https://www.nexusmods.com/x4foundations/mods/1076) and I've been using the Verdandi for some time now. I just now realized that I haven't been getting pillaged by SCA ships because I don't have any wares on board. So upon trying to pick something up, I realized that the ships has absolutely NO storage at all. How can I go about adding any amount of container storage to the ship so that I can put some wares on board? I can send the .xml or just post the scripting in here if needed.

sprIder
Posts: 95
Joined: Sat, 3. Jul 10, 23:23
x4

Re: [help] Trying to add Container Storage to existing ship

Post by sprIder » Tue, 29. Aug 23, 19:15

That's easy. You need an editor like Notepad, Notepad++ or Visual Studio Code.

1. Since the author already added a connection for a storage in the ship-file (atfusc_shippack_vanilla\assets\units\size_m\ship_atf_m_verdandi.xml) [line 647ff]

Code: Select all

<connection name="con_storage01" tags="storage ">
	<offset>
		<position x="0.2251749" y="4.995248" z="19.55051"/>
	</offset>
</connection>
you only need to add the following lines in the macro file (atfusc_shippack_vanilla\assets\units\size_m\macros\ship_atf_m_verdandi_macro.xml)

Code: Select all

			<connection ref="con_storage01">
				<macro ref="storage_ship_atf_m_verdandi_macro" connection="ShipConnection"/>
			</connection>
after

Code: Select all

...
			<connection ref="con_shipstorage_xs_01">
				<macro ref="shipstorage_gen_xs_01_macro" connection="object"/>
			</connection>
and before

Code: Select all

		</connections>
	</macro>
</macros>
2. Now you create in the "macros" folder a new file, named "storage_ship_atf_m_verdandi_macro.xml" which has the following content:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<macros>
	<macro name="storage_ship_atf_m_verdandi_macro" class="storage">
		<component ref="generic_storage"/>
		<properties>
			<identification makerrace="terran"/>
			<cargo max="360" tags="container"/>
			<hull integrated="1"/>
		</properties>
	</macro>
</macros>
This is your new storage. You can change the value of " <cargo max="360" ... " which represents the size of the storage.
You can change or add the "tags". Change it to e.g. tags="container solid" thus additional minerals could be transported.

3. Finally, you need to tell the game where to find the "storage_ship_atf_m_verdandi_macro"
Open the file \atfusc_shippack_vanilla\index\macros.xml.
E.g. after

Code: Select all

<entry name="dock_xs_hidden_macro" 							value="extensions\atfusc_shippack_vanilla\assets\props\surfaceelements\macros\dock_xs_hidden_macro"/>
you add a new entry / line for your new storage:

Code: Select all

<entry name="storage_ship_atf_m_verdandi_macro" 		value="extensions\atfusc_shippack_vanilla\assets\units\size_m\macros\storage_ship_atf_m_verdandi_macro"/>
That should be all.

I hope, everything works.
If something is unclear, or you need help, just ask.

Best regards
sprIder

TheLoneUmbreon
Posts: 2
Joined: Tue, 29. Aug 23, 17:12

Re: [help] Trying to add Container Storage to existing ship

Post by TheLoneUmbreon » Tue, 29. Aug 23, 20:18

Seems like everything worked well. I have the option to actually trade with this ship now, so that's a plus, but it still says it has no storage. I'm guessing I'll have to sell this one and make a new one for the change to go in effect. You are an absolute legend, and I could not have asked for better help. My appreciation is unmeasurable.

sprIder
Posts: 95
Joined: Sat, 3. Jul 10, 23:23
x4

Re: [help] Trying to add Container Storage to existing ship

Post by sprIder » Wed, 30. Aug 23, 18:39

I am glad that I could help you. You're very welcome.
Oh, the problem was also unknown to me, but I was able to recreate it. But unfortunately, I have no other solution than the one you have already suggested.
Have fun with it. :)

Return to “X4: Foundations - Scripts and Modding”