Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Question: get distance between 2 ships

Discussion in 'Programming Questions and Suggestions' started by Archetypal, May 26, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Archetypal Trainee Engineer

    Messages:
    23
    Hey

    is it possible to let the programmable block get the distance to a ship with an active antenna?

    for instance, i see the distance to a cargo ship, that spawned somewhere, on my HUD. I want to use that distance in the PB but without typing it in manually.

    is that possible at all? or do I need to try and triangulate a moving object?
     
  2. Wicorel Senior Engineer

    Messages:
    1,262
    Not currently possible. The pb does not have access to a list of visible antenna nor beacons.

    You could triangulate position, but not automatically. See triangulation post in released codes forum.
     
  3. Archetypal Trainee Engineer

    Messages:
    23
    thank you, i thought so:/

    yeah I'm trying to do that now,
    can I use trigonometric functions like sin and cos in the pb?
    it says it's not defined in VRageMath or something like that
     
  4. Warixx Trainee Engineer

    Messages:
    85
  5. plaYer2k Master Engineer

    Messages:
    3,160
  6. Warixx Trainee Engineer

    Messages:
    85
  7. Sirhan Blixt Apprentice Engineer

    Messages:
    467
    No, you didn't. But that's hardly necessary.
     
  8. Archetypal Trainee Engineer

    Messages:
    23
    but if I use Math.sin() and check the code ingame it says it's not defined in System.Math.
    so what am I doing wrong?
     
  9. Warixx Trainee Engineer

    Messages:
    85
    C# is case-sensitive
    Math.Sin
     
  10. Archetypal Trainee Engineer

    Messages:
    23
    oh well..
    thank you, I really should have figured that out myself.
    I've never used c# before, but I like it.
     
Thread Status:
This last post in this thread was made more than 31 days old.