Mass Multiply and Replace Values
-
<XMLJobs> <jobs> <Job ClassName="MERC" WeaponsType="kfMaul kfSword kfAxe" ArmorType="kfLightArmor kfHeavyArmor kfLightHelmet kfHeavyHelmet kfShield" BonusCrit="2" BaseMove="4" SpeedGrowth="0.83" BaseSpeed="96.67" Hat="mercenary" OutfitM="lightarmor" OutfitF="lightarmor"> <StatsGrowth Values="4.5 4 3 3.5" /> <HealthGrowth Values="8 1.5" /> <BaseStats Values="44 41 31 35" /> <HealthBase Values="88 11" /> <learnables> <Tier> <SkillTile Cost="0"> <AbilityHash>MERC-A2</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="150"> <AbilityHash>MERC-A1</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="150"> <AbilityHash>MERC-A3</AbilityHash> </SkillTile> <SkillTile Cost="150"> <AbilityHash>MERC-A4</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="200"> <AbilityHash>MERC-C1</AbilityHash> </SkillTile> <SkillTile Cost="200"> <AbilityHash>MERC-P2</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="200"> <AbilityHash>MERC-A5</AbilityHash> </SkillTile> <SkillTile Cost="200"> <AbilityHash>MERC-A6</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="250"> <AbilityHash>MERC-P1</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="250"> <AbilityHash>MERC-A7</AbilityHash> </SkillTile> </Tier> </learnables> <Mastery hp="60" def="50" /> </Job> <Job ClassName="KNIG" WeaponsType="kfSword kfSpear" ArmorType="kfRobes kfHeavyArmor kfClothHelmet kfHeavyHelmet kfShield" BaseMove="4" BaseJump="2" CanSwim="false" SpeedGrowth="0.75" BaseSpeed="93.33" Hat="knight" OutfitM="heavy" OutfitF="heavy"> <StatsGrowth Values="4 5 3 4" /> <HealthGrowth Values="7.5 1.5" /> <BaseStats Values="40 47 36 45" /> <HealthBase Values="86 14" /> <requirements> <UnlockingRequirement ClassHash="MERC" Level="3" /> </requirements> <learnables> <Tier> <SkillTile Cost="0"> <AbilityHash>KNIG-A1</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="150"> <AbilityHash>KNIG-A2</AbilityHash> </SkillTile> <SkillTile Cost="175"> <AbilityHash>KNIG-A4</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="200"> <AbilityHash>KNIG-A3</AbilityHash> </SkillTile> <SkillTile Cost="150"> <AbilityHash>KNIG-C1</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="250"> <AbilityHash>KNIG-P1</AbilityHash> </SkillTile> <SkillTile Cost="250"> <AbilityHash>KNIG-P2</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="250"> <AbilityHash>KNIG-A5</AbilityHash> </SkillTile> <SkillTile Cost="225"> <AbilityHash>KNIG-A6</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="300"> <AbilityHash>KNIG-A7</AbilityHash> </SkillTile> </Tier> </learnables> <Mastery hp="60" def="50" res="30" /> </Job> <Job ClassName="BLAD" WeaponsType="kfScythe kfSword kfMace" ArmorType="kfHeavyArmor kfHeavyHelmet kfShield" BonusEvasion="2" BonusCrit="2" BaseMove="4" BaseJump="2" CanSwim="false" SpeedGrowth="0.88" BaseSpeed="93.33" casterClass="2" Hat="paragon" OutfitM="paragon" OutfitF="paragon"> <StatsGrowth Values="4.5 3.5 3.5 4.5" /> <HealthGrowth Values="7 2" /> <BaseStats Values="44 39 35 41" /> <HealthBase Values="80 18" /> <requirements> <UnlockingRequirement ClassHash="KNIG" Level="4" /> </requirements> <learnables> <Tier> <SkillTile Cost="0"> <AbilityHash>BLAD-A2</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="150"> <AbilityHash>BLAD-P2</AbilityHash> </SkillTile> <SkillTile Cost="150"> <AbilityHash>BLAD-A3</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="200"> <AbilityHash>BLAD-P1</AbilityHash> </SkillTile> <SkillTile Cost="200"> <AbilityHash>BLAD-A1</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="250"> <AbilityHash>BLAD-C1</AbilityHash> </SkillTile> <SkillTile Cost="200"> <AbilityHash>BLAD-A7</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="200"> <AbilityHash>BLAD-A4</AbilityHash> </SkillTile> <SkillTile Cost="300"> <AbilityHash>BLAD-A6</AbilityHash> </SkillTile> </Tier> <Tier> <SkillTile Cost="350"> <AbilityHash>BLAD-A5</AbilityHash> </SkillTile> </Tier> </learnables> <Mastery def="50" res="50" holy="50" /> </Job> <jobs> <XMLJobs>
Hello, Ive been trying for way too long to figure out how to duplicate the values of
<StatsGrowth Values=“4.5 4 3 3.5” />
<HealthGrowth Values=“8 1.5” />
<BaseStats Values=“44 41 31 35” />
<HealthBase Values=“88 11” />Transforming this into a factored result like this:
<StatsGrowth Values=“9 8 6 7” />
<HealthGrowth Values=“16 3” />
<BaseStats Values=“88 82 62 70” />
<HealthBase Values=“176 11” />And the same for
<Mastery hp=“60” def=“50” />
into
<Mastery hp=“300” def=“250” />There’s thousands of lines and 100’s of instances. I was using the XML Tools plugin with the Following XLST and some slight tweaking, however it would return NaN and transform Self-closing things
<?xml version="1.0" encoding="UTF-8"?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" omit-xml-declaration="no" encoding="UTF-8" indent="yes" /> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="fBrakeForce"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:attribute name="value"> <xsl:value-of select="format-number(@value * 1.2, '0.000000')"/> </xsl:attribute> <xsl:apply-templates select="node()"/> </xsl:copy> </xsl:template> </xsl:transform>
I havent been able to figure out how to duplicate numbers with space seperators and retaining self closing.
Any help is greatly appreciated, I couldnt figure this out in 10 hours.
-
You want to double all the values during the replacement? That cannot be done using the built-in search/replace
If you are willing to use the PythonScript plugin, then searching the forum for
add_1
will show examples of how to use the power of Python and the PythonScript plugin to get PythonScript to do your math for you during the replacement. Hopefully, you can extend theadd_1
idea tomultiply_by_2
instead. -
@peterjones I am using the Plugin XML tools and Transforming with an XLST similiar to the second body of code in the original post.
I will Check into the Python thing.