1. How do you convert a Vector3 position to the map x,y coordinates and place a marker on the map ?
     
  2. Wulf

    Wulf Community Admin

    You can get the x, y, z from the Vector3. Day if your Vector3 was named pos, then you can use pos.x to get the x part of the position.
     
  3. Use position.x and position.y and just spawn a map marker prefab. You can just pass the position anyway though.
     
  4. I am new to oxide mod development, could you please provide the code for the map maker prefab spawning ? Tks
    [DOUBLEPOST=1512233367][/DOUBLEPOST]
    I still needed to know the map scale to convert x/y to map squares.
     
  5. I was able to figure out the coordinates translation by looking into the "teleport to coordinates" mod code:

    var worldSize = (ConVar.Server.worldsize);
    float offset =worldSize/2;
    var gridWidth = (0.0066666666666667f*worldSize);
    float step =worldSize/gridWidth;
    int letter = ((int) 'A') + ((int)(offset-eventPos.z) / (int)step);
    string c;
    if(letter> ((int) 'Z'))
    c="AA";
    else
    c= ((char)letter).ToString();