Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   arrays (https://forums.graalonline.com/forums/showthread.php?t=30512)

screen_name 06-01-2002 01:58 AM

arrays
 
i was wondering what the number before the array is for, ie


this.arrayname = 0/{-2,0,2,0}

??

amonrabr 06-01-2002 02:23 AM

Re: arrays
 
Quote:

Originally posted by screen_name
i was wondering what the number before the array is for, ie


this.arrayname = 0/{-2,0,2,0}

??

its the number that its not an array..

this.a=1;
this.a={5,5,5}

so:
this.a = 1/{5,5,5}

this.a=1;
this.a[0]=5;
this.a[1]=5;
this.a[2]=5;

Falcor 06-01-2002 02:36 AM

I wish we could use matricies :( using this
this.array[a+width*a] is getting tiresome. Id rather do
this.matrix[a][b]

But I think stefan is working on a more C++-ish Gscript. so All I can do is hope and wait.

BBflat 06-01-2002 02:51 AM

Quote:

Originally posted by Falcor
[B]I wish we could use matricies :( using this
this.array[a+width*a] is getting tiresome. Id rather do
this.matrix[a]

But I think stefan is working on a more C++-ish Gscript. so All I can do is hope and wait.

From what I heard, Stefan is avoiding any sort of object-oriented programming and C++ stuff. As far as I know, we won't get things like return functions, variable types, classes, switch statements, multidimensional vectors, etc. If we had them, we could do SO much more scripting-wise... =/

screen_name 06-01-2002 03:23 AM

well, lets see

is there a way to clear a variable array without having to do

this.array = {0};??

amonrabr 06-01-2002 04:19 AM

Quote:

Originally posted by screen_name
well, lets see

is there a way to clear a variable array without having to do

this.array = {0};??

setarray this.array,;

Falcor 06-01-2002 04:22 AM

this array={}; would probably work. although i never tried it. It might be more efficient then declaring the array all over again.

screen_name 06-01-2002 06:40 AM

o, dumb me, i should've figured that out, lol


thanks you guys


All times are GMT +2. The time now is 06:59 AM.

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