News Forums Troubleshooting Help: Following then attacking when close enough

This topic contains 20 replies, has 3 voices, and was last updated by  prime 9 months ago.

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #9007

    prime
    Keymaster

    Ok - I’ve got your project now. First problem I ran into - your melee detect node runs forever. The moment spotted != null, the AI will run that node and never move on.

    #9008

    prime
    Keymaster
    <behaviortree version="1.1" repeatuntil="" name="basicWanderFollowMecanim">
      <parallel tiebreaker="fail" succeed="all" repeatuntil="" name="root" fail="any">
        <detect sensor=""visualSensor"" repeatuntil="running" name="detect" entityobjectvariable="spotted" aspectvariable="" aspectobjectvariable="" aspect=""player"" />
        <selector usepriorities="False" repeatuntil="" name="selector">
          <constraint repeatuntil="" priority="" name="constraint" constraint="spotted != null">
            <parallel tiebreaker="fail" succeed="all" repeatuntil="running" name="parallel" fail="any">
              <detect sensor=""danceSensor"" repeatuntil="running" name="meleeDetect" entityobjectvariable="dance" aspectvariable="" aspectobjectvariable="" aspect=""player"" />
              <selector usepriorities="False" repeatuntil="" name="selector">
                <constraint repeatuntil="" priority="" name="constraint" constraint="dance != null">
                  <parallel tiebreaker="fail" succeed="all" repeatuntil="" name="parallel" fail="any">
                    <mecparam valueexpression="true" repeatuntil="" parametertype="boolean" parametername="dance" name="mecparam" damptime="0" />
                    <mecparam valueexpression="0" repeatuntil="" parametertype="float" parametername="speed" name="mecparam" damptime="0" />
                  </parallel>
                </constraint>
                <constraint repeatuntil="" priority="" name="constraint" constraint="dance == null">
                  <move turnspeed="" repeatuntil="" name="move" movetarget="spotted" movespeed="" facetarget="" closeenoughdistance="" closeenoughangle="" />
                </constraint>
              </selector>
            </parallel>
          </constraint>
          <constraint repeatuntil="" priority="" name="constraint" constraint="spotted == null">
            <parallel tiebreaker="fail" succeed="all" repeatuntil="" name="parallel" fail="any">
              <waypointpatrol waypointsetvariable=""Waypoint Route"" waypointactiontype="patrol" traversetype="loop" traverseorder="forward" repeatuntil="" pathtargetvariable="" name="waypointpatrol" movetargetvariable="moveTarget">
                <move turnspeed="" repeatuntil="" name="move" movetarget="moveTarget" movespeed="" facetarget="" closeenoughdistance="" closeenoughangle="" />
              </waypointpatrol>
            </parallel>
          </constraint>
        </selector>
      </parallel>
    </behaviortree>
    #9009

    prime
    Keymaster

    There’s a version that works. (Emailing it to you as well.)

    #9010

    morsavita
    Participant

    Prime,
    You are the man thank you very much. I can’t wait to get home from work and try this tonight I will keep you updated thanks again.

    #9195

    morsavita
    Participant

    Having a little problem importing the xml it comes in fine but when I run it changes back to the way it was before import even if I make changes after it was imported. Once I recreated what you gave me manually it works absolutely PERFECT though. Thank you very much this gives me a great jumping off point to learn a lot. Thanks again for all your time.

    #9272

    prime
    Keymaster

    Thanks for reporting the issue with xml. We’ll look into it.

Viewing 6 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic.