Ignore:
Timestamp:
Feb 2, 2014, 7:50:10 PM (11 years ago)
Author:
s10k
Message:

more fixes and updated examples

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XmlTools2/examples/BINACJBOCharacter.oni-patch

    r919 r920  
     1#########################################################################################
     2############################## XmlTools Patch File Example ##############################
     3#########################################################################################
     4
     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.
    112@XML_TOOLS Version "2.0"
    213
    3 #@ADD_INSIDE_NODE ElementName "Particles"
    4 <xml>
    5              <Particle>
    6                  <Start>0</Start>
    7                  <End>45</End>
    8                  <Bone>Head</Bone>
    9                  <Name>glass_break</Name>
    10              </Particle>
    11 </xml>
    12 
    13 @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"
    1416<xml>
    1517                <Attack>
     
    2830</xml>
    2931
    30 #@ADD_INSIDE_NODE ElementName "Attacks"
     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# 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"
    3137<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>
     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>
    4551</xml>
    4652
    47 #@ADD_INSIDE_NODE ElementName "Animation"
    48 <xml>
    49          <AttackRing>
    50              <Length>0</Length>
    51              <Length>0</Length>
    52              <Length>0</Length>
    53              <Length>0</Length>
    54              <Length>0</Length>
    55              <Length>0</Length>
    56              <Length>0</Length>
    57              <Length>0</Length>
    58              <Length>0</Length>
    59              <Length>0</Length>
    60              <Length>0</Length>
    61              <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>
    87 </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"
    8855
    89 #@REMOVE_NODE ElementName "Objects" ParentElementName "Oni" Files "BINACJBOCharacter-van.xml"
     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"
    9058
    91 #@COMMAND "-?"
     59# This command executes the javascript inside the (inside of <code></code> tags)
    9260
    93 #@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"
    9464<code>
    95   var myBuilder = new JSXMLBuilder();
    96  myBuilder.load($xmlData);
     65        var myBuilder = new JSXMLBuilder();
     66        myBuilder.load($xmlData);
    9767
    98  var elements = myBuilder.elements;
     68        var elements = myBuilder.elements;
    9969 
    10070        for (var i = 0; i < elements.length; i++) {
Note: See TracChangeset for help on using the changeset viewer.