Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-29-2011, 07:16 PM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
get the tile id at x,y?

I am trying to make a shovel system, and I realised I would need to determine if the tile is grass. I already know how to make it so it has to be not on a wall or on water, but I need to know how to tell if it is a certain tile(pure grass). I found tiletype, but that doesn't determine the exact tile.
Reply With Quote
  #2  
Old 05-29-2011, 07:28 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
posted something in the code gallery forever ago
http://forums.graalonline.com/forums...=findareatiles
Reply With Quote
  #3  
Old 05-29-2011, 07:36 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
Figure out what the grass tile is, then do

PHP Code:
if (player.level.tiles[xy] == 9999) { // replace 9999 with the grass tile 
To figure out what tile number grass has, do something simple like

PHP Code:
// press "t" to see what tile your mouse is hovering over
//#CLIENTSIDE
function onKeyPressed(temp.codetemp.key) {
  if (
temp.key == "t") {
    
player.chat "Tile: " player.level.tiles[mousexmousey];
  }

If your server has multiple grass tiles (or you want it to be possible to dig on sand or something), make an array of tiles and use in to see if the tile is in that array.
__________________
Reply With Quote
  #4  
Old 05-29-2011, 08:51 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
http://forums.graalonline.com/forums...ghlight=shovel

I made a shovel a few years ago
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:39 PM.


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