topical media & game development

talk show tell print

step-example.xml



  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE step PUBLIC "http://wasp.cs.vu.nl/step/xstep/translation/step.dtd"
                        "step.dtd">
  <step>
    <head>
      <world url="&quot;yt.wrl&quot;"/>
      <start action="test(humanoid)"/>
      <meta_language value="dlp"/>
    </head>
    <library>
      <action name="walk(Agent)">
        <seq>
          <par>
            <turn actor="Agent" part="r_shoulder">
              <dir value="back_down2"/>
              <speed value="fast"/>
            </turn>
            <turn actor="Agent" part="r_hip">
              <dir value="front_down2"/>
              <speed value="fast"/>
            </turn>
            <turn actor="Agent" part="l_shoulder">
              <speed value="fast"/>
              <dir value="front_down2"/>
            </turn>
            <turn actor="Agent" part="l_hip">
              <dir value="back_down2"/>
              <speed value="fast"/>
            </turn>
          </par>
          <par>
            <turn actor="Agent" part="l_shoulder">
              <dir value="back_down2"/>
              <speed value="fast"/>
            </turn>
            <turn actor="Agent" part="l_hip">
              <dir value="front_down2"/>
              <speed value="fast"/>
            </turn>
            <turn actor="Agent" part="r_shoulder">
              <dir value="front_down2"/>
              <speed value="fast"/>
            </turn>
            <turn actor="Agent" part="r_hip">
              <dir value="back_down2"/>
              <speed value="fast"/>
            </turn>
          </par>
        </seq>
      </action>
      <action name="get_adjustY(Agent, Y)">
        <seq>
          <do state="getBodyObjectName(Agent, l_ankle, ObjectName)"/>
          <do state="getPosition(ObjectName,_X1,Y1,_Z1)"/>
          <turn actor="Agent" part="l_hip">
            <dir value="back_down2"/>
            <speed value="fast"/>
          </turn>
          <do state="getPosition(ObjectName,_X2,Y2,_Z2)"/>
          <do state="Y is Y2-Y1"/>
          <turn actor="Agent" part="l_hip">
            <dir value="down"/>
            <speed value="fast"/>
          </turn>
        </seq>
      </action>
      <action name="walk_adjustY(Agent,Y,StepLength)">
        <seq>
          <do state="Y1 is -Y"/>
          <par>
            <script_action name="walk(Agent)"/>
            <seq>
              <move_body actor="Agent">
                <increment x="0.0" y="Y" z="StepLength"/>
                <speed value="very_fast"/>
              </move_body>
              <move_body actor="Agent">
                <increment x="0.0" y="Y1" z="StepLength"/>
                <speed value="very_fast"/>
              </move_body>
            </seq>
          </par>
        </seq>
      </action>
      <action name="walk(Agent,StepLength)">
        <par>
          <script_action name="walk(Agent)"/>
          <move_body actor="Agent">
            <increment x="0.0" y="0.0" z="StepLength"/>
            <speed value="very_fast"/>
          </move_body>
        </par>
      </action>
      <action name="other_example(Agent)">
        <seq>
          <if_then_else condition="if_part" else="test(Agent)" then="test(Agent)"/>
          <repeat action="test(Agent)" times="3"/>
          <move actor="Agent" part="l_knee">
            <position x="1.0" y="0.0" z="0.0"/>
            <time unit="second" value="5"/>
          </move>
        </seq>
      </action>
    </library>
  </step>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.