Measuring Distance Across Maps

User avatar
DoctorX
Trespasser
Posts: 52
Joined: 10 Mar 2016, 00:36

Measuring Distance Across Maps

Postby DoctorX » 08 Nov 2017, 19:56

Is there a reliable way to measure relative distance for two objects on different maps?

Both dist_to_sqr and utils.graph_distance return seemingly random results when measuring across maps, for instance, while standing in Bar next to Petrenko, graph_distance says that the smart terrain for Hidden Base in Swamp is the closest one to the actor, and it shows Mangun being farther away than Sidorovich!

Not looking for an exact measurement, just a reliable way to return smart a is farther than smart b from the actor, which is farther than smart c, etc.

User avatar
DoctorX
Trespasser
Posts: 52
Joined: 10 Mar 2016, 00:36

Re: Measuring Distance Across Maps

Postby DoctorX » 08 Nov 2017, 20:10

Nvm, just answered my own question.

I had been using actor.m_game_vertex_id to compare to a smart terrain m_game_vertex_id, which was causing the weird results.

Compare the m_game_vertex_id for the smart terrain the actor is at instead, and then everything makes sense.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest