View Single Post
  #4  
Old 09-03-2003, 04:54 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Re: Brief explanations about some new features: (NEW SCRIPT ENGINE)

Quote:
Originally posted by protagonist
The new commands are so C-ish.
"Quotified for quotability"

Quote:
Originally posted by Python523

except in gscript, it is
for (b: a)

what it is doing, is taking each instance of the array a, and assigning it as the value b, it can be the equivilent of

NPC Code:

for (i=0; i<arraylen(a); i++){
b = a[i];
}

so, you could do something like this?
NPC Code:

if (created){
a = {2,3,5,8};
setarray c,4;
i=0;
for (b: a){
c[i] = b;
setplayerprop #c,Set c[#v(i)] to #v(c[i]);
i++;
}
}
// pointless yeah & more complicated than it needs to be, but just trying to make sure I understand it

__________________


Last edited by CheeToS2; 09-03-2003 at 05:06 AM..
Reply With Quote