Page 1 of 1

Measuring Distance Across Maps

Posted: 08 Nov 2017, 19:56
by DoctorX
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.

Re: Measuring Distance Across Maps

Posted: 08 Nov 2017, 20:10
by DoctorX
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.