second edition
to set a string you would use the command setstring stringname,strings; lets say you want to set the string stringname with the value of 1, stringies, and 34kald, then you would do: setstring stringname,1,stringies,34kald :o
Arrays
Plain arrays are only numeric
you can initialize arrays two ways:
setarray arrayname,length;
arrayname={values,...}
you can change array variables many ways, but the most common (for me) is with arrayname[index]=newvalue;
so lets say you want a array of 4 different values and then set them to the current npcs hearts/mp/ap/direction, you would do the following;
setarray this.myvars,4;
this.myvars[0]=hearts; // Index 0 will be NPCs heart count
this.myvars[1]=mp; // Index 1 will be NPCs MP amount
this.myvars[2]=ap; // Index 2 will be NPCs AP amount
this.myvars[3]=dir; // Index 3 will be NPCs direction
you read values from arrays with arrayname[index], lets say you want the NPC to display his mp,direction,ap, and heart count, so you would:
message MP: #v(this.myvars[1]) Direction: #v(this.myvars[3]) AP: #v(this.myvars[2]) Hearts: #v(this.myvars[0]);
there are some other "commands" that help you find the length or arrays and stuff such as that
arraylen(arrayname); // For arrays
sarraylen(arrayname); // For string arrays
so, if you want to get the length of this.myvars from above, you would do
this.arraylength=arraylen(this.myvars);
this.arraylength is now equal to 4
if you want to find out the length of the above string, 'stringname', you would do
howlong=sarraylen(stringname);
no 'howlong' is equal 3 |