489
edits
m (→Description: forgot bold tags) |
Script 10k (talk | contribs) (changed javascript example to multiplication of the items instead of sum. Sum was a bad example since it can be achieved easily with a combination of XPath and --update-elements command which is a faster native approach) |
||
Line 638: | Line 638: | ||
====Example==== | ====Example==== | ||
Let's say you want to | Let's say you want to double the ammo clips and energy cells to all characters that are on the TCTF team. | ||
'''XmlTools patch command:''' | '''XmlTools patch command:''' | ||
Line 664: | Line 664: | ||
currCellsElement=currChar.childElement("OSD").childElement("Inventory").childElement("EnergyCell").childElement("Use"); | currCellsElement=currChar.childElement("OSD").childElement("Inventory").childElement("EnergyCell").childElement("Use"); | ||
<span style="color:green">// | <span style="color:green">// Double the current amount of ammo and cells that the character can use</span> | ||
currAmmoElement.text=parseInt(currAmmoElement.text) | currAmmoElement.text=parseInt(currAmmoElement.text)*2; | ||
currCellsElement.text=parseInt(currCellsElement.text) | currCellsElement.text=parseInt(currCellsElement.text)*2; | ||
} | } | ||
} | } | ||
Line 689: | Line 689: | ||
<Inventory> | <Inventory> | ||
<Ammo> | <Ammo> | ||
<Use><span style="color:blue">''' | <Use><span style="color:blue">'''2'''</span></Use> | ||
... | ... | ||
</Ammo> | </Ammo> | ||
Line 733: | Line 733: | ||
</Ammo> | </Ammo> | ||
<EnergyCell> | <EnergyCell> | ||
<Use>''' | <Use>'''2'''</Use> | ||
... | ... | ||
</EnergyCell> | </EnergyCell> | ||
Line 757: | Line 757: | ||
<Inventory> | <Inventory> | ||
<Ammo> | <Ammo> | ||
<Use><span style="color:red">''' | <Use><span style="color:red">'''4'''</span></Use> | ||
... | ... | ||
</Ammo> | </Ammo> | ||
<EnergyCell> | <EnergyCell> | ||
<Use><span style="color:red">''' | <Use><span style="color:red">'''0'''</span></Use> | ||
... | ... | ||
</EnergyCell> | </EnergyCell> | ||
Line 777: | Line 777: | ||
<Inventory> | <Inventory> | ||
<Ammo> | <Ammo> | ||
<Use><span style="color:red">''' | <Use><span style="color:red">'''6'''</span></Use> | ||
... | ... | ||
</Ammo> | </Ammo> | ||
Line 801: | Line 801: | ||
</Ammo> | </Ammo> | ||
<EnergyCell> | <EnergyCell> | ||
<Use>''' | <Use>'''2'''</Use> | ||
... | ... | ||
</EnergyCell> | </EnergyCell> |
edits