Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-12-2010, 01:23 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
findAreaTiles

I needed these momentarily for comparing tiles, doubt it will be of any help but who knows.

findAreaTiles returns a list of the tiles in the given area.
findAreaTiles2 returns a list of tiles in the given area and the x/y coordinates of said tiles in the following format "tile,x,y".

Parameters:
NPC Code:

findAreaTiles(x,y,width,height);
findAreaTiles2(x,y,width,height);



PHP Code:
function findAreaTiles(tx,ty,tw,th){
    for(
temp.i=0temp.< (tw*th); temp.i++){
      if(
temp.tw){
        
temp."0";
        
temp.j++;
      } else 
temp.q++;
      
temp.tilearray.add(tiles[tx+temp.q,ty+temp.j]);
    }
    return 
temp.tilearray;
}

function 
findAreaTiles2(tx,ty,tw,th){
    for(
temp.i=0temp.< (tw*th); temp.i++){
      if(
temp.tw){
        
temp."0";
        
temp.j++;
      } else 
temp.q++;
      
temp.tilearray.add(tiles[tx+temp.q,ty+temp.j] @ "," tx+temp."," ty+temp.j);

    }
    return 
temp.tilearray;


Last edited by Cubical; 03-12-2010 at 01:38 PM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:23 AM.


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