Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Weird scripting bug (https://forums.graalonline.com/forums/showthread.php?t=134264422)

scriptless 08-30-2011 11:54 PM

Weird scripting bug
 
So is there any reason this is not working properly?

PHP Code:

0x7FF 512 

Output
PHP Code:



It should be 8 ????

Mark Sir Link 08-30-2011 11:58 PM

Quote:

Originally Posted by scriptless (Post 1666297)
So is there any reason this is not working properly?

PHP Code:

0x7FF 512 

Output
PHP Code:



It should be 8 ????

actually it's more like 3.9 something and I guess GScript is truncating it into an int rather than rounding (int cast) so it is becoming 3.

EDIT:

GScript isn't truncating it so it must be you.

echo(0x7FF / 512);

output

3.998046875

scriptless 09-01-2011 03:36 AM

Weird, 0x7FF = 4096.. Hex to Dec.. and 512 is DEC.. might graal be converting a dec to hex then calculating? Because I wasn't sure of any commands to convert hex/dec values. =/

Notice the lack of "0x" on 512.. o.O

Tolnaftate2004 09-01-2011 04:05 AM

Quote:

Originally Posted by scriptless (Post 1666541)
Weird, 0x7FF = 4096..

0x7FF = 2047.

scriptless 09-01-2011 04:38 AM

Quote:

Originally Posted by Tolnaftate2004 (Post 1666544)
0x7FF = 2047.

Right, but there are 7FF tiles in graal's tileset.. looking at the tiles data ???

As a matter of fact, you have 64 x 64 tiles, and u can use every tile on the tileset in the level no left over.. perfectly.

64 x 64 = 4096... and it goe's in order.. o_o

DustyPorViva 09-01-2011 04:46 AM

Quote:

Originally Posted by scriptless (Post 1666547)
Right, but there are 7FF tiles in graal's tileset.. looking at the tiles data ???

As a matter of fact, you have 64 x 64 tiles, and u can use every tile on the tileset in the level no left over.. perfectly.

64 x 64 = 4096... and it goe's in order.. o_o

Graal tileset ends at 0xFFF, not 0x7FF.

scriptless 09-01-2011 05:03 AM

Quote:

Originally Posted by DustyPorViva (Post 1666548)
Graal tileset ends at 0xFFF, not 0x7FF.

But the bottom right tile is 0x7FF .. im confused.. lol

DustyPorViva 09-01-2011 05:10 AM

Quote:

Originally Posted by scriptless (Post 1666553)
But the bottom right tile is 0x7FF .. im confused.. lol

When I checked the bottom right is 0xFFF. 0x7FF is the mid-way point of the tileset, the grass tile to be specific.

scriptless 09-01-2011 05:21 AM

Oh, you're right. For some reason it wasn't showing the correct tile in the tile array data in the editor.. =/ *sigh* well that makes things MUCH easier =/


All times are GMT +2. The time now is 03:11 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.