Quote:
Originally posted by Er1c
I think I know what you're asking for... you want to be able to change all of one kind of tiles to a different kind.
All you need to do is make two arrays, use this.tile1 and this.tile2.
Then in this.tile1 make the array of all the tiles that you want the NPC to look for that should be changed, and in this.tile2 list all of the tiles (corrisponding to the other tiles) that the tiles in this.tile1 should turn into. When you list the tiles, you need to list them like this: tilex+tiley*16.
I'll make the NPC and put some comments in for you, dont just copy it, try to learn it for your self...
NPC Code:
for (cx = 0;cx<64;cx++) for (cy = 0;cy<64;cy++) { //will check every tile in the level
if (board[cx+64*cy] in this.tile1) {//checks if the current tile being checked is supposed to be replaced
for (i = 0;i<arraylen(this.tile1);i++) {//this for statment will find where in this.tile1 the current tile is
if (board[cx+64*cy]==this.tile1[i])
break;//stops the loop keeping i equal to the position of the tile to replace
}
board[cx+64*cy] = this.tile2[i]//replaces the tile with the new one specifyed in this.tile2
updateboard cx,cy,1,1;//updates the board to make the changes noticable
}
}
Well I haven't tryed this out, so tell me if it works or not... hope that answers your question and that you learn from it instead of steal it.
|
grr every time i look at that it makes me angry

from now on, i ask that no one attempt to help me in script unless you better then me in script....*rings kai bell* come help Soul Blade with how to put letters for tiles and make it shorter!