View Single Post
  #2  
Old 08-11-2001, 02:42 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Clever people find ways around.

setstring oldx0,#v(playerx);
for(this.i=1;this.i<5;this.i++) setstring oldx#v(this.i),#v(strtofloat(#s(oldx#v(this.i-1))));
will create an "array" of 5 strings, oldx0, oldx1, oldx2 oldx3, oldx4

multidimentional strings are noticably easier than multidimentional variables:
setstring oldx0-0,#v(playerx),#v(playery);
for(this.i=1;this.i<5;this.i++){
for(this.n=1;this.n<5;this.n++){
setstring oldx#v(this.i) #v(this.n),#v(strtofloat(#s(oldx#v(this.i-1)-#v(this.n-1)
)));
}
}
will create an "array" of 25 strings, oldx0-0, oldx0-1, oldx0-2 oldx0-3, oldx0-4...
I botched the creation a little, you'd need to set the column oldx0-n and the row oldxn-0 for that snippet to work, but you get the idea.

this.strings are kinda tricky, but if you only need one, and the NPC doesn't have any showimgs(this version NPCs have to show to show images, and drawunderplayer NPCs make drawunderplayer images, it's weird), and it doesn't have to be visible, just use setcharprop #n,string; !
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote