Tasks that are Easy Enough for newcoming programmers
#35
(06-21-2013, 04:44 PM)xoft Wrote: I think the problem is in a different thing. The Y coords are based at lowest entity points, so the distance from the pickup is measured to the player's feet. It might be better to measure distance to torso, at Y + 1, this should provide much better results and won't need the extra condition.

That still wouldn't solve the problem as it's not a problem with the player but with the dropped items. The items have the same Y coordinate when they are on slabs as when they are on the ground instead of having a .5 Y coordinate.

In other words, the Y coordinates of items are always integers.

In addition, a problem is that a sphere is being used to test distance for pickup, so there will always need to be an extra clause unless the square distance method is revised because the player should be able to pick up at 1.5 blocks away horizontally, blocks 1.5 above the feet, and .6 blocks below the feet. So you see 2 of these are 1.5, so they are already consolidated in one condition. If you change the measurement from the middle of the torso, you will need 3 separate checks, because it will be 1.5 laterally, .5 up from the torso (if torso is 1 above the ground), and 1.6 below torso.

I tested this for a few hours. The items Y coordinates of items on the ground are definitely bugged, so even if we measure from the torso, the problem won't be solved.
Reply
Thanks given by:


Messages In This Thread
RE: Tasks that are Easy Enough for newcoming programmers - by Stephen304 - 06-22-2013, 12:06 AM



Users browsing this thread: 2 Guest(s)