GoldenEye: Source Forums

Editing and Customization => Modding Help => Topic started by: Phivex on September 18, 2016, 06:46:17 am

Title: [Solved] What Type of Measurement does GEUtil.DistanceBetween() Return?
Post by: Phivex on September 18, 2016, 06:46:17 am
The function takes two entities. When I pass it two players to find out what the distance between the two are when one is killed, it returns a float. I could be what seems like 10 feet away from the victim when I kill them, and it may say 127.XXXX.  The comments don't specify the type of measurement, though 10 feet would equate to 120 inches, so maybe it's a measurement for virtual inches?
Title: Re: What Type of Measurement does GEUtil.DistanceBetween() Return?
Post by: Adrian on September 18, 2016, 07:08:24 am
In Source, 1 unit = 0.75 inches. You can read more about dimensions in the Source engine in this article. (https://developer.valvesoftware.com/wiki/Dimensions#Source_Engine_Scale_Calculations)
Title: Re: What Type of Measurement does GEUtil.DistanceBetween() Return?
Post by: Phivex on September 18, 2016, 07:32:48 am
Awesome! Thanks for the info and reading material. I'm definitely new to working with the Source engine, so it'll help.
Title: Re: [Solved] What Type of Measurement does GEUtil.DistanceBetween() Return?
Post by: killermonkey on September 18, 2016, 10:29:45 am
You really shouldn't think of it in terms of real-world dimensions. Its a unit, nothing more nothing less. Just get comfortable visualizing what 100, 500, and 1000 units looks like in game and go from there.

Good reference points: Players are 72 units tall and 12.5 units in diameter, Floor-to-ceiling heights are generally 128 units.

So if you want something to happen within 10 "player widths" away, simply put in 125.