Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-26-2011, 05:17 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
tiles[ x, y, w, h]

I know about getting the tile of a certain location with tiles[ x, y], but is there a way to return an array of them, making my own tileset and I cant find any documentation on this. Basically replicating onwall2 but with other tiles which might not be block on the default tiletype 0,1.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #2  
Old 03-26-2011, 05:29 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by MrOmega View Post
I know about getting the tile of a certain location with tiles[ x, y], but is there a way to return an array of them, making my own tileset and I cant find any documentation on this. Basically replicating onwall2 but with other tiles which might not be block on the default tiletype 0,1.
None that I know of. You'd have to use loops.
__________________
Reply With Quote
  #3  
Old 03-26-2011, 05:41 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Yea that's what I'm doing just was hoping there was a more efficient way. Do you know a better way than this

PHP Code:
function onBlocktemp.sXtemp.sYtemp.eWtemp.eH)
{

  
temp.block false;

  for ( 
temp.0temp.temp.eWtemp.++;)
  {
  
    if ( 
temp.block)
      break;
  
    for ( 
temp.0temp.temp.eHtemp.++;)
    {

      
temp.test player.gmap.tilelayers1].tilestemp.sX temp.atemp.sY temp.b];
  
      if ( 
temp.test in this.blockTiles)
      {
      
        
temp.block true;
        break;
        
      }   
    }
  }
   
  return 
temp.block;


__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 03-26-2011 at 06:03 PM..
Reply With Quote
  #4  
Old 03-26-2011, 06:48 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
thats so wrong?

HTML Code:
function getTilesArea(x, y, w, h) {
  for (temp.i = temp.x; temp.i < temp.x + temp.w; temp.i++) {
    for (temp.e = temp.y; temp.e < temp.y + temp.h; temp.e++) {
      temp.tiles.add(level.tiles[temp.i, temp.e]);
    }
  }
  showpoly(200, {
    x, y,
    x + w, y,
    x + w, y + h,
    x, y + h});
  changeimgvis(200, 3);
  
  return temp.tiles;
}
I think it works
__________________
Reply With Quote
  #5  
Old 03-26-2011, 06:50 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Looks fine to me, not sure why you're using temp.block though.

PHP Code:
function onBlocktemp.sXtemp.sYtemp.eWtemp.eH)
{
  for ( 
temp.0temp.temp.eWtemp.++;)
  {
  
    for ( 
temp.0temp.temp.eHtemp.++;)
    {

      
temp.test player.gmap.tilelayers1].tilestemp.sX temp.atemp.sY temp.b];
  
      if ( 
temp.test in this.blockTiles)
      {
        return 
true;
      }   
    }
  }
   
  return 
false;


Your formatting sucks, by the way...
__________________
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 01:36 PM.


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