 |
liujc Beginner
Joined: 02 Mar 2007 Posts: 23 Location: China, BeiJing
|
Posted: Fri Mar 02, 2007 12:58 pm
A question about the variable array |
Since I found it's a little slow when using the database, I want to restore the needed information into a array variables. For example, store the weapons' name into: weapon1, weapon2, weapon3... and I wrote:
weapon@{id} = spear
#math id @id+1
It doesn't work. What should I do? |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Mar 02, 2007 1:54 pm |
#var {%concat(weapon,@id)} spear
|
|
|
 |
liujc Beginner
Joined: 02 Mar 2007 Posts: 23 Location: China, BeiJing
|
Posted: Fri Mar 02, 2007 4:57 pm |
Thank a lot, it works like:
#var %concat(weapon,@id) spear
I have another question. I use the data record as the variable:
#var %concat(weapon,@id,".npc") Master
#var %concat(weapon,@id,".name") Spear
and I got:
weapon1.npc = Master and weapon1.name = Spear.
But when I wrote: #echo @{weapon@{id}.npc}, it echos nothing. What should I do? |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Mar 02, 2007 5:00 pm |
You can try @{%concat(weapon,@id,".npc")} or the %db function.
|
|
|
 |
liujc Beginner
Joined: 02 Mar 2007 Posts: 23 Location: China, BeiJing
|
Posted: Sat Mar 03, 2007 4:52 pm |
thanks!
|
|
|
 |
|
|