[1.3b53] Add movement metric argument to getDistance()

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
tsuuga
Kobold
Posts: 3
Joined: Sat Jan 24, 2009 6:14 pm

[1.3b53] Add movement metric argument to getDistance()

Post by tsuuga »

I would like to be able to choose the movement method used when measuring distances as an argument. Notably, D&D measures distance as ONE_TWO_ONE - except for melee attack ranges, which are ONE_ONE_ONE. Doesn't matter for standard range weapons, but for things with reach I have to treat them as having a 15-foot range instead of a 10-foot range to include all their threatened squares.

User avatar
Illiani
Giant
Posts: 117
Joined: Mon Feb 02, 2009 7:24 am
Location: UK
Contact:

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Illiani »

I'll second this one, its something I'd completely forgotten about to be honest.
Image

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Rumble »

If I understand the problem, the issue is that reach weapons aren't getting both diagonal squares, right? I think if you use the units argument (set to false) it just counts squares, and not in feet. That might solve the problem (melee attacks with reach would range out to two cells).

tsuuga
Kobold
Posts: 3
Joined: Sat Jan 24, 2009 6:14 pm

Re: [1.3b53] Add movement metric argument to getDistance()

Post by tsuuga »

Upon testing, it still uses the movement metric.

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Craig »

All distance functions at the moment depend on the same code that does movement, so distances are always tied to the maps movement metric. Its probably worth revisiting this in 1.4 but it defiantly falls into the "too big to change for 1.3 before it goes final" bucket.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Rumble »

I stand corrected. I only use one-one-one, so I made an erroneous assumption. In that case, I fully endorse "look at this in 1.4".

I wonder, could you use the "area" json-filtering option from getTokens() to brute-force the threatened area? I'm guessing that's still movement-metric based (is it a distance function?) but if not, that might be a solution.

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Craig »

Craig wrote:All distance functions at the moment depend on the same code that does movement, so distances are always tied to the maps movement metric. Its probably worth revisiting this in 1.4 but it defiantly falls into the "too big to change for 1.3 before it goes final" bucket.
Hold that thought, after belatedly having my morning coffee I see the solution and its not too big a change. Once again caffeine has shown the way.

Ok I think I can make the change to getDistance(), getDistanceToXY() and getTokens() functions and get it to Trevor before next build.

User avatar
zEal
Dragon
Posts: 944
Joined: Sun Mar 22, 2009 2:25 am

Re: [1.3b53] Add movement metric argument to getDistance()

Post by zEal »

Rumble wrote:I wonder, could you use the "area" json-filtering option from getTokens() to brute-force the threatened area? I'm guessing that's still movement-metric based (is it a distance function?) but if not, that might be a solution.
It wouldn't be pretty, but it should work.

Code: Select all

[h: ThreatenedTokens = getTokens('json', '{"visible":1,"area":"{"offsets":"[
    "{"x":0,"y":2}",
    "{"x":0,"y":1}",
    "{"x":0,"y":-1}",
    "{"x":0,"y":-2}",
    "{"x":1,"y":2}",
    "{"x":1,"y":1}",
    "{"x":1,"y":0}",
    "{"x":1,"y":-1}",
    "{"x":1,"y":-2}",
    "{"x":2,"y":2}",
    "{"x":2,"y":1}",
    "{"x":2,"y":0}",
    "{"x":2,"y":-1}",
    "{"x":2,"y":-2}",
    "{"x":-1,"y":2}",
    "{"x":-1,"y":1}",
    "{"x":-1,"y":0}",
    "{"x":-1,"y":-1}",
    "{"x":-1,"y":-2}",
    "{"x":-2,"y":2}",
    "{"x":-2,"y":1}",
    "{"x":-2,"y":0}",
    "{"x":-2,"y":-1}",
    "{"x":-2,"y":-2}"
]"}"}')]

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Re: [1.3b53] Add movement metric argument to getDistance()

Post by trevor »

contributed by Craig, applied to 1.3b55
Dreaming of a 1.3 release

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Craig »

I have updated the wiki with documentation on the new additions to b55 for this.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: [1.3b53] Add movement metric argument to getDistance()

Post by Rumble »

trevor wrote:contributed by Craig, applied to 1.3b55
sa-Weet.

tsuuga
Kobold
Posts: 3
Joined: Sat Jan 24, 2009 6:14 pm

Re: [1.3b53] Add movement metric argument to getDistance()

Post by tsuuga »

Awesome! :D
Thanks very much!

Post Reply

Return to “Resolved”