HelpUntruncating mouse position for useitem packets

Posts 1–4 of 4 · Page 1 of 1
Untruncating mouse position for useitem packets
The USEITEM packet sends floats for the coordinates for itemUsePos, and if you use realm relay to modify them you can actually use your ability anywhere. But if you use the ability in game normally, the position is always on a tile, a whole number. If you don't know what I'm talking about make a trickster and try using your ability in between two tiles, instead of the center (Also look at this http://i.imgur.com/k9oBBYj.gif). You can't unless you change it with realm relay.

I tried looking in the client for where it retrieves the cursor's coordinates for making the packet, but had little success.

Anyone know how to fix this?
Quote Originally Posted by 059 View Post
The USEITEM packet sends floats for the coordinates for itemUsePos, and if you use realm relay to modify them you can actually use your ability anywhere. But if you use the ability in game normally, the position is always on a tile, a whole number. If you don't know what I'm talking about make a trickster and try using your ability in between two tiles, instead of the center (Also look at this http://i.imgur.com/k9oBBYj.gif). You can't unless you change it with realm relay.

I tried looking in the client for where it retrieves the cursor's coordinates for making the packet, but had little success.

Anyone know how to fix this?
Well, if you look how this works you can see why, it's cycling trough tiles and looking only at their center, then picking the closest to convert from sprite coords to world ones. Redoing this... eh...

Code:
public override function pSTopW(spriteX:Number, spriteY:Number):flash.geom.Point {
	var tile:*=null;
	var squares:*=this.mapSquares;
	for each (tile in squares) {
		if (!(tile.faces_.length == 0) && tile.faces_[0].face_.contains(spriteX, spriteY)) {
			return new flash.geom.Point(tile.center_.x, tile.center_.y);
		}
	}
	return null;
}
Quote Originally Posted by Knorrex View Post
Well, if you look how this works you can see why, it's cycling trough tiles and looking only at their center, then picking the closest to convert from sprite coords to world ones. Redoing this... eh...

Code:
public override function pSTopW(spriteX:Number, spriteY:Number):flash.geom.Point {
	var tile:*=null;
	var squares:*=this.mapSquares;
	for each (tile in squares) {
		if (!(tile.faces_.length == 0) && tile.faces_[0].face_.contains(spriteX, spriteY)) {
			return new flash.geom.Point(tile.center_.x, tile.center_.y);
		}
	}
	return null;
}
So, instead of finding what tile is closest to the mouse position, could you just make it return the mouse position?

What are sprite coords, the actual x/y of the mouse on the flash stage?
Quote Originally Posted by 059 View Post
So, instead of finding what tile is closest to the mouse position, could you just make it return the mouse position?

What are sprite coords, the actual x/y of the mouse on the flash stage?
Yes, not really useful alone
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us