Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Winger
Beginner


Joined: 23 May 2004
Posts: 14

PostPosted: 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?
Reply with quote
Guede
Wanderer


Joined: 30 Nov 2003
Posts: 65
Location: United Kingdom

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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.
Reply with quote
Winger
Beginner


Joined: 23 May 2004
Posts: 14

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net