Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   tiletype(x,y) (https://forums.graalonline.com/forums/showthread.php?t=53040)

zokemon 06-08-2004 09:00 AM

tiletype(x,y)
 
I can't seem to get it to work =/
Any suggestions?
It always says -1...
I tried ti when attached to the npc and when off the npc
tried it server and client side...
I don't know what else to do x_x

Andy0687 06-08-2004 10:03 AM

Never saw no other reason to use this before, but i gave it a shot.

No dice for me though, -1 all the way.

VeX_RaT_Boy 06-08-2004 11:19 AM

I did not test this, but might it be tiletype[x,y] ?

Or only working serverside/clientside?

I did not test this, I'm only giving suggestions.

zokemon 06-08-2004 11:55 AM

Nope for both of those =(

Python523 06-08-2004 12:40 PM

are you on a gmap

Ningnong 06-08-2004 03:25 PM

I just tested it online and it works. Gives 0 on non-blocking tiles, 11 in water, and 22 on blocking tiles.

edit: just tested it offline and it works also. Note: this is using the era tileset.

NPC Code:

//#CLIENTSIDE
if (created) timeout = .05;
if (timeout){
message #v(tiletype(playerx,playery));
timeout = .05;
}


Dach 06-08-2004 05:10 PM

tiletype( x, y ) returns the neworder tiletype used for setshape2 on x,y

Tiletype / tile index (use with setshape)
nonblock 0
hurt underground 2
chair 3
bed upper 4
bed lower 5
swamp 6
lava swamp 7
near water 8
water 11
lava 12
throw-through 20
jump stone 21
blocking 22


this be what I have in my commands.rtf, you're probably just not using a neworder tileset

Andy0687 06-08-2004 08:58 PM

Quote:

Originally Posted by Python523
are you on a gmap

I was, is that a problem x_x

Malinko 06-08-2004 11:05 PM

Quote:

Originally Posted by Ningnong
I just tested it online and it works. Gives 0 on non-blocking tiles, 11 in water, and 22 on blocking tiles.

Similar to setshape2, 0 = non-blocking, while 22 = blocking. Never knew 11 was water, but 3 = sitting/chair.

Ningnong 06-08-2004 11:44 PM

Yes.. setshape2 also uses tiletypes.

Python523 06-09-2004 01:36 AM

Quote:

Originally Posted by Andy0687
I was, is that a problem x_x

your x/y tends to be different on a gmap ;o plus if you wanna check if its water on a gmap just use getz and check the value

zokemon 06-09-2004 03:21 AM

I know how setshape2 works...
And yes it is on a gmap.
It is for my boat system.

[EDIT]
And this never returns a 0 or anything no matter what. Only -1.
[/EDIT]

Lance 06-09-2004 06:55 AM

And here I thought you had 'owned' gscript. Guess it is, after all, the other way around?

zokemon 06-09-2004 05:17 PM

Quote:

Originally Posted by Lance
And here I thought you had 'owned' gscript. Guess it is, after all, the other way around?

I had and now it had it's revenge on me.
Need to point out anymore obvious things?
And btw I figured it out (With Robin's help)
You have to be using a custom tileset for it to work right.

My alternative to all that want to know:
Instead of doing
NPC Code:
setshape2 x,y,{tiles};



Do this:
NPC Code:
this.shape={tiles};
setshape2 x,y,this.shape;



Then somewhere else in the script do something like:
NPC Code:
if (this.shape[int(playerx-x+0.5)*int(imgwidth(#f)/16)+int(playery-y+1)]=11) {commands;}


(You would use 11 if you wanted to check for water tile, you can change that ;P)

And again.
I am posting this to HELP PEOPLE who have this same problem and use the thing called "Search" and find this thread so they don't post the same topic.
Don't flame me for helping the scripting forum out -_-

Dach 06-09-2004 05:24 PM

Quote:

Originally Posted by zokemon
You have to be using a custom tileset for it to work right.

Quote:

Originally Posted by me
you're probably just not using a neworder tileset

good job reading my post there, :whatever:


All times are GMT +2. The time now is 12:41 PM.

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