Ship editing question from a beginner

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

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

Post Reply
BigGreenThugs
Posts: 8
Joined: Thu, 26. Mar 20, 17:50
x4

Ship editing question from a beginner

Post by BigGreenThugs » Wed, 16. Sep 20, 03:52

I posted this question in the Tutorial for XML patching (viewtopic.php?t=354310) and after a week of no response I thought I would post here.
First thing is I'm not real modder. I have successfully edited a few mods but my understanding of how is very limited. The folks that make these mods are doing the heavy lifting.

The first question is How do I turn this: (from ship_arg_s_trans_container_02.xml)

Code: Select all

<components>
	<component>
		<connections>
			<connection name="con_weapon_005" tags="weapon small standard missile platformcollision symmetry symmetry_right symmetry_top ">
				<offset>
					<position x="2.485125" y="2.050091" z="4.118674"/>
				</offset>
			</connection>
		</connections>
	</component>
</components>	
into:

Code: Select all

<components>
	<component>
		<connections>
			<connection name="con_weapon_005" tags="weapon small standard mining missile platformcollision symmetry symmetry_right symmetry_top ">
				<offset>
					<position x="2.485125" y="2.050091" z="4.118674"/>
				</offset>
			</connection>
		</connections>
	</component>
</components>	
?
What I want is the Callisto to be able to mount a mining laser for more early game money via crystal mining. With crystals being rarer, my thought was, while looking for crystals, (which I'll shoot off with a pulse laser) I could also pulverize the rocks looking for spacefly eggs, lodestones, and unstable crystals. This can be done with the Theseus but the Callisto is much more readily available and cheaper.

Second question is will changing that connection tag by adding the word mining to the list make the mining laser mountable in one of the small weapon slots?

Thanks in advance for reading and any help.

linolafett
EGOSOFT
EGOSOFT
Posts: 2689
Joined: Mon, 26. Mar 12, 14:57
x4

Re: Ship editing question from a beginner

Post by linolafett » Wed, 16. Sep 20, 10:33

I cant say anything about the XML patching, but adding the tag "mining" will make that weapon slot indeed compatible with the mining weapon.
01000100 01101111 00100000 01110011 01110000 01101100 01101001 01110100 00100000 01100101 01100001 01110100 00100000 01100011 01101111 01101111 01101011 01101001 01100101 01110011 00111111

My art stuff

BigGreenThugs
Posts: 8
Joined: Thu, 26. Mar 20, 17:50
x4

Re: Ship editing question from a beginner

Post by BigGreenThugs » Sat, 19. Sep 20, 19:14

The mod Personnel Shuttles (https://www.nexusmods.com/x4foundations ... ?tab=files) is a good example of making a small tweak to a specific ship stat. The whole mod is:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff> 
    <replace sel="//macros/macro/properties/people/@capacity">21</replace>
</diff>
Looking at examples is my best method of learning specific syntax for things is. In the in the XML patch tutorial thread they have several examples of changing an atrribute with a single value as above but not anything where the atribute has several values seperated by spaces
I've been thinking that this could be a simple as:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff> 
    <add sel="//components/component/connections/connection[48]/@tags">mining </add>
    <add sel="//components/component/connections/connection[49]/@tags">mining </add>
</diff>
(tried it, still could not equip mining weapons)
I don't know how to debug if it's wrong. I feel like I'm just missing something minor that would make this click but I've yet to have an "A HA!" moment.

User avatar
Axeface
Posts: 1965
Joined: Fri, 18. Nov 05, 01:41
x4

Re: Ship editing question from a beginner

Post by Axeface » Sat, 19. Sep 20, 21:42

BigGreenThugs wrote:
Sat, 19. Sep 20, 19:14
The mod Personnel Shuttles (https://www.nexusmods.com/x4foundations ... ?tab=files) is a good example of making a small tweak to a specific ship stat. The whole mod is:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff> 
    <replace sel="//macros/macro/properties/people/@capacity">21</replace>
</diff>
Looking at examples is my best method of learning specific syntax for things is. In the in the XML patch tutorial thread they have several examples of changing an atrribute with a single value as above but not anything where the atribute has several values seperated by spaces
I've been thinking that this could be a simple as:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff> 
    <add sel="//components/component/connections/connection[48]/@tags">mining </add>
    <add sel="//components/component/connections/connection[49]/@tags">mining </add>
</diff>
(tried it, still could not equip mining weapons)
I don't know how to debug if it's wrong. I feel like I'm just missing something minor that would make this click but I've yet to have an "A HA!" moment.
How are you testing the mod? Are you loading into the game with the ship ready to test with? I think you might need to build a new ship because xmls are kind of baked into ships in the savegame (I dunno what im talking about, just a guess). Also is the patch file packaged in a ext_01 dat/cat?

Post Reply

Return to “X4: Foundations - Scripts and Modding”