Forum Discussion

theWalterMoose's avatar
4 years ago

How to convert vectors to map X/Y or North/East coordinates?

I would be my assumption the coordinate system is a spherical coordinate system, is there a math function to derive the x/y location relative to the map?

7 Replies

  • theWalterMoose's avatar
    theWalterMoose
    4 years ago

    Hi Matty101yttam,

    Did that, but the coordinates appear to be spherical, not Cartesian.  I wish to draw an imaginary line across the 2D map and establish how far a player is from that line and when they have crossed (ala, no-cross snipers)

    Thoughts?

  • theWalterMoose's avatar
    theWalterMoose
    4 years ago

    @Matty101yttam wrote:

    GetPlayerState with PlayerStateVector set to position

    Will give a players xyz position


    GetPlayerState with PSV set to 'position' gives you 'X,Y,Z' when you use Get[X/Y/Z]Component, but what does X/Y/Z refer to, spherical position?  Since the X/Y never exceeds 360+/-, am I to assume 'X' is theta (angle relative to X), 'Y' is phi (angle relative to Z) and 'Z' is rho (length of radius)?

  • Matty101yttam's avatar
    Matty101yttam
    4 years ago

    Didn't seem to have a max unit for me, have to double check. I know if i set a random vector eg 100,156,256  i can use players vector - the random vector to create a distance indicator on the side of the screen and go to that point.

  • Matty101yttam's avatar
    Matty101yttam
    4 years ago

    nope got to x:430 so its more than 360

    can just set it up if player_x > 100(just a random map section) then kill player(or whatever).

  • theWalterMoose's avatar
    theWalterMoose
    4 years ago

    Give this a try, AARVYA.  I am working on a substack article and I will go into the math and how I decoded this, but short version, I used the GetX/Y/ZComponent of the player state, and selected eight points from the small 'Renewal' map.  I wrote down the X/Y/Z and it didn't make much sense, so I put the coordinates into Grapher on a mac and got this (see photo).  In reference to the flat plane of the mini map, 'Z' is the x axis and 'X' is the y axis, none of which align with the compass.  So when you run the AARVYA custom mode, it displays the Game Vector (raw from the GetX/Y/ZComponent math function, Player X/Y is the 'Z' and 'X' values from GetX/Y/ZComponent, Compass X/Y is adjusted (roughly) for the in game compass.

  • Matty101yttam's avatar
    Matty101yttam
    4 years ago

    i see don't see any picture...

    could you also post the url so i can see the code.

About Battlefield 2042 General Discussion

Discuss the latest news and game information around Battlefield 2042 in the community forums.15,971 PostsLatest Activity: 4 years ago