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


Joined: 19 Dec 2003
Posts: 15
Location: USA

PostPosted: Tue Apr 13, 2004 5:05 pm   

Several line follow trigger help
 
I've seen some of the other replies for multi-line follow triggers, such as:
#trigger {(%w) leaves (%w).$You follow (%w)} {#move %2}

And that works for me - sometimes. My problem is, I might have 2 or 3 lines between the initial 'leaves' line and my follow line. My MUD shows all of my group members following then me. And I might be grouped with 2,3 or 4 other players. Could even be more, conceivably.

Example: (Thibor is the group leader)

Thibor leaves southwest.
Raven leaves southwest.
Gorbo leaves southwest.
You follow Thibor.

I know that $ is a line break but I'm not sure how many lines I might have to filter through until my follow, due to group membership. So how can I tweak the above example to filter through a varying number of people in my group?

Thanks all.
Reply with quote
sjleonard
Beginner


Joined: 10 Jun 2002
Posts: 23
Location: United Kingdom

PostPosted: Tue Apr 13, 2004 5:15 pm   
 
make it 2 triggers, so

^You follow (%w) (%w).$
#MO %2

as a separate trigger, and trigger to follow without the "you follow" part.
Reply with quote
selch
Beginner


Joined: 19 Dec 2003
Posts: 15
Location: USA

PostPosted: Tue Apr 13, 2004 6:54 pm   
 
I don't see how that will work because my follow line doesn't contain the direction.
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Tue Apr 13, 2004 7:32 pm   
 
You can use conditions or make a simple list containing the people
who left the room and the direction they went in. Then trigger on your follow message
to search the list for who you followed then move in their direction.

For Example

Edit: Removed my condition example it was screwing up in some instances



#VARIABLE followlist "" ""
#TRIGGER {^(%w) leaves (%w).$} {followlist = %additem(%2,%additem(%1,@followlist))}
#TRIGGER {^You follow (%w)} {#MOVE %item(@followlist, %eval(%ismember(%1,@followlist) + 1));followlist = ""}


Jesse
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Apr 13, 2004 9:03 pm   
 
#TRIGGER "follow" {^(%w) leaves (%w).$} {#TEMP "folreset" {^$} {#State follow 0}}
#COND {^You follow (%w)} {#move %t2} {within|param=10}

This one works 90% of the time adjust your param= if you have more than 10 people in the group
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Tue Apr 13, 2004 10:31 pm   
 
You'll still have a problem is your leader walks north, comes back south, then leads the group to the west.

You might want to think about creating a db with 2 fields, name|direction.

Anytime somebody moves off in a direction, 1. check if thier name is in the DB, If so, delete. 2. Then Add thier name|direction to DB.

When you follow, lookup thier name|direction from the DB, issue the #move, then delete all records from the DB.

You may also want to add a trigger upon you moving into another room to delete all records in the DB.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Apr 13, 2004 11:50 pm   
 
Hmm Im not sure I follow you Talahaski

quote:
You'll still have a problem is your leader walks north, comes back south, then leads the group to the west


If the leader leaves north and you can't follow chances are there is going to be a blank line which will Reset the trigger so when he come back and moves again its all set up to go
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 14, 2004 3:44 am   
 
Sounds good to me.
#TR {(%w) leaves (%w)} {#ADDKEY FolDir {%1} {%2}}
#TR {You follow (%w)} {#MOVE %db( @FolDir, %1)}
Reply with quote
sjleonard
Beginner


Joined: 10 Jun 2002
Posts: 23
Location: United Kingdom

PostPosted: Wed Apr 14, 2004 1:24 pm   
 
lightbulb, thanks, that's what I was trying to get at but bwing half asleep rarely helps :)

PS - note, in a lot of muds that sort of triggering to follow is illegal (mainly pk muds)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Apr 14, 2004 1:34 pm   
 
quote:
PS - note, in a lot of muds that sort of triggering to follow is illegal (mainly pk muds)

How So?? All it does is update your position on the map when you follow someone :P Now maybe if it was a trigger that followed someone it would be illegal.
Reply with quote
sjleonard
Beginner


Joined: 10 Jun 2002
Posts: 23
Location: United Kingdom

PostPosted: Wed Apr 14, 2004 11:18 pm   
 
that's what I means, on a pk mud, following someone via a client trigger is illegal, as some professional have a hunt command for this. client following negates the skill applied to hunt (low skill, lose them, it simulates full hunt skill on all professions for free)
Reply with quote
notoriousBOB
Beginner


Joined: 18 Feb 2004
Posts: 13
Location: USA

PostPosted: Wed Apr 14, 2004 11:39 pm   
 
Well Sjleonard,

as someone who has played the mud that you play, and has tried to triggerhunt regardless of what the rules are...... this is what i have found.

When someone does a travel alias like 10e, or even when someone does a travelto, there is usually too much delay for it to work properly. However its useful when you want to kill someone in a small area like a city where you suspect they dont know their way ;)

Its only against the rules if you get caught doing it :P
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