Graal Forums

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

CyberFly 03-19-2004 07:22 PM

Tiles??
 
i think this might have alot to do with math. im not that good in math. lets say i want the tilenumber thats supposed to be in tiles[x,y]=tilenumber; to be the pics1.png pxel starting at pixel-x 1120 and pixel-y 416.

-Ramirez- 03-19-2004 07:27 PM

Re: Tiles??
 
You can place the tile in the level, select it, then click "Export Tiles Array" to see the hex value of the tile. It can be used directly in scripts in comparison with a tiles[x,y] value.

WanDaMan 03-19-2004 07:41 PM

I think it would be good if
Stefan made a onwall command and offwall
Like
onwall=0-345,0-346; and such and
offwall=0-342,0-343; If you get me,Would be easier and understandable i beleve.

tlf288 03-19-2004 08:44 PM

Quote:

Originally posted by WanDaMan
I think it would be good if
Stefan made a onwall command and offwall
Like
onwall=0-345,0-346; and such and
offwall=0-342,0-343; If you get me,Would be easier and understandable i beleve.

I agree (partly). If there was a file stored on the server named, lets say tiles.ini, then you could store on/offwall tile indeces like so:

NPC Code:

;Sections:
; onwall - tiles that are onwall
; water - tiles that are water
;
;all other tiles are considered regular walkable tiles
[onwall]
87,1023,154,674

[water]
67,98,1006,442



Then to expand it even more you could set sections that set a flag to true for custom ingame settings, such as:

NPC Code:

in tiles.ini
[tileFlag1]
34,82,10,67

in a gani script
if (tileFlag1)
// do special effect type things



Of course there would be many more tile indeces under each section, but you get the idea.

This is for those that say just script a new movement system:
Lets face it, scripting a movement system is really really hard. Although scripting a movement system is the best approach, with all the new servers and seemingly lack of talent this seems to be the easiest approach for customizing the movement system.

WanDaMan 03-19-2004 08:47 PM

I agree, it'd be alot easyier :)

CyberFly 03-20-2004 03:15 AM

Re: Re: Tiles??
 
1 Attachment(s)
Quote:

Originally posted by -Ramirez-
You can place the tile in the level, select it, then click "Export Tiles Array" to see the hex value of the tile. It can be used directly in scripts in comparison with a tiles[x,y] value.
thats not what i mean!!!!

You know pics1.png? if you have the pixel-x 0 and pixel-y 16 there, you start on the flower. pixel-x 640 and pixel-y 432 is the snow flower!

Is there a way to get from those, to tiles[x,y]= number?


I have attached an image so you can see it better..

Riot 03-20-2004 03:23 AM

You mean like these?
http://forums.graal2001.com/forums/s...threadid=50030

http://forums.graal2001.com/forums/s...threadid=50006

Otherwise the hex values is the tiles[x,y] values.

-Ramirez- 03-20-2004 03:29 AM

Re: Re: Re: Tiles??
 
Quote:

Originally posted by CyberFly
Is there a way to get from those, to tiles[x,y]= number?
Do you mean convert the pixel coordinates to the hex value that the level editor gives you? If so, I know there's a way, but I don't know it off the top of my head.

Dach 03-20-2004 07:40 AM

Quote:

Originally posted by tlf288


This is for those that say just script a new movement system:
Lets face it, scripting a movement system is really really hard. Although scripting a movement system is the best approach, with all the new servers and seemingly lack of talent this seems to be the easiest approach for customizing the movement system.

I made the one on Adiarde in the past like 3 days. It's got some (quite) minor bugs, but overall it is very nice.

but anyway, what are you guys suggesting exactly? I'm not sure I get it..

tlf288 03-20-2004 08:13 AM

Quote:

Originally posted by Dach


I made the one on Adiarde in the past like 3 days. It's got some (quite) minor bugs, but overall it is very nice.

Your a very talented scripter though. I'm not sure if you're suggesting that everyone else should script their own. But if you are, you are wrong. Otherwise, sorry for my previous statement. :)


Quote:

but anyway, what are you guys suggesting exactly? I'm not sure I get it..
If you are asking me:
Ok, say a file named tiles.ini is stored on a server. Graal downloads it and parses all the information in it (look at my previous post). Then decides what tiles are onwall/water/etc.

WanDaMan 03-20-2004 12:06 PM

Re: Re: Re: Tiles??
 
Quote:

Originally posted by CyberFly

thats not what i mean!!!!

You know pics1.png? if you have the pixel-x 0 and pixel-y 16 there, you start on the flower. pixel-x 640 and pixel-y 432 is the snow flower!

Is there a way to get from those, to tiles[x,y]= number?


I have attached an image so you can see it better..

No it's not..
Each tile is 16 pixels, 16 x the number across (the number of tiles). Then do the same for the length; thats how I get the x and y (for addtiledef2).
if(tiles[playerx,playery] == value here){
Don't carry on like this :
if(tiles[playerx,playery] == value here || another || another ||etc) {
Add it into an array it's alot more better to read and all.
Well anyways I'll give you an example so that if they are on a specific tile something will happen. If some one hasn't posted by the time I get on my other computer I'll edit my post. Other than that I'll make a new post.

Loriel 03-20-2004 12:59 PM

tiles[foo, bar] = pixel_x / 16 + pixel_y;
If I remember correctly.

WanDaMan 03-20-2004 04:52 PM

foo?
bar?

VeX_RaT_Boy 03-20-2004 06:12 PM

I think I know what you mean...check my script in the "Npc Showoff" thread!

tlf288 03-20-2004 08:19 PM

Quote:

Originally posted by WanDaMan
foo?
bar?

Same as [x, y], [i, j], or [horizontalAxis, verticalAxis]. Just variable names.


All times are GMT +2. The time now is 05:46 PM.

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