As explained here: http://forums.rptools.net/viewtopic.php?f=3&t=8214
I'm trying to use moveToken on a vertical hex grid (the kind where the sides are flat up and down) and it's, well, not working properly.
[moveToken(6,-3)] = 6,-3 (correct...)
[moveToken(4,2)] = 3,2 (wait...)
[moveToken(2,1)] = 1,1 (no...)
[moveToken(0,5)] = -1,5 (huh?)
[moveToken(0,-4)] = -1,-5 (off by two? actually one and one)
[moveToken(-2,-1)] = -3,-2 (off by one and one again)
[moveToken(-2,2)] = -4,2 (off by a FULL two!!!)
[moveToken(34,32)] = 38,32 (now it's 4, distance from 0 seems to make it worse?)
[moveToken(-33,-39)] = -39,-40 (that's 6, plus 1 on the Y axis)
To which I say... Craig? Anyone? Bueller?
BUG: [b54] moveToken() does not move properly on hex grid
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: BUG: [b54] moveToken() does not move properly on hex grid
Working with grids is painful!!!
Yeah its a bug, I also noticed its not the only bug in the movement/distance code. Its using pixels per cell instead of distance per cell, I need to fix these things.
Gah
Yeah its a bug, I also noticed its not the only bug in the movement/distance code. Its using pixels per cell instead of distance per cell, I need to fix these things.
Gah
Re: BUG: [b54] moveToken() does not move properly on hex grid
Ok I think I have the problem sorted out.
I would really appreciate it if a couple of people who have the source could download and apply the patch with square, hex, no grid both using 1 and some other number for distance per cell, so that I get a couple more tests apart from the ones I have done and don't fall into the trap of only testing the bits that worked
functions that need testing
Wiki: getDistance()
Wiki: getDistanceToXY()
Wiki: moveTokenToMap()
Wiki: moveTokenFromMap()
Other functions which are also affected (but use the code from one of the above functions, so if they work these should work).
Wiki: getTokens() (json version using range and area)
Wiki: moveToken()
Wiki: copyToken()
I would really appreciate it if a couple of people who have the source could download and apply the patch with square, hex, no grid both using 1 and some other number for distance per cell, so that I get a couple more tests apart from the ones I have done and don't fall into the trap of only testing the bits that worked
functions that need testing
Wiki: getDistance()
Wiki: getDistanceToXY()
Wiki: moveTokenToMap()
Wiki: moveTokenFromMap()
Other functions which are also affected (but use the code from one of the above functions, so if they work these should work).
Wiki: getTokens() (json version using range and area)
Wiki: moveToken()
Wiki: copyToken()
Re: BUG: [b54] moveToken() does not move properly on hex grid
I'll have a look at it when I get home tonight, having triggered this whole affair by accidentCraig wrote:I would really appreciate it if a couple of people who have the source could download and apply the patch with square, hex, no grid both using 1 and some other number for distance per cell, so that I get a couple more tests apart from the ones I have done and don't fall into the trap of only testing the bits that worked
By the way, I just noticed the wfunc and wiki and wroll and wsearch tags for the forum. Those are, I'm pretty sure, new. Do we have documentation on those? On the wiki, perhaps?
- trevor
- Codeum Arcanum (RPTools Founder)
- Posts: 11311
- Joined: Mon Jan 09, 2006 4:16 pm
- Location: Austin, Tx
- Contact:
Re: BUG: [b54] moveToken() does not move properly on hex grid
Patch from Craig applied for 1.3b56
Dreaming of a 1.3 release