How can you define different loadouts than default?

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

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

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

How can you define different loadouts than default?

Post by Max Bain »

Hi,

I found out, that you can define default loadouts in the ship macro file. For example like this:

Code: Select all

	  <loadouts>
		<loadout id="default">
			<groups>
			  <turrets macro="turret_arg_m_laser_01_mk1_macro" path=".." group="front-left-up" exact="3"  />
			  <shields macro="shield_arg_m_standard_02_mk2_macro" path=".." group="front-left-up" exact="1"  />
			  <turrets macro="turret_arg_m_laser_01_mk1_macro" path=".." group="front-right-up" exact="3"  />
			  <shields macro="shield_arg_m_standard_02_mk2_macro" path=".." group="front-right-up" exact="3"  />
			  
			  <turrets macro="turret_arg_m_laser_01_mk1_macro" path=".." group="front-left-down" exact="3"  />
			  <shields macro="shield_arg_m_standard_02_mk2_macro" path=".." group="front-left-down" exact="1"  />
			  <turrets macro="turret_arg_m_laser_01_mk1_macro" path=".." group="front-right-down" exact="3"  />
			  <shields macro="shield_arg_m_standard_02_mk2_macro" path=".." group="front-right-down" exact="1"  />
			  
			  <turrets macro="turret_arg_l_laser_01_mk1_macro" path=".." group="front-back-large" exact="1"  />
			  
			  <turrets macro="turret_arg_l_plasma_01_mk1_macro" path=".." group="bottom-back" exact="2"  />
			  
			  <turrets macro="turret_arg_m_plasma_01_mk1_macro" path=".." group="top" exact="4"  />
			  <shields macro="shield_arg_m_standard_02_mk2_macro" path=".." group="top" exact="2"  />
			  
			  <turrets macro="turret_arg_m_plasma_01_mk1_macro" path=".." group="bottom" exact="4"  />
			  <shields macro="shield_arg_m_standard_02_mk2_macro" path=".." group="bottom" exact="2"  />
			  	 
			</groups>
			<ammunition>
				<ammunition macro="countermeasure_flares_01_macro" min="40" max="60" optional="1" />
			  </ammunition>
			<virtualmacros>
				<thruster macro="thruster_gen_xl_allround_01_mk3_macro" />
			</virtualmacros>
		</loadout> 
      </loadouts>
But when I change the id to something else than default, it does not work. How can I change that? For example I want to change the minimum oder maximum loadouts for a ship. Is that possible?
What values are valid for the "id"?

Thank you!
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: How can you define different loadouts than default?

Post by Shuulo »

As far as I know the loadout section in macro file for ship is used only when specific loadout should be used(like for xenon and khaak ships), it has no connection to high-low loadout that you select in shipyard.
Shipyard loadout is calculated automaticaly based on value of ship and it's components, this is the reason why new weapons are used by ships without any additional manual instructions. I believe Ware price plays a role in this
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: How can you define different loadouts than default?

Post by Max Bain »

Shuulo wrote: Wed, 6. Nov 19, 12:22 As far as I know the loadout section in macro file for ship is used only when specific loadout should be used(like for xenon and khaak ships), it has no connection to high-low loadout that you select in shipyard.
Shipyard loadout is calculated automaticaly based on value of ship and it's components, this is the reason why new weapons are used by ships without any additional manual instructions. I believe Ware price plays a role in this
It must have an effect on the loadouts you can select in the ship build menu. Because I added just some turrets and forgot the shields and engines and then in the ship menu when I selected any loadout, the shields and engines were not filled with modules. But the default loadout in the macro influenced all loadouts you could select, hence no loadout had engines or shields now.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: How can you define different loadouts than default?

Post by Shuulo »

Then we can assume that it is used as "default" on which other loadouts are based. Though it's totally unclear if you can define any other loadout rather than default one directly in macro. There is no such thing in vanilla, so it may not be programmed with other loadouts in mind.
Would be cool if you prove me wrong though :)
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: How can you define different loadouts than default?

Post by teleportationwars »

loadouts.xml will let you define more loadouts and md includes a methods to add and manipulate loadouts on ships. I assume you can define a loadout there are call it on the macro.

Return to “X4: Foundations - Scripts and Modding”