[help]my simple satellite xml doesn't work

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

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

hxsgame
Posts: 210
Joined: Thu, 4. Oct 18, 16:54
x4

[help]my simple satellite xml doesn't work

Post by hxsgame »

I tried was to change the satellite range to 300km, a simple XML, but it didn't work in the game.
It is open, but invalid I don't know what went wrong.

xml like this

Code: Select all

<!-- doing patch on satellite macros -->
<diff>
<replace sel="//macro[@name="eq_arg_satellite_02_macro"]/properties/radar[@range="75000"]/@range">250000</replace>
</diff>
I only have the .cat files, haven't the .sig files(didn't know how to create it). Will it matter?
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: [help]my simple satellite xml doesn't work

Post by sprIder »

hi hxsgame,

your mistake is that you use quotation marks for the path of the attribute you want to replace and for the more detailed description of which exact path to take (like [@range="75000"]).
If you look at viewtopic.php?f=129&t=354310 you see, that for one of this ' are used and for the other ".

So your code has to look like this:

Code: Select all

<diff>
<replace sel="//macro[@name='eq_arg_satellite_02_macro']/properties/radar[@range='75000']/@range">250000</replace>
</diff>
The other way round would also work:

Code: Select all

<diff>
<replace sel='//macro[@name="eq_arg_satellite_02_macro"]/properties/radar[@range="75000"]/@range'>250000</replace>
</diff>
From my point of view, your code is a bit too much for the use case. The following is shorter and does the same:

Code: Select all

<diff> 
  <replace sel="//macros/macro/properties/radar/@range">250000</replace>
</diff>
It also has the advantage that if Egosoft were to change the range of the satellites, the code would still work.

Nope, you do not need any .sig files.

And be aware of the spelling mistake from Egosoft at the folder name. They use "satelite" instead of "satellite". The folder path where your eq_arg_satellite_01_macro.xml and eq_arg_satellite_02_macro.xml are located must be
\extensions\[your mod name]\assets\props\equipment\satelite\macros\

Return to “X4: Foundations - Scripts and Modding”