I managed to get my vehicle to auto steer towards a target and drive there. How Do I Make it stop when I get there? lol.
I need a "{if {target is reached} the set brake to 0} like command but cant figure out how.

Tags
Vizzy

5 Comments

  • Log in to leave a comment
  • Profile image
    1,467 RikHar

    the only part im having an issue with is ....[convert [$yourdestinationcoords] to position]. little lost here

    4.4 years ago
  • Profile image
    Mod sflanker

    Sorry about the < that is because there is an issue with the markdown processor on this website that prevents it from displaying less than signs in code blocks, I fixed it using a unicode alternative. If you see < it should be .

    If you are trying to reach a targeted craft then instead of using the distance to a lat/long/AGL converted to a PCI position, you can just use the distance from your position to your target: nav |Target Position|. The dist operator is one of the options for the operator that takes two vectors (I believe the default option show in the toolbox is dot which takes the dot product).

    +2 4.4 years ago
  • Profile image
    1,467 RikHar

    @sflanker I just set my target from map view and my vehicle goes there. Also, where do i find these /dist/ and convert commands? are they custom? what is the &lt? Sorry for all the questions, been playing SR2 for a while now ,im just now starting to use vizzy so still trying to figure out a lot.

    4.4 years ago
  • Profile image
    Mod sflanker

    If you are going to use an if instead of a wait until then it will need to be inside of a loop.

    +1 4.4 years ago
  • Profile image
    Mod sflanker

    You probably want to engage the brakes once your distance to the target is below a certain threshold. Assuming you have your destination as lat/long/AGL coordinates, this would look something like this:

    > wait until [ [ [nav |Position|] |dist| [convert [$your_destination_coords] to position] ] < 10 ]
    > set |Brake| to [1]
    
    +2 4.4 years ago

1 Upvote

Log in in to upvote this post.