Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   ...array thing? (https://forums.graalonline.com/forums/showthread.php?t=68834)

_Z3phyr_ 09-20-2006 09:39 PM

...array thing?
 
So anyway... I don't want to flood the 'Script Flags' tab with a bunch of different variables that aren't too important. I decide to make an array for a list that will keep count of an item when the weirdest discovery is made:

client.array[1]++;
and
client.array[variablehere]++;
^ ^ both incorrect???

but
client.variable++;
^ ^correct



my question:
"wtf?", and/or "how can I get around this without flooding the Script Flags tab? I was thinking of using tokens but then again that's an array too aint it?"

tokens[i]++;
^ ^incorrect

KuJi 09-20-2006 09:42 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1219924)
So anyway... I don't want to flood the 'Script Flags' tab with a bunch of different variables that aren't too important. I decide to make an array for a list that will keep count of an item when the weirdest discovery is made:

client.array[1]++;
^ ^incorrect???

but
client.variable++;
^ ^correct



my question:
"wtf?", and/or "how can I get around this without flooding the Script Flags tab? I was thinking of using tokens but then again that's an array too aint it?"

tokens[1] += anything;
^ ^incorrect

Does client.array exist already? If not, try setarray or client.array = {0, 0};

contiga 09-20-2006 10:14 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1219924)
client.array[1]++;
and
client.array[variablehere]++;
^ ^ both incorrect???

PHP Code:

client.array = new[ 2];
increaseVar13);
function 
increaseVarindby)
  
client.array[ ind] += by

client.array is now 0,3

_Z3phyr_ 09-20-2006 11:20 PM

Nice I can respond as frequently as I want now! (or until unixmad and them fix the thing...)

I figured out the problem myself yall. I appreciate the attemps/help/"hmphs", though.



Apparently array[index]+=1 works but array[index]++ doesnt.

KuJi 09-20-2006 11:26 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1219989)
Nice I can respond as frequently as I want now! (or until unixmad and them fix the thing...)

I figured out the problem myself yall. I appreciate the attemps/help/"hmphs", though.



Apparently array[index]+=1 works but array[index]++ doesnt.

Hey.. didnt i pm you += 1 instead of ++?

_Z3phyr_ 09-21-2006 12:25 AM

In order to fix my problem, I had to make declare the variable in a seperate NPC instead of in the NPC that I wanted to use the array in.

I don't know wtf is up, but I found a solution. +=1 didn't work on the NPC that I was trying to work with it in, and even in the second NPC that I used to declare it beforehand wouldn't let ++ work.

So yeah.

Admins 09-21-2006 12:59 AM

There shouldn't be such problems. Client.vars are special though. For checking what the problem is I would need the full script or at least the part that is doing the logic.

_Z3phyr_ 09-21-2006 02:47 AM

Would you like me to forum PM it to you or something?

contiga 09-21-2006 08:35 AM

Quote:

Originally Posted by _Z3phyr_ (Post 1220069)
Would you like me to forum PM it to you or something?

Just post it in here, maybe we response faster then Stefan, he's a busy man ^^

_Z3phyr_ 09-21-2006 01:58 PM

>_> No thanks, Mr."Let me into Delteria Dev or else I won't work for you" -- I'm good.

issue solved. fermez ce thread svp?


All times are GMT +2. The time now is 10:22 PM.

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