[help] Syntax problem, I think.

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

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

Eukatae
Posts: 56
Joined: Thu, 28. Feb 13, 16:22
x4

[help] Syntax problem, I think.

Post by Eukatae »

Trying to figure out how to mod x4 starting with test modding equipment mods.
The mod is in the right place and enabled. Not a single replaced or added value is showing up. Makes me think I have a syntax error but....
Original code from equipmentmods.xml:

Code: Select all

<equipmentmods>
  <weapon>
    <damage ware="mod_weapon_damage_02_mk1" quality="1" min="1.35" max="1.45">
      <bonus chance="1.0" max="1">
        <cooling min="0.684" max="0.736"/>
      </bonus>
    </damage>
     </weapon>
     </equipmentmods>
My modded code:

Code: Select all

<diff>
	<replace sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/@min">9.999</replace>
	<replace sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/@max">9.999</replace>
	<replace sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/bonus/@max">3</replace>
	<replace sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/bonus/cooling/@min">9.999</replace>
	<replace sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/bonus/cooling/@max">9.999</replace>
	<add sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/bonus>
	        <reload min="0.682" max="2"/>	
	</add>	
</diff>
Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [help] Syntax problem, I think.

Post by Misunderstood Wookie »

Umm where is

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
Need more info than you gave sorry.

I am pretty certain is the cause here as I believe you already know the above but just did not showcase you have all that setup already with correct folder structure etc...
You never even opened or closed the

Code: Select all

<bonus> </bonus>
tag, and what you do have there in all your replaces and add's is broken

Code: Select all

/bonus>
The original actually is adding the bonus tag

Code: Select all

 <bonus chance="1.0" max="1">
        <cooling min="0.684" max="0.736"/>
      		</bonus>
However, you are not replacing that by looks of things you are adding a new line and you did NOT open the bonus tag for the ADD, and as far as the replaces go you never open the tag either.


I am not sure any of that is even going to work tho, I don't really understand XML that well and frankly I am pissed Egosoft stopped using X3Script.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image
Eukatae
Posts: 56
Joined: Thu, 28. Feb 13, 16:22
x4

Re: [help] Syntax problem, I think.

Post by Eukatae »

Thank you for the reply.
This is what comes from doing this stuff way past bed time.

<add sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/bonus> < this right here! close quote! arg how can I be so blind! I wasted 2 hours on a friggin close quote.
Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [help] Syntax problem, I think.

Post by Misunderstood Wookie »

Eukatae wrote: Fri, 7. Dec 18, 18:15 Thank you for the reply.
This is what comes from doing this stuff way past bed time.

<add sel="/equipmentmods/weapon/damage[@ware='mod_weapon_damage_02_mk1']/bonus> < this right here! close quote! arg how can I be so blind! I wasted 2 hours on a friggin close quote.
hehe, these things happen.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

Return to “X4: Foundations - Scripts and Modding”