-
How can I convert the position in the file to the position in the map ? |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments
-
What do you mean by "position in the map"? If you're referring to the place name (e.g "SiteB") you can get that from the m_szLastPlaceName network property. |
Beta Was this translation helpful? Give feedback.
-
For example, in the horizontal and vertical coordinates of the map ! |
Beta Was this translation helpful? Give feedback.
-
When you say "map" do you mean an X,Y co-ordinate on the overview image? Like these: |
Beta Was this translation helpful? Give feedback.
-
Yes, it's the map! |
Beta Was this translation helpful? Give feedback.
-
Take a look at these .json files: https://github.com/saul/gamevis/tree/master/overviews/csgo Imagine you have a world-space co-ordinate named To determine where this position fits on the map, do: map_x = (worldSpace.x - pos_x) / scale
map_y = (worldSpace.y - pos_y) / scale Where pos_x, pos_y and scale are taken from: https://github.com/saul/gamevis/blob/master/overviews/csgo/de_dust2.json |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot ! |
Beta Was this translation helpful? Give feedback.
-
What do these I am trying to draw locations of a match on de_cache using I am trying to use it in the the following way: let circles = [];
for (let pos of positions) {
circles.push(
<circle cx={map_x} cy={map_y} r="5" fill="red" />
)
}
<svg viewBox="0 0 768 768">
<image href={image} alt="map" height="768" width="768" />
{circles}
</svg> |
Beta Was this translation helpful? Give feedback.
-
@Brammz, you want to set
For de_cache, |
Beta Was this translation helpful? Give feedback.
-
Thanks, it works now for kills and deaths! However for any type of grenade it gives x, y and z values between 0 and 32 everytime. (Just getting the entity position on detonate event) |
Beta Was this translation helpful? Give feedback.
-
I've just released 0.4.16 which fixes this |
Beta Was this translation helpful? Give feedback.
-
It works now, thank you so much! You're awesome! |
Beta Was this translation helpful? Give feedback.
-
Hi, I am working on a custom map, it means that I cannot use the .json you linked above for the coordinate translation. Do you have an idea how I can get the custom map pos_x, pos_y and scale ? Edit: More info: When I am on my map and I use "getpos" it outputs What should I use to do the mapping from one to the other? Even if I can get pos_x, pos_y and scale and use these formulas to find my map_x and map_y: |
Beta Was this translation helpful? Give feedback.
-
I assume this custom map has an overview script in However, if this is a map that you have made yourself, you can create a mini-map by following this Valve Dev Wiki article: Creating a working mini-map |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer. Yes I made this map myself so I don't have any |
Beta Was this translation helpful? Give feedback.
-
Can you raise a separate issue about your position problem? It’s not really related to this. Add the demo file you’re referring to if possible. |
Beta Was this translation helpful? Give feedback.
Take a look at these .json files: https://github.com/saul/gamevis/tree/master/overviews/csgo
Imagine you have a world-space co-ordinate named
worldSpace
, such as {x: 3305.17170, y: 11590.83300}.To determine where this position fits on the map, do:
Where pos_x, pos_y and scale are taken from: https://github.com/saul/gamevis/blob/master/overviews/csgo/de_dust2.json