Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Arrays(tiles, direction, ext...) (https://forums.graalonline.com/forums/showthread.php?t=33208)

emortylone 07-10-2002 01:10 AM

Arrays(tiles, direction, ext...)
 
Okay, I've seen a lot of scripts using arrays for direction and movement. I have never tried arrays, so i was wondering if anyone could help me with how to use them for things such as detecting tiles, such as grass tiles and using them for onwall detection.

adam 07-12-2002 06:47 PM

Re: Arrays(tiles, direction, ext...)
 
Quote:

Originally posted by emortylone
Okay, I've seen a lot of scripts using arrays for direction and movement. I have never tried arrays, so i was wondering if anyone could help me with how to use them for things such as detecting tiles, such as grass tiles and using them for onwall detection.
You know that's a good idea.

I'll get back to you when I actually have time to do that.
(work // school) :(

adam 07-14-2002 05:29 AM

NPC Code:

if (weaponfired){
setarray this.check_tiles,3;
setarray this.chang_tiles,3;
this.check_tiles = { 1652,1653,1668,1669};
this.chang_tiles = { 1802,1803,1818,1819};
for (this.t=0;this.t<64+64*64;this.t++){
for (j=0;j<arraylen(this.check_tiles);j++){
if (board[this.t]==this.check_tiles[j]){
board[this.t]=this.chang_tiles[j];
}elseif(board[this.t]==this.chang_tiles[j]){
board[this.t]=this.check_tiles[j];
}
}
}
updateboard 0,0,64,64;
}




This will work.... but only on half of the level.

don't ask me why I don't know. :( if you notice anything wrong with it tell me.

I would use x and y but that would require a 3 nested loops. That doesn't work for some reason.


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

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