Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Arrays and tiles[x,y] (https://forums.graalonline.com/forums/showthread.php?t=15399)

Thak2 10-25-2001 02:26 AM

Arrays and tiles[x,y]
 
How would I go about making an array store multiple values for the tiles command?

For example, I tried something like this:
NPC Code:

if (weaponfired) {
this.tilesid= {2047,116};
if (tiles[playerx,playery]==this.tilesid) {
setplayerprop #c,this works;
}
}



Why does this not work? What is the proper way of doing this?

Faheria_GP2 10-25-2001 05:13 AM

Re: Arrays and tiles[x,y]
 
Quote:

Originally posted by Thak2
How would I go about making an array store multiple values for the tiles command?

For example, I tried something like this:
NPC Code:

if (weaponfired) {
this.tilesid= {2047,116};
if (tiles[playerx,playery]==this.tilesid) {
setplayerprop #c,this works;
}
}



Why does this not work? What is the proper way of doing this?

if (this.tilesid=0) message this is right;
if (this.tilesid[0]=2047) message and so is this;
if (this.tilesid[1]=116) and this;

TDO2000 10-25-2001 05:16 AM

never tried the tiles-command before so I can't tell u the right way but this can't work because the array
this.tilesid is not seen as 2047,116
no every number in an array is seen as an single element

so this.tilesid[0] is 2047 and this.tilesid[1] is 116

BocoC 10-25-2001 06:17 AM

NPC Code:

if (weaponfired) {
this.tilesid={2047,116};
if (tiles[playerx,playery] in this.tilesid) {
setplayerprop #c,this works;
}
}


That will make it work.

Thak2 10-25-2001 07:58 AM

Thanks Boco, works quite good now.

Saga2001 10-26-2001 03:39 AM

ok where did tiles[x,y] come from? and why didn't you tell me?

Signed,
Rogue Shadow

Slaktmaster 10-26-2001 04:00 AM

new stuff to replace board[STUDIP NUMBERS ERE]

Aknts 10-26-2001 04:02 AM

Thak what tiles are those supposed to be?

TDO2000 10-26-2001 04:13 AM

Some special top secret tiles, never seen before better then everything else ;D

btedji 10-26-2001 04:44 AM

Quote:

Originally posted by Saga2001
ok where did tiles[x,y] come from? and why didn't you tell me?

Signed,
Rogue Shadow

introduced in 2.1

Saga2001 10-26-2001 06:55 AM

Quote:

Originally posted by btedji


introduced in 2.1

lol that explains it I don't have 2.1

and I have no clue where to get it.

I keep hearing about it. and how everyone knows about it.

but I don't know where to get it :mad:


All times are GMT +2. The time now is 07:19 AM.

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