|
Winger Beginner
Joined: 23 May 2004 Posts: 14
|
Posted: Sun May 23, 2004 5:15 am
Variable.. referencing? |
I'm not sure if I stated it correctly, but I've been trying to use a variable.. as the name of a variable. For instance, if I recieve the text
"Winger begins to swing his rapier over his head." or something
I want to use the trigger
"%1 begins to swing his rapier over his head."
and set @Beheading/%1 = 1
This is just an example of what I hope to accomplish. Is there any way of doing this? |
|
|
|
Guede Wanderer
Joined: 30 Nov 2003 Posts: 65 Location: United Kingdom
|
Posted: Sun May 23, 2004 3:42 pm |
#TR {(*) begins to swing his rapier over his head."} {#VAR {%concat("Beheading/",%1)} 1}
If it reads Guede begins to swing his rapier over his head.
It should set a variable called Beheading/Guede with a value of one.
Curious as to why you would want to do this though? using a db variable might be easier and use #ADDKEY instead. #ADDKEY Beheading %1 1
-G-
Edited: Correcting typos. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun May 23, 2004 5:56 pm |
/ is a class separator. If you intend to assign the variable to the class Beheading, it's probably better to use the #VARIABLE syntax and put the classname in the Class field. If you don't intend to assign the variable to a class, you probably shouldn't use / in its name.
%1 should not be used in trigger patterns, zMUD has its own set of wildcards. In this case, you would want to ensure that %1 doesn't contain any spaces, so you need to use one of the wildcards which doesn't match spaces (probably %w, %a, or %x).
#TR {(%w) begins to swing his rapier over his head."} {#VAR %1 1 {_nodef} Beheading}
I agree with Guede that a database variable would probably be better. Actually, a list variable would probably be enough if you just want the names of people you've seen attempting the Beheading move. |
|
|
|
Winger Beginner
Joined: 23 May 2004 Posts: 14
|
Posted: Sun May 23, 2004 11:54 pm |
To be entirely honest, and I realize this will sound weird, but I can't remember exactly why I wanted to know that. All I remember is that there was a really good reason for it. I wish I had a better memory. I'll write it down next time it comes to me.
|
|
|
|
|
|