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
BoBB
Newbie


Joined: 13 Feb 2002
Posts: 2
Location: USA

PostPosted: Wed Feb 13, 2002 8:17 pm   

variables question
 
okay i used to do this and know its easy but forgot the syntax and cant for the life of me remember it.

i have a variable @tnl which i display in my title bar kso i can see how much exp i need to level. I want to make it so whenever i recieve experience points for killing a mob or whatever it subtracts the number of exp i get from @tnl. If anyone knows and can help i would appreciate it :)
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Wed Feb 13, 2002 8:59 pm   
 
Well, probably something like this might work:

#trigger {You receive (%d) experience points from the kill.} {#add tnl -%1}

If not, then try this:

#trigger {You receive (%d) experience points from the kill.} {#math tnl @tnl-%1}

Don't forget to reset the @tnl value when you level. Also, on some muds, you gain experience while fighting as well as getting experience for the finishing blow. This doesn't take all that in account, so you might want to have some other trigger that will reset @tnl every once in a while. Like if your score shows your exp left until next level, then create a trigger that sets your @tnl to that value.

Iljhar
Reply with quote
BoBB
Newbie


Joined: 13 Feb 2002
Posts: 2
Location: USA

PostPosted: Wed Feb 13, 2002 9:26 pm   
 
see thats what i thought at first but i tried it and all it does is tack on %1 to to end of @tnl. so like if @tnl = 300000 and i get 245 exp for killin a mob it looks like this: 300000-245
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Feb 14, 2002 12:02 am   
 
The problem is in how you captured or set tnl originally. For some reason it is being recognized as a string variable. Double check to make sure it has no spaces, commas, or other odd things then type this in at your command line:
tnl=%number(@tnl)
If everything is right then tnl won't be set to 0.
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