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 Goto page 1, 2  Next
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Sat Jan 04, 2003 12:00 pm   

help with an exp tnl status
 
I want it to show me xp tnl after each kill, but i keep getting 'TNL: (#Add 0-0) in the status bar instead of the real number. Any suggestions welcome.

What i have so far:

trigger pattern: You have * experience points and need (%1) to advance.
trigger command: #var tnl %1

trigger pattern: You receive (%1) experience points.
trigger command: #var exp %1
#var exptnl (#ADD @tnl-@exp)

variable exp
value 0

variable exptnl
value (#ADD 0-0)
Default (0-0)

Status Line: TNL: @exptnl

What displays in the status bar is:
TNL: (#ADD 0-0)

I've tried various things and just cannot get it to cooperate, can anyone tell me what i'm missing please?

Thanks in advance!

Darkrose
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sat Jan 04, 2003 12:21 pm   
 
The problem here is that you are trying to use the command #ADD as a function. Functions (denoted by the syntax %functionname(argument1,argument2,etc)) return values (which can then be stored in variables). Commands (denoted by #COMMANDNAME argument1 argument2 etc) are executed and return no value. However, in this instance, you are merely storing a string in the variable since #VAR doesn't execute its parameters.

Confusing? Well, here's the change you need to make in your trigger:
#VAR exptnl %eval(@tnl-@exp)

Also, I should point out that using %1 in trigger patterns like you are is not supported. Your patterns should be:
You have * experience points and need (%d) to advance.
and
You receive (%d) experience points.

%d will match a number, which appears to be what you want in this instance.

Pattern matching symbols from the zMUD help file
 - Charbal
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jan 04, 2003 3:38 pm   
 
This can also be done by just using #ADD correctly.

trigger pattern: You have * experience points and need (%d) to advance.
trigger command: #var tnl %1

trigger pattern: You receive (%d) experience points.
trigger command: #ADD exptnl -%1

Status Line: TNL: @exptnl


LightBulb
Senior Member
Reply with quote
Ithilidin
Newbie


Joined: 05 Jan 2003
Posts: 6

PostPosted: Sun Jan 05, 2003 11:49 am   
 
I am having a problem with this as well.

rigger:
^* You have * experience points and need (%d) to advance.
#VAR tnl %1

^You receive (%d) experience points.
#VAR exp %1;#VAR exptnl %eval(@tnl-@exp)


Status Bar:
TNL: @exptnl


First off, I cannot get the variable tnl to load at all off of the trigger. It has to be added manually, which means that if it gets off for some reason, each time it has to be revalued manually.

I also want to know if this is setup right in order to correctly show the right output on the status bar.

A recent problem is that the exp variable won't load as well, which gives a no value error, or if a value is added, get: Alias: @exp 13 13 being a randomly pulled number to add to the value.


#VAR exptnl %eval(@tnl-@exp)
When this loads on the status bar, no matter what values exp and tnl are, as long as they are numbers, the output is always 0. I cannot figure out what is wrong there.

Any help into these problems would be greatly appreciated and thank you for the time ahead of time.
Reply with quote
Ithilidin
Newbie


Joined: 05 Jan 2003
Posts: 6

PostPosted: Sun Jan 05, 2003 11:51 am   
 
Sorry, I forgot to add to the above that I am still using zmud 4.62. (I never got to liking the newer and fancier versions)
Reply with quote
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Sun Jan 05, 2003 12:03 pm   
 
Well I'm not on an ancient version of zmud, and though the suggestions did change it so the status bar now shows TNL: it still isn't working.

There's no output at all on the status bar, rather than showing me the equation before. I changed the %1's to %d's and changed to the eval equation instead of add. Something is still missing though. :
Trigger pattern: You have * experience points and need (%d) to advance.
command: #var tnl %1

Trigger pattern: You receive (%d) experience points.
Command: #VAR exptnl %eval(@tnl-@exp)

VAR exp
Value: 0

VAR exptnl
Value: it's empty, and i'm not sure if i'm supposed to fill something in here.

VAR tnl
Value: %eval(@tnl-@exp)

Status barL: TNL: @exptnl

I tried setting the status bar to
TNL: @tnl (the variable that seems to have the actual equation in it, and that caused a stack overflow.)
Sorry, but i have yet to make a successful trigger/variable combination such as this, so it's a bit confusing as to why it doesn't work. Any suggestions helpful, thanks!

Darkrose
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jan 05, 2003 2:48 pm   
 
I believe that instead of:
#VAR exptnl %eval(@tnl-@exp)

you want:
#VAR exptnl %eval(@tnl-%1)

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jan 05, 2003 6:31 pm   
 
Sorry, we didn't pay enough attention and copied your mistake. You used too many variables, only one is actually needed for my script or two for Charbal's (and yours).
I think Kjata already corrected Charbal's script, here's my corrected script.

trigger pattern: You have %d experience points and need (%d) to advance.
trigger command: #var exptnl %1

trigger pattern: You receive (%d) experience points.
trigger command: #ADD exptnl -%1

Status Line: TNL: @exptnl

This has been tested and does work (version 6.40)

LightBulb
Senior Member
Reply with quote
Ithilidin
Newbie


Joined: 05 Jan 2003
Posts: 6

PostPosted: Mon Jan 06, 2003 9:27 am   
 
I am sorry to be a pest, but I seem to be a complete and utter idiot when it comes to this. I used the suggestion that Lightbulb had given, and went back to fix the problem that Kjata had said. I do not know what I am doing wrong. I have upgraded to v6.40 to see what I was doing wrong, both scenarios, neither had worked.

The correction in Kjata's did nothing at all. The tnl variable refused to set itself, and even if I set the variable myself it refused to do any evaluation at all.

In Lightbulb's suggestion, the variable refused to set itself. If I left it alone, it would do the subtraction from the experience gained, starting from 0. If I tried to set the value to a specified number, then nothing happened at all. It stuck at the number that I defined.

I am at a loss of what I could be doing wrong. I copied everything down exactly as it was written here, but no avail. I am sorry for taking up so much time on something that should be simple.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 06, 2003 12:04 pm   
 
Ok, let's try again:
#TRIGGER {You have %d experience points and need (%d) to advance.} {#VAR exptnl %1}
#TRIGGER {You receive (%d) experience points.} {#ADD exptnl -%1}
#STATUS {TNL: @exptnl}

Delete the triggers that you alreayd have. Then, copy this three lines, paste them into zMUD's command line and hit Enter.

Next, delete the exptnl variable in the settings editor. Make the MUD send the "You have ... experience points..." line and you will look the exptnl variable in the settings editor. That variable should now have the value of the amount of experience points you need to level.

If the previous step works, make the MUD sends the "You receive ... experience points." line and look at the exptnl variable in the Settings Editor. It should now have the same value it had before minus the amount of experience you gained.

If something doesn't work as it should along the way, tell us what part it was that failed, what happened wrong and copy and paste here the line from the MUD that should have fired the trigger in question.

Kjata
Reply with quote
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Mon Jan 06, 2003 8:38 pm   
 
Okies Kat, I tried, and still no go.

I removed triggers, variables, and status bar to start. I copied and pasted those 3 lines to make the new triggers and status bar. I checked under variables, and there wasn't one listed for exptnl.

I did the 'score' command on the mud, to conjure up the 'You need blah blah to advance' line, and checked under variables, still no exptnl variable. So, I thought i'd just make one, created an exptnl variable hoping that would kick it into updating, but it doesn't. Nothing happens there at all.

So, the exptnl variable seems to be the problem still. And, I wanted to thank you and the others for all your help on this. I appreciate the time and suggestions, even if it's still being a pain in the butt. :)

Darkrose
Reply with quote
Ithilidin
Newbie


Joined: 05 Jan 2003
Posts: 6

PostPosted: Mon Jan 06, 2003 8:40 pm   
 
I deleted all the triggers, reset them as was posted, deleted the variable, then did a score to bring up the line to set the variable.

I went to check to make sure that the variable had been set and to the right value. There wasn't a variable made.

All my settings are predefined as per the initial setup of Zmud.

Here are the exact lines that the mud sends:
* You have ... experience points and need ... to advance.

You receive ... experience points.

It seems the only trouble I have is with the first one: * You have ... experience points and need ... to advance.

I had killed and tested the way that the mud sends the You receiver ... experience points. and it ended up making the variable that the other line didn't. Instead of the score number that I wanted, it started at 0 for a value, then subtracted, giving me a negative number of the experience I had just gained in my status bar.
Reply with quote
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Mon Jan 06, 2003 8:43 pm   
 
Sorry, I forgot to paste what you asked.

* You have 19,050,000 experience points and need 0 to advance.

And the trigger is for:
You have %d experience points and need (%d) to advance.

Well, at least the first trigger.

The second trigger is based off of when you kill something, the mud sends:
You receive 0 experience points.

And the second trigger is:
You receive (%d) experience points.

Darkrose
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Mon Jan 06, 2003 8:46 pm   
 
Are you sure the triggering phrase is right? Under the options for the trigger, do you have trigger on newline, prompt, or both? You only want trigger on newline checked, more than likely. I can see no other reason why such a simple trigger shouldn't work.
Reply with quote
Ithilidin
Newbie


Joined: 05 Jan 2003
Posts: 6

PostPosted: Mon Jan 06, 2003 8:53 pm   
 
I just realized the problem I am having. Any number over 999 gains a comma within the number in this mud. It subtracted any number less than 999 just fine, any number over 999 and it wouldn't do it.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 06, 2003 8:54 pm   
 
There we go, there's the problem. Change the pattern of the first trigger to:
You have %n experience points and need (%d) to advance.

That's because the number has commas. By the way, if the needed experience until the next level may also contain commas, then you need to change that to %n too.

Kjata
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Mon Jan 06, 2003 8:55 pm   
 
That explains it. Your triggers should be:

#TRIGGER {~* You have %n experience points and need (%n) to advance.} {#VAR exptnl %1}
#TRIGGER {You receive (%n) experience points.} {#ADD exptnl -%1}
#STATUS {TNL: @exptnl}} {#VAR exptnl %1}

Since your numbers have commas in them, %d won't match. %n will however. I found that it will strip out the commas as far as the variable is concerned, and the math will be performed correctly.
Reply with quote
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Mon Jan 06, 2003 8:58 pm   
 
All righty... after quitting zmud in frustration and opening it back up, i went off and did my normal thing. i.e. killing things. I noticed a 0 on the status bar next to TNL... So, I'd say mine's working, since i do in fact have 0 xp to level and 0 from each kill. (i'm at a point where i have to advance further to get xp.)

However, I'll end up having the problem with the comma thing later on when I do get experience, so I'd love to hear a suggestion on that. The only thing I could think of was checking uder prefs for special characters and making sure the comma wasn't assigned to anything, which it isn't.

Darkrose
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 06, 2003 9:00 pm   
 
The solution for the comma problem has already been posted. Just use %n instead of %d in patterns of your triggers.

Kjata
Reply with quote
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Mon Jan 06, 2003 9:03 pm   
 
Ok, for the comma thing, I changed the first trigger to:

You have %n experience points and need (%d) to advance.

Wouldn't I also need to change the second one since when I receive exp later, it will have a comma in it too? Like:
You receive (%n) experience points.

Darkrose
Reply with quote
Ithilidin
Newbie


Joined: 05 Jan 2003
Posts: 6

PostPosted: Mon Jan 06, 2003 9:03 pm   
 
Thank you very much for the patience and time for helping get this right. I am sorry that it took longer than it should have to get this right.
Reply with quote
dark75rose
Beginner


Joined: 30 Jul 2002
Posts: 25
Location: USA

PostPosted: Mon Jan 06, 2003 9:04 pm   
 
Yeah, I saw the solution posted after I finished posting my question. It's like you are responding as I'm asking the question, so I didn't see it until after.

Big hearty thanks for helping me!!!

Darkrose
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Wed Jan 08, 2003 9:05 pm   
 
umm i think i know the problem that everyone is having it deals with this line:

#TRIGGER {~* You have %n experience points and need (%n) to advance.} {#VAR exptnl %1}

now the experience for the next level is the second one not the first one so shouldnt it be

#TRIGGER {~* You have %n experience points and need (%n) to advance.} {#VAR exptnl %2}

looking at the code posted it looks like it takes all of the exp you have already earned and then it takes the amount you gain and subtracts it from what you already have...
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 08, 2003 9:57 pm   
 
No, the only one surrounded in parenthesis is the second %n. zMUD only saves to %1..%n what you surround in parenthesis in the pattern.

Kjata
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Fri Jan 10, 2003 6:46 pm   
 
the color me confuse
i have triggers all over the place that are like...

#trigger {%1 slaps you.} {assist %1}
#trigger {%1 looks at you.} {insult %1}

etc... and it works all the time, if zmud only save the ones using ( ) then why am i able to use these correctly?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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