Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842
PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165
PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165
PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612
PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1
PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1
PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1
PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 85
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 85
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6 Tile is walkable help.. - Page 2
Can someone help me ?
I have USD 11,40 on paypal to give XD
They are not out of limit, never o_0
So I can't understand why this still occurs :/
(Look at the generated map by map-reading)
http://postimage.org/gallery/5exxjai/27da07c7/
The bug is on half of screen each X sqms
[code=Delphi]
Function Rel_Z(TileNum:integer):integer;
begin
Result := trunc( TileNum / (14 * 18) );
result := fixThreshhold(result, 8);
if not between(result, 0, 8) then showmessage('z: ' + inttostr(result));
end;
Function Rel_Y(TileNum:integer):integer;
begin
Result := trunc((TileNum - Rel_Z( TileNum ) * 14 * 18) / 18);
result := fixThreshhold(result, 14);
if not between(result, 0, 14) then showmessage('y: ' + inttostr(result));
end;
Function Rel_X(TileNum:integer):integer;
begin
Result := trunc(TileNum - Rel_Z(TileNum) * 14 * 18 - Rel_Y( TileNum ) * 18);
result := fixThreshhold(result, 18);
if not between(result, 0, 18) then showmessage('x: ' + inttostr(result));
end;
Function Abs_Z(TileNum:integer):integer;
begin
Result := p.Z + Rel_Z( tileNum ) - Rel_Z( PlayerTile );
end;
Function Abs_Y(TileNum:integer):integer;
begin
Result := p.Y + Rel_Y( tileNum ) - Rel_Y( PlayerTile );
end;
Function Abs_X(TileNum:integer):integer;
begin
Result := p.X + Rel_X( tileNum ) - Rel_X( playerTile );
end;
[/code]
Different languages handle non-float to floating point operations differently. All of you values are integers. I don't know delphi but its possible that extra floating point data is being discarded, making your math operate incorrectly. Try using float values to do the math and then using floor to make them int after all math is complete.
I wanna die :dodgy:
I looked on a old "maces quick fish", and even using his functions, the problem persist o___o
Look he did what you are saying, first do the maths and after floor/trunc the value :0
[code=Delphi]
function Rel_Z(ATileNum: Integer): Integer;
var
vValue: Extended;
begin
vValue := ATileNum / (14 * 18);
Result := Trunc(vValue);
end;
function Rel_Y(ATileNum: Integer): Integer;
var
vValue: Extended;
begin
vValue := (ATileNum - Rel_Z(ATileNum) * 14 * 18) / 18;
Result := Trunc(vValue);
end;
function Rel_X(ATileNum: Integer): Integer;
var
vValue: Extended;
begin
vValue := (ATileNum - Rel_Z(ATileNum) * 14 * 18 - Rel_Y(ATileNum) * 18);
Result := Trunc(vValue);
end;
[/code]
Even TibiaAPI do the same:
[code=C#]
public static Location ToMemoryLocation(this uint tileNumber)
{
Location l = new Location();
You didn't change shit. Your inputs are still integers and will be treated as integers, regardless of where the result is being moved to or what type it is. Cast your inputs to float. Also, like I said, floating point math is usually handled different for different languages, so what TibiaAPI does is irrelevant. If floats don't work and you're correctly fixing the "threshhold," I have no clue what to tell you, because the code I've shown works for me.
Darkstar, now I understood the *** I did XD
The problem is that I was trying to map read with the 4 parts from TibiaAuto's article, and I never got the part 5 and it's utility...
Today I though: "It would be strange exist a useless part"
Then I tried to undestand and I looked at more examples at TibiaAPI and Blequi tutorial...
Finally *_*
Thanks everyone )
#############
So, if you are getting the same problem, try the Darkstar's solution.
If the problem persists, try to convert XYZ to tileNumber, then loop
though the tiles, check if the number = tileNumberStored and do what you want