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


Joined: 13 Feb 2003
Posts: 13
Location: Philippines

PostPosted: Tue Apr 29, 2003 6:11 am   

Follow trigger for achaea.(map)
 
Making a trigger that follows someone walking around.

This is the trigger i made
You follow (%w) (%w) to (*).
%1=name of person you are following
%2=direction
%3=room name

The problem comes when the player you are following has a long name and when the room name has the word "to" in the name example:

You follow Really Newbie Adam Burke to The stairway to Heaven.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Apr 29, 2003 6:21 am   
 
Spectrum:
To handle this concept:
You follow Adam to the Entrance to the Cave.

The key is to know who you are following.
Lets say @follow is "Adam"

Trigger:You follow @follow to (*).
Value:#SH I followed @follow to %1

Else you parse it out:
Trigger: You follow (*).
Value:
#IF (!%pos(" to ",{%1})>0) {#SH I just followed someone ({%1}) not to somewhere?} {
#VAR followedwho %copy({%1},1,%pos(" to ",{%1}) -1)
#VAR followedto %copy({%1},%pos(" to ",{%1})+4,%len({%1}))
}



Ton Diening
Reply with quote
Spectrum
Beginner


Joined: 13 Feb 2003
Posts: 13
Location: Philippines

PostPosted: Tue Apr 29, 2003 8:02 am   
 
Im sorry made a mistake with the example.
Its:
You follow Really Newbie Adam Burke east to The stairway to Heaven.

When you start follow someone it will say something like "You begin to follow Adam." but it doesnt put in the title of the guy. so that's where @follow failed cuz i tried doing it too.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Apr 29, 2003 3:09 pm   
 
Trigger: You follow (*).
Value:
#VAR followeddir %word(%copy({%1},1,%pos(" to ",{%1}) -1),%numwords(%copy({%1},1,%pos(" to ",{%1}) -1)))
#VAR followedwho %copy(%copy({%1},1,%pos(" to ",{%1}) -1),1,%pos(%concat(" ",@followeddir),%copy({%1},1,%pos(" to ",{%1}) -1))-1)
#VAR followedto %copy({%1},%pos(" to ",{%1})+4,%len({%1}))

You either do that everytime or use it once after you begin following someone to figure out the @followedwho
Ton Diening
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Apr 29, 2003 3:33 pm   
 
The easy way to do this is:
#VAR follow {Really Newbie Adam Burke}
That's right, just make the @follow variable yourself, using your human brain to determine exactly what the name is, including all prefixes and suffixes. It's much easier than trying to write triggers to do it.

You could also make an alias if you want to simplify the process a little. I chose "fp" for "follow person", but use whatever's easy for you to remember.
#AL fp {#VAR follow {%-1}}

LightBulb
Advanced Member
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