1 |
< |
@XML_TOOLS Version "2.0" |
1 |
> |
######################################################################################### |
2 |
> |
############################## XmlTools Patch File Example ############################## |
3 |
> |
######################################################################################### |
4 |
|
|
5 |
< |
#@ADD_INSIDE_NODE ElementName "Particles" |
6 |
< |
<xml> |
7 |
< |
<Particle> |
8 |
< |
<Start>0</Start> |
9 |
< |
<End>45</End> |
10 |
< |
<Bone>Head</Bone> |
11 |
< |
<Name>glass_break</Name> |
12 |
< |
</Particle> |
11 |
< |
</xml> |
5 |
> |
########## Comments in patch files begin with '#' |
6 |
> |
|
7 |
> |
########## You can comment and uncomment commands to see their effect |
8 |
> |
########## in BINACJBOCharacter.xml file |
9 |
> |
|
10 |
> |
# The following row is always required in a XmlTools patch. |
11 |
> |
# It defines the minimum version of XmlTools executable that it requires. |
12 |
> |
@XML_TOOLS Version "2.0" |
13 |
|
|
14 |
< |
@ADD_INSIDE_NODE ElementName "OSD" Files "BINACJBOCharacter-van.xml" |
14 |
> |
# This command adds a new XML node (inside of <xml></xml> tags) to all OSD named nodes. |
15 |
> |
@ADD_INSIDE_NODES ElementName "OSD" Files "BINACJBOCharacter.xml" |
16 |
|
<xml> |
17 |
|
<Attack> |
18 |
|
<Start>0</Start> |
29 |
|
</Attack> |
30 |
|
</xml> |
31 |
|
|
32 |
< |
#@ADD_INSIDE_NODE ElementName "Attacks" |
33 |
< |
<xml> |
32 |
< |
<Attack> |
33 |
< |
<Start>31</Start> |
34 |
< |
<End>44</End> |
35 |
< |
<Bones>Chest Neck LeftShoulder RightShoulder</Bones> |
36 |
< |
<Flags>Unblockable</Flags> |
37 |
< |
<Knockback>0</Knockback> |
38 |
< |
<HitPoints>5</HitPoints> |
39 |
< |
<HitType>HitBody</HitType> |
40 |
< |
<HitLength>40</HitLength> |
41 |
< |
<StunLength>0</StunLength> |
42 |
< |
<StaggerLength>0</StaggerLength> |
43 |
< |
<Extents /> |
44 |
< |
</Attack> |
45 |
< |
</xml> |
32 |
> |
# This command removes the nodes inserted in the previous command using ElementName and ParentElementName. |
33 |
> |
@REMOVE_NODES ElementName "Attack" ParentElementName "OSD" Files "BINACJBOCharacter.xml" |
34 |
|
|
35 |
< |
#@ADD_INSIDE_NODE ElementName "Animation" |
35 |
> |
# This command adds a new XML node (inside of <xml></xml> tags) to the nodes that matches the XPathExpression. |
36 |
> |
@ADD_INSIDE_NODES XPathExpression "/Oni/Objects/CHAR/OSD" Files "BINACJBOCharacter.xml" |
37 |
|
<xml> |
38 |
< |
<AttackRing> |
39 |
< |
<Length>0</Length> |
40 |
< |
<Length>0</Length> |
41 |
< |
<Length>0</Length> |
42 |
< |
<Length>0</Length> |
43 |
< |
<Length>0</Length> |
44 |
< |
<Length>0</Length> |
45 |
< |
<Length>0</Length> |
46 |
< |
<Length>0</Length> |
47 |
< |
<Length>0</Length> |
48 |
< |
<Length>0</Length> |
49 |
< |
<Length>0</Length> |
50 |
< |
<Length>0</Length> |
62 |
< |
<Length>0</Length> |
63 |
< |
<Length>0</Length> |
64 |
< |
<Length>0</Length> |
65 |
< |
<Length>0</Length> |
66 |
< |
<Length>0</Length> |
67 |
< |
<Length>0</Length> |
68 |
< |
<Length>0</Length> |
69 |
< |
<Length>0</Length> |
70 |
< |
<Length>0</Length> |
71 |
< |
<Length>0</Length> |
72 |
< |
<Length>0</Length> |
73 |
< |
<Length>0</Length> |
74 |
< |
<Length>0</Length> |
75 |
< |
<Length>0</Length> |
76 |
< |
<Length>0</Length> |
77 |
< |
<Length>0</Length> |
78 |
< |
<Length>0</Length> |
79 |
< |
<Length>0</Length> |
80 |
< |
<Length>0</Length> |
81 |
< |
<Length>0</Length> |
82 |
< |
<Length>0</Length> |
83 |
< |
<Length>0</Length> |
84 |
< |
<Length>0</Length> |
85 |
< |
<Length>0</Length> |
86 |
< |
</AttackRing> |
38 |
> |
<Attack> |
39 |
> |
<Start>0</Start> |
40 |
> |
<End>30</End> |
41 |
> |
<Bones>Pelvis Chest Neck Head LeftShoulder LeftArm LeftWrist LeftFist RightShoulder RightArm RightWrist RightFist</Bones> |
42 |
> |
<Flags>Unblockable</Flags> |
43 |
> |
<Knockback>0</Knockback> |
44 |
> |
<HitPoints>10</HitPoints> |
45 |
> |
<HitType>KnockdownBody</HitType> |
46 |
> |
<HitLength>0</HitLength> |
47 |
> |
<StunLength>0</StunLength> |
48 |
> |
<StaggerLength>0</StaggerLength> |
49 |
> |
<Extents/> |
50 |
> |
</Attack> |
51 |
|
</xml> |
52 |
|
|
53 |
< |
#@REMOVE_NODE ElementName "Objects" ParentElementName "Oni" Files "BINACJBOCharacter-van.xml" |
53 |
> |
# This command removes the nodes inserted in the previous command using an XPathExpression. |
54 |
> |
@REMOVE_NODES XPathExpression "/Oni/Objects/CHAR/OSD/Attack" Files "BINACJBOCharacter.xml" |
55 |
> |
|
56 |
> |
# This command executes any of the XmlTools commands (see all possible command using XmlTools --help) |
57 |
> |
@COMMAND Arguments "--files 'BINACJBOCharacter.xml' --element-name 'Position' --invert-elements" |
58 |
|
|
59 |
< |
#@COMMAND "-?" |
59 |
> |
# This command executes the javascript inside the (inside of <code></code> tags) |
60 |
|
|
61 |
< |
#@CUSTOM_CODE Files "BINACJBOCharacter-van.xml" |
61 |
> |
# The current javascript code first gets the element name "CHAR" with an attribute Id=11565 |
62 |
> |
# then it gets the child element "OSD" and set its Weapon element value to "MyAwesomeOniWeapon" |
63 |
> |
@CUSTOM_CODE Files "BINACJBOCharacter.xml" |
64 |
|
<code> |
65 |
< |
var myBuilder = new JSXMLBuilder(); |
66 |
< |
myBuilder.load($xmlData); |
65 |
> |
var myBuilder = new JSXMLBuilder(); |
66 |
> |
myBuilder.load($xmlData); |
67 |
|
|
68 |
< |
var elements = myBuilder.elements; |
68 |
> |
var elements = myBuilder.elements; |
69 |
|
|
70 |
|
for (var i = 0; i < elements.length; i++) { |
71 |
|
if(elements[i].name=="CHAR" && elements[i].attributeString==" Id=\"11565\""){ |