|
aztectemple Newbie
Joined: 06 Aug 2005 Posts: 2
|
Posted: Sat Aug 06, 2005 6:01 pm
Array - need help using an array w/ counter |
I am really new to ZMud and coding in general, and I could really use some help/advice.
I am trying to make an array that uses a counter for movement.
#VAR @path %array(n,w,s,e)
#VAR @counter 0
So then the trigger would be
#TRIGGER {Gremlin enters the room.} {@path.{@counter}; #ADD @counter 1}
I know this doesn't work, but how do I use a counter so that the next time the gremlin enters the room, the next value is used in the array?
Thanks for the help |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Aug 07, 2005 2:13 am |
ZMud does not in any way support the @variable.@field syntax, as you knew. My suggestion is to forget all about arrays unless you are doing COM and/or MSS scripting stuff. They are woefully limited in ZMud, and the concept you are thinking of is called a stringlist (which basically looks the same as an array). Stringlists have several supportive commands to deal with them that are exceedingly handy.
Anywho, before I go rambling on, you will want to look into the %item() function. The proper way to use it as you are asking for is with #exec or whatever the relevant command would be (ie, #SEND), but I've found you can safely use the function itself most of the time. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|