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
Bruner
Beginner


Joined: 17 Dec 2002
Posts: 18
Location: USA

PostPosted: Tue Dec 17, 2002 4:27 pm   

Can't get variables to represet what they want.
 
I've used Zmud for a while, so i understand most the programming. And I'm sure this is going to be just one little function that i missed. But i can't seem to get my hpnow and my hpmax to be in variables. I'll show you what i mean.

The output from the mud looks like this:
You have 22(22) hit and 123(123) movement points.

What i need is something that looks like this:
You have (%d)(%d) hit and (%d)(%d) movement points.
#var hpmax %2
#var hpnow %1
#var mpmax %4
#var mpnow %3

I hope you get the idea from that. But what i can't do it get it to seperate the 22 from the (22). Maybe it thinks that in 22(22) the "( )" represet some of the code that i put in. How would i get around this. Any help would be good. Thanks.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Dec 17, 2002 4:38 pm   
 
You are correct, when zMUD looks at your pattern it can't tell the difference between the parentheses that indicate %1, %2, etc. and the parentheses that are part of the pattern. To inform zMUD that special characters such as these should be treated as regular characters, put a ~ in front of them. This is known as the quote character.

You have (%d)~((%d)~) hit and (%d)~((%d)~) movement points.

LightBulb
Senior Member
Reply with quote
Bruner
Beginner


Joined: 17 Dec 2002
Posts: 18
Location: USA

PostPosted: Tue Dec 17, 2002 5:04 pm   
 
Well, i can't say that i'm surprised LightBulb that you both answered so quick, and so precise. I have been looking through the forums for about an hour now just learning about problems and how to solve them. And in more topics than not, you have been there to not only save the day, but to inform people why and how you saved it. I particularly liked
"Whenever experience (three braces) conflicts with theory (two braces), I follow the scientific method: If the data conflicts with the theory, throw out the theory not the data. "

Thanks Again.
Bruner
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