when using multiple occurances of the FOR command (EXAMPLE: for (i=0; i<10; i++)), does it matter what letter you use, or not? I feel silly asking after having worked with Gscript since 2002, but I was never sure, so I use different letters to be safe:
for (i=0; i<10; i++)
for (j=10; j<20; j++)
for (k=20; k<30; k++)
Ect…
I've noticed scripts work whether you use the same letter multiple times or not, but I want my scripts to be done right, not just simply work.
Ah, alright, thanks. I've yet to have issues using var instead of this.var, but I'll update my code before issues do arrise. Knowing my luck, they'd arrise at the point where I'll want to slam my head into the keyboard at the thought of how much I'd have to fix, lol
NPC#2 is on a timeout and also happens to use the variable 'Active' to know what mode its supposed to use as well.
NPC#2 is supposed to be dead, his “Active = 3”
NPC#1 does Active = 1 for some reason or another, which was intended for itself only (a this.var)
NPC#2 loops and sees that Active = 1, NPC#2 now goes on a player killing spree with 0 hearts and invulnerability.
Well, I use this.var plenty, I ment I don't tend to use them in for () blocks of code, lol. But I do see what you're saying, and I can see where for () can potentially cause issues using var over this.var
Is there any this. prefixs for strings? Like I know of client.string and server.string, but i'm wondering if theres one to exclusively save words just for the current npc.
Or even is it possible to save words to normal this.vars, I only seem to get them to work for numbers. Unless theres a special # thing to go before them. I only know #v value and #s for string.
All strings with exception to server.strings, set onto the player.
Atleast until GS2 where there is an actual this.string = “string”; and it sets onto the NPC, not the player.
If you do say
“omg setstring this.string,string; works!” or “omg setstring client.string,string; works!”
That is because Graal is treating it as “this.string”, not this.“string”.