I am trying to add the tag 'influencelist="medium_drive_disrupt' to the macro 'bullet_pir_turret_m_battleship_01_gatling_01_mk1_macro'. The orginal macro looks like this:
<?xml version="1.0" encoding="utf-8"?>
<!--Exported by: nick (192.168.3.123) at 02.09.2021_15-21-12-->
<macros>
<macro name="bullet_pir_turret_m_battleship_01_gatling_01_mk1_macro" class="bullet">
<component ref="bullet_gen_m_gatling_01_mk1" />
<properties>
<ammunition value="15" reload="1" />
<bullet speed="3221.1" lifetime="2.863" amount="1" barrelamount="2" icon="weapon_gatling_mk1" timediff="0.025" angle="0.43" maxhits="2" ricochet="0.01" restitution="0.3" scale="0" attach="0">
<damagecurves>
<time>
<point position="0.2" value="1" />
<point position="0.5" value="0.8" />
<point position="1" value="0.1" />
</time>
<distance>
<point position="0.2" value="1" />
<point position="0.5" value="0.7" />
<point position="1" value="0.1" />
</distance>
</damagecurves>
</bullet>
<reload rate="8" />
<damage value="26" repair="0" />
<effects>
<impact ref="impact_gen_s_gatling_01_mk1" inside="impact_gen_s_gatling_01_mk1_inside" />
<bigobjectimpact ref="impact_gen_s_gatling_01_mk1_bigobject" inside="impact_gen_s_gatling_01_mk1_bigobject_inside" />
<launch ref="muzzle_turret_gen_m_gatling_01_mk1" />
</effects>
<weapon system="turret_shortrange" />
</properties>
</macro>
</macros>
I want it to look like this:
<macros>
<macro name="bullet_pir_turret_m_battleship_01_gatling_01_mk1_macro" class="bullet">
<component ref="bullet_gen_m_gatling_01_mk1" />
<properties>
<ammunition value="15" reload="1" />
<bullet speed="3221.1" lifetime="2.863" amount="1" barrelamount="2" icon="weapon_gatling_mk1" timediff="0.025" angle="0.43" maxhits="2" ricochet="0.01" restitution="0.3" scale="0" attach="0" influencelist="medium_drive_disrupt">
<damagecurves>
<time>
<point position="0.2" value="1" />
<point position="0.5" value="0.8" />
<point position="1" value="0.1" />
</time>
<distance>
<point position="0.2" value="1" />
<point position="0.5" value="0.7" />
<point position="1" value="0.1" />
</distance>
</damagecurves>
</bullet>
<reload rate="8" />
<damage value="26" repair="0" />
<effects>
<impact ref="impact_gen_s_gatling_01_mk1" inside="impact_gen_s_gatling_01_mk1_inside" />
<bigobjectimpact ref="impact_gen_s_gatling_01_mk1_bigobject" inside="impact_gen_s_gatling_01_mk1_bigobject_inside" />
<launch ref="muzzle_turret_gen_m_gatling_01_mk1" />
</effects>
<weapon system="turret_shortrange" />
</properties>
</macro>
</macros>
I thought the following would do it:
<?xml version="1.0" encoding="utf-8"?>
<diff>
<add sel="//macros/macro/properties/bullet[@attach="0"]">influencelist="medium_drive_disrupt"</add>
</diff>
but that does not work. What am I missing?
Adding a tag to a Macro
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Re: Adding a tag to a Macro
Hi bhorton22,
there may be several reasons for this.
1. Did you set the dependency to the pirate dlc in your content.xml?
2. If you take a look at this patch tutorial: viewtopic.php?f=129&t=354310 you'll see, that you have to use e.g. ".." for the patch path and '...' for the value. Or the other way around:
2a. Also in the first post:
I hope this works and helps you.
there may be several reasons for this.
1. Did you set the dependency to the pirate dlc in your content.xml?
2. If you take a look at this patch tutorial: viewtopic.php?f=129&t=354310 you'll see, that you have to use e.g. ".." for the patch path and '...' for the value. Or the other way around:
Code: Select all
<add sel='//macros/macro/properties/bullet[@attach="0"]'>influencelist="medium_drive_disrupt"</add>
To summarize, it should therefore be as follows for you:theqmann wrote: ↑Sun, 24. Nov 13, 19:19
[...]
All of these will use this basic source file:[...]Code: Select all
<?xml version="1.0" encoding="UTF-8"?> <root> <bar> <foo a="1"/> <foo a="2"/> </bar> </root>
Add an attribute
PatchResultCode: Select all
<add sel="root/bar" type="@cat">3</add>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?> <root> <bar cat="3"> <foo a="1"/> <foo a="2"/> </bar> </root>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<diff>
<add sel="//macros/macro/properties/bullet" type="@influencelist>medium_drive_disrupt</add>
</diff>
Re: Adding a tag to a Macro
Thank You. That worked.