Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Tiles script (https://forums.graalonline.com/forums/showthread.php?t=26574)

neomaximus2k 03-29-2002 10:28 PM

Tiles script
 
[code]
if(tiles[playerx+1.5,playery+2]==1898){
[code]

Ok my question is this, how do i translate the tileset into the number at the end, say if i wanted grass how would i know what to put?

screen_name 03-29-2002 10:40 PM

NPC Code:

if (playerenters) {
message #v(tiles[x,y]);
}



i believe the grass tile is 511

neomaximus2k 03-29-2002 10:47 PM

Quote:

Originally posted by screen_name
NPC Code:

if (playerenters) {
message #v(tiles[x,y]);
}



i believe the grass tile is 511

I dont actually need that tile, it was an example, i need to know how to work them out

Jinx 03-29-2002 11:14 PM

I read somewhere awhile back how to do this.... can't remember any of it =/

-Jinx

Bhala 03-30-2002 03:47 AM

i know theres a simple way to find the tile number based on its place in the tiles by useing hex nums but i dont remember it

Gohan43331 03-30-2002 04:39 AM

NPC Code:

if (playerenters||timeout) {
message #v(tiles[x,y]);
timeout = .05;
}



Lay a bunch of tiles out, and then open notepad :D

Admins 03-30-2002 07:10 AM

When you move over a tile in the editor it
gives you the tile on the status bar on the lower
right corner. It gives you a (x,y), to convert it
to a tile number just do x+y*16, or in hex
0x[y as hex number][x as hex number]

Bhala 03-30-2002 09:14 AM

Oh so thats how lol

neomaximus2k 03-30-2002 04:44 PM

Quote:

Originally posted by Stefan
When you move over a tile in the editor it
gives you the tile on the status bar on the lower
right corner. It gives you a (x,y), to convert it
to a tile number just do x+y*16, or in hex
0x[y as hex number][x as hex number]

ok so the grass tile is x=15 y=31

so

15+31*16=511
or
(15+31)*16=736

neither one works, with that tile command so am i doing somet wrong?

screen_name 03-30-2002 11:53 PM

Quote:

Originally posted by Kaimetsu
The co-ords of grass are not that at all. They're (15,127).
i think he was using the x and y in the level :D

Kadar 03-31-2002 12:07 AM

Quote:

Originally posted by screen_name


i think he was using the x and y in the level :D

There are 3 grass tiles :)
all on the very bottom row..

screen_name 03-31-2002 12:23 AM

Quote:

Originally posted by Kadar

There are 3 grass tiles :)
all on the very bottom row..

yes i know, and i didnt mean to quote kai up above, some guy said that it wasn't working for him, he was using the level coordinates, not the tile set

konidias 03-31-2002 12:43 AM

Quote:

Originally posted by neomaximus2k


ok so the grass tile is x=15 y=31

so

15+31*16=511
or
(15+31)*16=736

neither one works, with that tile command so am i doing somet wrong?

You have to turn 511, or 736 into HEX and use the hex value. (just open up windows calculator, go in advanced mode, and switch from decimal to hex (after the number is shown in decimal) and it will convert it for you.

Or you can just put "15+31*16" in as the tile value, that works also.

Er1c 03-31-2002 01:25 AM

Try using
NPC Code:
updateboard x,y,width,height;

when you change the tiles on the board... and you don't have to use hex.

Neonight 03-31-2002 02:03 AM

Quote:

Originally posted by Stefan
When you move over a tile in the editor it
gives you the tile on the status bar on the lower
right corner. It gives you a (x,y), to convert it
to a tile number just do x+y*16, or in hex
0x[y as hex number][x as hex number]

Or, in Laymens (sp?) Terms:

Open a paint program that has a grid
Each tile is 16x16, just look at the number and divide it by 16...
I'm pretty sure that'll work.

screen_name 03-31-2002 02:19 AM

Quote:

Originally posted by Neonight


Or, in Laymens (sp?) Terms:

Open a paint program that has a grid
Each tile is 16x16, just look at the number and divide it by 16...
I'm pretty sure that'll work.


you are all making it harder than it has to be

nyghtGT 03-31-2002 02:41 AM

Re: Tiles script
 
Quote:

Originally posted by neomaximus2k
[code]
if(tiles[playerx+1.5,playery+2]==1898){
[code]

Ok my question is this, how do i translate the tileset into the number at the end, say if i wanted grass how would i know what to put?

do you have AIM ?

i can explain this better over AIM ...
i just learned how to properly do this too ...


All times are GMT +2. The time now is 02:00 PM.

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