Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Tile Manipulation Help! (https://forums.graalonline.com/forums/showthread.php?t=134264802)

Astram 10-14-2011 10:32 PM

Tile Manipulation Help!
 
Hi, I've been learning how to manipulate tiles lately. But I don't know how to change tiles. Etc. Lets say you want to make all the green rocks in the level be black rocks. Or turn all the grass in to water. How would I do that? Please help.

cbk1994 10-15-2011 12:14 AM

Look at this. Also look at the various level editors posted in the code gallery.

scriptless 10-15-2011 12:26 AM

PHP Code:

//#CLIENTSIDE
function onCreated() {
  for ( 
i=0i<64i++ ) {
    for ( 
j=0j<64j++ ) {
      if ( 
tiles[i,j] == ) {
        
tiles[i,j] = 0;
      }
    }
  }
  
updateboard(...);


Something along those lines.

Astram 10-15-2011 04:27 PM

But how do I change the tiles @ tiles[i,j]?

iBeatz 10-15-2011 06:11 PM

Quote:

Originally Posted by Astram (Post 1670944)
But how do I change the tiles @ tiles[i,j]?

Just do what scriptless did above, but change the value for the tile equality check and the tile value setting.

ie.
PHP Code:

tiles[i,j] = 0x0;   // Top left tile in the tileset 

Tile hex values can be found using GraalEditor.exe.

Astram 10-17-2011 04:19 AM

How do I find hex values...

scriptless 10-17-2011 04:47 AM

I think the hex values are in the "tilearray" button in the offline level editor. Tho the editor itself seems to crash alot on my pc. It just seems to never open but runs as a process.. =/

Tricxta 10-17-2011 06:26 AM

scriptless is correct, you just press this button:
http://i.imgur.com/U4icf.gif

It's nifty because it puts the tiles into the array format straight away :)


All times are GMT +2. The time now is 02:51 PM.

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