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


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Sun Feb 24, 2002 6:49 am   

Failure to Understand this trigger ...
 
I've been reading the (autojoin) trigger setup in the advanced trigger help page .. and I can't seem to make it work properly.
I'm using the 6.26a beta version and the only thing I can get to work is the autoassist on T+ trig.
Wondering if anyone could write a patch for me or something, this is driving me crazy, I've been working on it for 2 days now and nothing seems to work *besides whats been mentioned that did work.
Thanks.
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Sun Feb 24, 2002 8:27 pm   
 
Or even show what the triggers are suppose to look like.. Thanks
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Feb 24, 2002 9:34 pm   
 
Post your triggers that you are working on.

I did not find your autojoin concept quickly in the online help files

Perhaps we could give direction then.

TonDiening
Beta Upgrading to 6.26
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Sun Feb 24, 2002 10:28 pm   
 
Here's the page ..
the trigger starts about 3/4 the way down called .. Joining your leader in battle.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 24, 2002 11:52 pm   
 
Umm, where's the page?

Kjata
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Feb 25, 2002 12:10 am   
 
heh my thoughts exactly.

http://www.zuggsoft.com/zmud/help55/helpset.htm
http://www.zuggsoft.com/zmud/help6/helpset.htm
http://www.zuggsoft.com/library/trigadv.htm

?

Only autojoin I find is in
#CASE
#CASE @joincmd {join} {rescue}

if the variable @joincmd is 1 (or 3,5,7...) the string join is returned, otherwise the string rescue is returned.



TonDiening
Beta Upgrading to 6.26
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Mon Feb 25, 2002 9:35 am   
 
sorry about that .. guess my copy/paste didnt work :( ...
[url][/urhttp://www.zuggsoft.com/library/book2/triggers.html]
and its 3/4'th the way down. :)
Thanks
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Feb 25, 2002 10:13 am   
 
What isn't exactly working properly?

What are the triggers you see in your mud that correspond to the triggers
used by Zugg in the example?

quote:

Joining your leader in battle

The final set of triggers are the most complicated and will require the most modification depending upon the messages displayed by your particular MUD. When your group is about to fight a large mob, one person in the group is usually designated at the "tank." This means that they will hit first and receive most of the damage from the mob. Once the tank hits the mob, it is very important for the other fighters in the group to join into the battle as soon as possible. Some MUDs handle this automatically, but on other MUDs you need to use the join or assist commands along with the name of the tank you are joining in battle.

The trick to this trigger is figuring out the pattern needed to trigger it. How do you know that a character has started a battle? In fact, maybe the tank didn’t start the battle at all, but the mob was aggressive and immediately started hitting your group member as soon as you entered the room!

To start, let’s first define a list of people that are in your group. This will be needed since you want to assist anyone in the group that might start fighting. Let’s create a variable called @group and give it a blank value:

#VAR group ""

In fact, we want this variable to be cleared whenever we start the MUD so let’s give it a blank default value also:

#VAR group "" ""

Now, every time we load these settings, the @group variable will automatically be cleared. Next, we need a button to easily set the members of our group. Use Make Button and in the Off Caption enter Group. In the On Command, enter #prompt group "Enter names of group members separated by |". This command will prompt you to enter the names of people in your group, and to put a bar | character between each name.

You can handle group members joining and leaving the group with a couple of simple triggers:

#TRIGGER {^(%w) has joined the group.$} {#VAR group %additem(@group,%1)}

#TRIGGER {^{%w} has left the group.$} {#VAR group %delitem(@group,%1)}

The %additem and %delitem are built-in zMUD functions that add and remove names from a string list and automatically handle the bar | character.

Now that we have a list of people we want to assist in battle, how do we know when they have attacked a mob? Well, the MUD usually displays text like this:

Zugg hits the goblin hard
Zugg massacres the goblin
Zugg misses the goblin
Zugg scratches the goblin

On some MUDs, it might say something like:

Zugg the Veteran hits the goblin

So, one way to handle this is to define a bunch of triggers like:

#TRIGGER {({@group}) *hits} {assist %1} autojoin

The {@group} expands @group to the names of people we want to assist, and the {a|b|c} pattern syntax allows us to match lines with any group members’ name in it. By putting parenthesis around this pattern, the actual name of the person that has hit the mob is captured into the %1 parameter. Thus, the assist %1 command tells the MUD to assist the character that has hit the mob. However, sometimes the message contains the word "hit", sometimes "misses", sometimes "massacres", etc. In fact, most MUDs have dozens of messages that they use for this. Should you create dozens of triggers? You could, but how about a single massive trigger like:

#TRIGGER {({@group}) *{hits|misses|massacres|scratches}} {assist %1} autojoin

This trigger will now fire whenever one of your group members starts fighting a mob.

There is one problem left: this trigger will keep firing on every line in the battle, sending the assist command to the MUD each time. We need a way to control this so that the trigger is only executed once. The best way to do this is to change the trigger command to:

assist %1;#T- autojoin

Now when the trigger fires, the last thing it does is disable itself. We want to re-enable this trigger when the mob is dead, so we create another trigger:

#TRIGGER {is DEAD!} {#T+ autojoin} endjoin

This trigger turns the autojoin trigger back on when the mob is dead. But how do we turn on this trigger? You guessed it: go back to the autojoin trigger and change the trigger command to:

Assist %1;#T+ endjoin;#T- autojoin

And change the trigger command for the endjoin trigger to

#T+ autojoin;#T- endjoin

Now you have a pair of triggers, called autojoin and endjoin that enable and disable each other properly.

The final step is to create a button that turns on and off the autojoin trigger. This probably seems fairly mundane by now: select Make Button, check Toggle option, enter AutoAssist into Off Caption, enter #T+ autojoin;notify Autoassisting ON into the On Command, enter #T- autojoin;notify Autoassisting OFF into the Off Command and click OK.

That’s it! You have now created a powerful set of tools to help you win battles and help your group on a combat MUD. Your group members will appreciate the responsiveness of your character in battle, and you can just sit back and watch the battles fly across your screen. You’ll be amazed how much this helps your MUDding



TonDiening
Beta Upgrading to 6.26
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Mon Feb 25, 2002 11:30 am   
 
okay .. well, I've got the #VAR group "" button to work .. but whenever someone joins the group .. it doesnt autoupdate the grouplist .. I have to add them in manually .. the triggers for them don't fire
I've got the notify button to work fine
but it won't "autoassist" the tanker
the #TRIGGER {({@group}) *{hits|miesses} assist %1 wont fire off either..
then for the
#TRIGGER {is DEAD!} {#T+ autojoin} endjoin
do I need the endjoin at the end of the line?
or on a new line?
oh.. also for the attack messages are there suppose to be a space between the | attack | or |attack| ?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Feb 25, 2002 1:27 pm   
 
These seem to be syntax errors and similar stuff. Instead of doing:
#TRIGGER {({@group}) *{hits|miesses} assist %1
#TRIGGER {is DEAD!} {#T+ autojoin} endjoin

It should be:
#TRIGGER {({@group}) *{hits|misses}} {assist %1;#T+ endjoin;#T- autojoin} autojoin
#TRIGGER {is DEAD!} {#T+ autojoin;#T- endjoin} endjoin

The list of hit messages do not need a space in them. Also, notice that the document where you got this from was written for version 4.62 and is a little old. You can still read those to get an idea of what you can do with zMUD, but you should turn to the help file (either online, or the one that comes with zMUD) to learn about the syntax and different commands involved in this script.

Kjata
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Mon Feb 25, 2002 8:54 pm   
 
okay.. so do I need the {} around the outside
of the text's as well as the #TRIGGER part?
ie. #TRIGGER {is dead}
^ ^ ^
| | |
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Mon Feb 25, 2002 9:53 pm   
 
okay .. this is what I have so far for my "autoassting" trig ..
Pattern:
({@group}) *{hits|misses|massacres|scratches|barely hits|bruises|tickles|hits hard|very hard|extremely hard|butchers|lacerates|slaughters|dismembers|massacres|decimates|SHREDS|MAIMS|DESTROYS|OBLITERATES|LIQUIFIES|PULVERIZES|EVISCERATES|DISEMBOWELS|ANNIHILATES|DEVASTATES|CREMATES|VAPORIZES|ATOMIZES|LOBOTOMIZES|FUBARS}

Value:
assist %1
#T+ endassist
#T- autoassist

and since zmud doesnt like the {} around the outsides I had to take them out?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Feb 26, 2002 12:41 am   
 
Yes, that's correct.

Kjata
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Tue Feb 26, 2002 6:29 am   
 
Okay .. so with all the triggers/aliases/variables I have ..
My bot still wont group people joining
nor assisting.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Feb 26, 2002 1:32 pm   
 
Hmm, saying that it doesn't work doesn't let me know anything to help you. Try posting what it does and what it doesn't do that it should do specifically.

Also, try posting all of the triggers and other settings that you have created for the autojoin script. Keep in mind that the script Zugg wrote in that document you mentioned assumes that you are creating all of the triggers, buttons and variables mentioned in it. You can't just take one trigger, or part of the script and have it work. So make sure that you did create the button like the document says, and that you can click on it to define your group members. If the @group variable does not contain anything, then the triggers will never fire.

Also, that word that you saw outside of the braces in the #TRIGGER command:
#TRIGGER {pattern} {commands} class

which would be class, means that the trigger will be created in that class folder. The script Zugg wrote in the document depends on having certain triggers inside certain classes. So make sure that the triggers that are supposed to be created in certain classes (like autojoin and endjoin) are, in fact, in those classes.

Kjata
Reply with quote
Shizuma
Beginner


Joined: 24 Feb 2002
Posts: 16
Location: USA

PostPosted: Wed Feb 27, 2002 8:50 am   
 
Okay, I got ALMOST everything to work, but I'm having problems with the trigger for %additem %delitem for autoadding group members.
This is what I have so far: Adding members -
(%w) is now a member of (%w)'s group.
#VAR group %additem( @group, %1)

Deleting members -
(%w) stops following (%w).
#VAR group %delitem( @group, %1)

My var I have setup is name: group
"" = default
" " = value


now the problem isnt the adding person trig, its the removal of the persons trig, Instead of removing the person that left the group, it removes me ... all the time :(
what can I do the fix that?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Feb 27, 2002 1:18 pm   
 
Hmm, present some sample MUD output of when someone leaves the group, please.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Feb 27, 2002 1:23 pm   
 
Try this:
Deleting members -
(%w) stops following (%w).
#IF (%1 = %char) {#VAR group %delitem( @group, %2)} {#VAR group %delitem(@group,%1)}



LightBulb
All scripts untested unless otherwise noted
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