489
edits
| Script 10k (talk | contribs) m (→Example) | Script 10k (talk | contribs)  | ||
| Line 79: | Line 79: | ||
| ===Description=== | ===Description=== | ||
| This operation allows you to remove XML values from existing XML elements. The values to remove should be space separated and contained within quotes. | |||
| <tt>Usage: XmlTools --remove-values --current-val "current values to remove"</tt> | |||
| ===Example=== | ===Example=== | ||
| Let's say you want to remove the UpgradeDifficulty and InfiniteAmmo flags from D_S82 character. | |||
| '''XmlTools command:''' | |||
| <pre>XmlTools --remove-values --current-val "UpgradeDifficulty InfiniteAmmo" --xpath-expression "/Oni/Objects/CHAR[@Id='7643']/OSD/Flags" --files "BINACJBOCharacter.xml"</pre> | |||
| {| style="margin: 1em auto 1em auto;" <!-- Centers table --> | |||
| ! style="width: 50%;" | XML Original | |||
| ! style="width: 50%;" | XML After Command | |||
| |- | |||
| | | |||
|  <Oni> | |||
|       <Objects> | |||
|             <CHAR Id="7643"> | |||
|                   <Header> | |||
|                   <Flags /> | |||
|                   <Position>173.626175 0 36.94594</Position> | |||
|                   <Rotation>0 134.847549 0</Rotation> | |||
|                   </Header> | |||
|                   <OSD> | |||
|                         <Flags><span style="color:blue">NotInitiallyPresent UpgradeDifficulty InfiniteAmmo</span></Flags> | |||
|                         <ClassTCTF_swat_1</Class> | |||
|                         <Name>D_S82</Name> | |||
|                         <Weapon>w3_phr</Weapon> | |||
|                   ... | |||
|                   </OSD> | |||
|             </CHAR> | |||
|       ... | |||
|       </Objects> | |||
|  </Oni> | |||
| | | |||
|  <Oni> | |||
|       <Objects> | |||
|             <CHAR Id="7643"> | |||
|                   <Header> | |||
|                   <Flags /> | |||
|                   <Position>173.626175 0 36.94594</Position> | |||
|                   <Rotation>0 134.847549 0</Rotation> | |||
|                   </Header> | |||
|                   <OSD> | |||
|                         <Flags><span style="color:red">NotInitiallyPresent</span></Flags> | |||
|                         <ClassTCTF_swat_1</Class> | |||
|                         <Name>D_S82</Name> | |||
|                         <Weapon>w3_phr</Weapon> | |||
|                   ... | |||
|                   </OSD> | |||
|             </CHAR> | |||
|       ... | |||
|       </Objects> | |||
|  </Oni> | |||
| |} | |||
| =Patch file operations= | =Patch file operations= | ||
edits