• Visit Rebornbuddy
  • If within 100 yalms of...

    Discussion in 'Community Developer Forum' started by Calleil, Oct 26, 2015.

    1. Calleil

      Calleil Member

      Joined:
      Mar 2, 2015
      Messages:
      144
      Likes Received:
      2
      Trophy Points:
      18
      Is there currently a way to use distance from a hotspot or location as a conditional?

      I'm looking for a way to do something like:

      <Waypoint XYZ="-180.1626, 100.6697, -198.3214" />
      <If distanceFromWaypoint<="100">
      doWhatever
      </If>

      This would solve a problem I've been having in my ephemeral fishing profile... any ideas or workarounds to do something similar?
       
    2. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      Code:
      		<If Condition="Vector3.Distance(Me.Location, Vector3(-87.17487, 7, -173.5104)) &gt; 5">
      			<ExLog Message="Greater than 5 yalms"/>
      		</If>
      		<If Condition="Vector3.Distance(Me.Location, Vector3(-87.17487, 7, -173.5104)) &lt; 5">
      			<ExLog Message="Less than 5 yalms"/>
      		</If>
      
      or even the following

      EDIT: this can throw a null reference exception if you have no target and is basically just being shown as an example.

      Code:
      
      		<If Condition="Vector3.Distance(Me.Location, Me.CurrentTarget.Location) &gt; 5">
      			<ExLog Message="I am further than 5 yalms from my target"/>
      		</If>
      
      
       

    Share This Page