Advertisement
sumguytwitches

Waypoint Race

Oct 1st, 2020 (edited)
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. Switch to 0.
  2. set places to readjson("kerbin.json").
  3.  set placeindex to 0.
  4. Set waypointradius to 50.
  5. set justkeepswimming to true.
  6. Set tgt to places[places:keys[placeindex]].
  7. lock hdg to tgt:heading.
  8. Set sl to 10. set height to 10.
  9. when true then { if vxcl(up:vector, tgt:position - ship:position):mag  < waypointradius
  10.      {
  11.         set placeindex to mod(placeindex + 1, places:keys:length).
  12.     set tgt to places[places:keys[placeindex]].
  13.     lock hdg to tgt:heading. //set sl to max(min(tgt:distance / 15, 100),5).
  14.     Print "Going to " + places:keys[placeindex].
  15.             HUDTEXT("Going to " + places:keys[placeindex], 15, 2, 35 , RGB(Random(),Random(),Random()), false).
  16.     }
  17.      return justkeepswimming.
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement