![]() |
Tile Checking
As I'm trying to fix the shovel on Zenkou, which I'm almost done fixing for the known bugs, I need to know how to check if one tile is in the same level as another.
I know it sounds wierd but let me explain. If you're digging for a shell (diggable in sand only) and you're in the middle of the jungle and dig on sand, you can still get a shell. That's kind of improbable in real terms. So what I'm trying to do is find out how to check in the sand tile is in the same level as a deepwater tile. All I really need to know is how to check the tile in a script. For example, these 2 tiles are grass tiles on Zenkou. PHP Code:
This is confusing to me because I've never worked with tiles I didn't already have in a script. What I'm asking for is help with figuring out what a certain tile is. |
Well you can run a loop when the player enters a level like...
PHP Code:
An even simpler method would just be using level.vars! |
Quote:
|
Quote:
|
Quote:
|
Heh... nothing. Typically it's for delta but there is no delta in this case.
Tiles[x,y] is what you're looking for... which is the same. Now what you do is... tiles[x,y](x and y are... well, the x and y you're checking) == hex. So... if (tiles[x,y] in {0x31,0x1A4}) {} Would check if the tiles at the given position match what you provided in the original post. |
Quote:
You use tiles[x, y] to check the number (as above) of the tile at x, y in the current level. You can compare it against the number of your water tile or whatever. Checking whether a given tile is present in the current level is not going to get any easier than for-loops to check every tile on its own. Just put it into a function. It might be easier to just flag all levels that are supposed to yield shells by putting an NPC that does something like level.canDigForShells = true, or however that works. |
yes but this will be a fairly large list of levels, given the style of our playerworld. completed, this list could top 300+
i guess an alternative we could do is to rename all the levels that would have seashells to end with beach.nw i guess that wouldnt take to long, and then also we would have to edit the gmap file. anything else with this solution? |
You could just drop a
PHP Code:
Or, you could check outwards from the point to a certain radius on the tiles. PHP Code:
Probably the first way would be easier. |
Quote:
Quote:
|
Quote:
|
All times are GMT +2. The time now is 06:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.