|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Sun Jan 19, 2003 7:28 pm
please help me with a trigger |
I know about nothing of triggers, I've been trying for a few weeks to make a trigger that calculates my average damage per hit.
A normal round from the mud looks like this:
Your stab *** DEMOLISHES *** a pixie. [102]
Your stab MANGLES a pixie's leg. [95]
A pixie has quite a few wounds.
and when I kill the mob it looks like this(don't know if it helps but...)
Your stab *** DEMOLISHES *** a pixie's wing. [97]
A pixie is DEAD!!
You receive 14 experience points.
You hear a pixie's death cry.
I don't even know if this is possible, but I've heard it's been done before. Please help me. Thanks on Advance. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Jan 19, 2003 8:16 pm |
This should be easy. Count the number of hits, add up the damage, divide the damage by the hits.
#TR {Your stab *. ~[(%d)~]} {#ADD Totalhits 1;#ADD TotalDamage %1;#MATH AverageDamage (@TotalDamage / @Totalhits)}
LightBulb
Senior Member |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Tue Jan 21, 2003 4:43 pm |
hmm I don't get it to work.
When I try on test it says that it didn't match the pattern.
If I got it right pattern should just be: Your stab *. ~[(%d)~])
and command should just be:
#ADD Totalhits 1;#ADD TotalDamage %1;#MATH AverageDamage (@TotalDamage / @Totalhits)
when i test to paste an attack message it doesn't match:(
Your stab *** DEMOLISHES *** a pixie. [102]
Sorry for being such a newbie. Any idea what I did wrong now?
/Apollo teh noob |
|
|
|
doomfyre Apprentice
Joined: 03 Jan 2002 Posts: 152 Location: USA
|
Posted: Tue Jan 21, 2003 5:12 pm |
There's a typo in the pattern. You have:
Your stab *. ~[(%d)~])
Remove that offending ) and give it a whirl. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jan 21, 2003 6:55 pm |
Yep, mea culpa.
Typo correctd in original post.
LightBulb
Senior Member |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Tue Jan 21, 2003 9:13 pm |
hehe still don't get it to work, just on single attack messages these don't work:
Your stab *|*| ATOMIZES |*|* the Marsh Hag! [93]
Your stab -=)) INCINERATES ((=- a marsh wolf! [98]
and some more. what should I type to include those too?
and another question, where do I see the average damage? wouldn't the easiest way be to use the death messages of the mobs, and then trigger that to cout the calculated damage? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Jan 21, 2003 9:58 pm |
Changed Lightbulb's solution to reflect the period and the exclamation mark:
#TR {Your stab *{.|!} ~[(%d)~]} {#ADD Totalhits 1;#ADD TotalDamage %1;#MATH AverageDamage (@TotalDamage / @Totalhits)}
Ton Diening |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Tue Jan 21, 2003 10:19 pm |
Thanks alot, it works with all attack messages now. The only thing that remains is to present the damage somewhere. How do I do that?
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Jan 21, 2003 10:46 pm |
Plunk this into an alias or maybe the mob death trigger:
#SHOW Total Hits: @Totalhits Total Damage: @TotalDamage for an Average Damage of @AverageDamage
To clear your stats add the following to an alias perhaps:
#VARIABLE Totalhits 0
#VARIABLE TotalDamage 0
#VARIABLE AverageDamage 0
Ton Diening |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Tue Jan 21, 2003 11:02 pm |
Thanks for another good input. But It's still not working, all the variables are showing 0 after a few mob kills. It must be something wrong with the collecting of damage.
|
|
|
|
doomfyre Apprentice
Joined: 03 Jan 2002 Posts: 152 Location: USA
|
Posted: Tue Jan 21, 2003 11:18 pm |
Try changing 'Trigger on: Newline', under the options tab for that trigger to "Trigger on: Prompt". If its already that way, then change it to newline. Dont have both checked, in either case
|
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Tue Jan 21, 2003 11:25 pm |
already tried that, didn't work:( It's still showing 0
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Jan 21, 2003 11:46 pm |
With the settings editor, edit the trigger:
Your stab *{.|!} ~[(%d)~]
and double check it looks like:
#ADD Totalhits 1
#ADD TotalDamage %1
#MATH AverageDamage (@TotalHits/@TotalDamage)
Probably have your settings so things are resolved when you paste them into the command line.
Ton Diening |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jan 22, 2003 9:17 am |
Sorry for not being a mindreader. I'm sure you had some idea how you intended to use the information or you wouldn't have asked. But, since you didn't provide any details I chose not to guess and just answered the question of how to calculate it.
Where do you want to present the information?
On the status line? In a status window? In the main window? In a group tell?
When do you want to present the information?
Continuously? After every kill? After every hit?
Should the average be the average damage for one kill? Or the average per hour? Per session? Lifetime? Reset if/when the mood strikes you? (useful for calculating damage against groups of mobs using room attacks)
Judging by your fourth post here, it was working before Ton suggested setting variables to 0. I'd suggest going back to what you had at that point.
Oh, one of the easiest ways to present the information is on the status line. This will give a continuous display which will update itself every time the variable changes.
#ST {Average Damage: @AverageDamage}
LightBulb
Senior Member |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Wed Jan 22, 2003 5:31 pm |
Sorry for not telling you enough. It didn't really matter where the variables were posted. Just that they were presented. And I wanted it like Ton did with variable set. That's easy and is fitting very good.
The trigger never worked in action, it just snapped up the attacks I pased in the pattern test. and the test says
if my attack did 92 damage %1:92.
But after that it's not doing anything, I tried changing the values of the variable and the math worked atleast.
What I have in pattern is only:
Your stab *{.|!} ~[(%d)~]
and in command:
#ADD Totalhits 1;#ADD TotalDamage %1;#MATH AverageDamage (@TotalDamage / @Totalhits)
Now what should I try? I have a quite old version of zmud 4.62 I think, maybe I'll need to update. I just started to mud seriously again.. But the version should be enough for this script though. |
|
|
|
Apollyon Wanderer
Joined: 02 Oct 2001 Posts: 76 Location: USA
|
Posted: Wed Jan 22, 2003 6:25 pm |
could you just trigger off the death message
#trigger {^You receive (*) experience points.} {#echo It took @Totalhits with an average damage of @AverageDamage to kill that mob.; #var Totalhits 0; #var TotalDamage 0; #var AverageDamage 0}
i think that should tell you the average damage you deal to each mob, reseting the var's every mob, you might have to make another one for if you are grouped, i think the exp message might be different..... |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jan 22, 2003 6:29 pm |
Unfortunately, I don't have (and never did have) version 4.62, so I can't check which commands/functions are available. It sounds like you might not have the #ADD command. If that's the case, you can replace it with the #MATH command (if available). (Oh, the only thing the trigger is supposed to do is change the values of the three variables. This won't show up anywhere until you check the variables.)
#MATH TotalHits (@TotalHits + 1)
#MATH TotalDamage (@TotalDamage + %1)
If you don't have the #MATH command, you'll have to use the #VAR command, along with the %eval function or the square brackets [].
#VAR TotalHits %eval(@TotalHits + 1)
#VAR TotalDamage [(@TotalDamage + %1)]
#VAR AverageDamage [@TotalDamage / @TotalHits]
LightBulb
Senior Member |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Wed Jan 22, 2003 7:19 pm |
I tried what you said with maths instead, didn't work either.
I downloaded zmud 6.40 and it still doesn't work.
The mud I'm on is:divineblood.tetradesign.com:4000
/A confused Apollo |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jan 22, 2003 11:30 pm |
I just logged in to your MUD and created a character. I then created the trigger that was posted above:
#TRIGGER {Your pierce *{.|!} ~[(%d)~]} {#ADD Totalhits 1;#ADD TotalDamage %1;#MATH AverageDamage (@TotalDamage / @Totalhits)}
I only changed "stab" to "pierce" since I had a dagger. I then started a fight agaisnt a mob and the trigger fired each time. At the end, all the variables were updated correctly.
So, the tirgger works. What you need to figure out now is why it doesn't work for you. Start off by adding the following command to the trigger:
#SAY fired
You should now see the text "fired" every time the trigger fires. If you don't see this, then the trigger isn't even firing.
Kjata |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Wed Jan 22, 2003 11:35 pm |
also after a few rounds damage is showing:
((((((((0 + %1) + %1) + %1) + %1) + %1) + %1) + %1) + %1)
and hits:
%eval(%eval(%eval(%eval(%eval(%eval(%eval(% + 1) + 1) + 1) + 1) + 1) + 1) + 1) |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Wed Jan 22, 2003 11:49 pm |
it fires all the time. and hits are adding up, but not totaldamage, it's still 0
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jan 22, 2003 11:58 pm |
All scripts are written using the default special character set, unless otherwise noted. In particular, % is the Parameter special character. It appears you've either disabled or changed it.
If you haven't already, please look up all commands (things that start with #) and functions (things that start with % and end with parentheses around other things) in your helpfile (click the Help button or menu). Kjata has verified the trigger works (thanks Kjata), I think he's using 6.50. I'm sure it will also work in all earlier version 6's and in version 5.55 (earliest version I've used), but can't vouch for anything before that since I don't know what commands/functions were added when.
It would help to know which of the several variations on the trigger you're using each time you post a problem. You should include that with every post. Too much information is seldom a problem. Too little frequently is.
Keep at it, you've got several people puzzling over this and we're bound to find a solution eventually.
LightBulb
Senior Member |
|
|
|
Apollo Beginner
Joined: 19 Jan 2003 Posts: 11
|
Posted: Thu Jan 23, 2003 11:59 am |
Yippie!! I got it to work! Thanks alot for all your tips and hints. It was parsing that was the ghost. I had disabled it there. Sorry for being such an idiot.
|
|
|
|
doomfyre Apprentice
Joined: 03 Jan 2002 Posts: 152 Location: USA
|
Posted: Thu Jan 23, 2003 5:48 pm |
...
|
|
|
|
|
|