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
ZmudNewbie
Newbie


Joined: 28 Nov 2008
Posts: 5

PostPosted: Fri Nov 28, 2008 2:29 pm   

Trigger help
 
I'm a newbie at zmud, but trying to learn.

If I have the following:

Monster walks east.
Monster has fled.


How do I make a trigger to make it say:

Monster walks east.
Monster has fled. (To the EAST)


But if it just says:

Monster has fled.

It will not say anything else.


Anyone that can help a poor newbie with this?

Thanks.
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Nov 28, 2008 4:29 pm   
 
You'll want to look in the zMUD help for #SUB, #PSUB and #TRIGGER.

Trigger off the "walks east." line and save the direction into a variable. You may need to lookup pattern matching and #VARIABLE in the help as well.

Then you'll be #SUB or #PSUBing the "has fled." line.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Nov 28, 2008 4:52 pm   
 
Actually, just do this.

#TRIGGER {%w walks (%w).} {}
#COND {(%w) has fled.} {#SUB {%1 has fled to the %upper(%t1).}} {Within|param=1}

That is assuming all monsters just have one word names. If it can be multiple words, change the first %w to * and the third (the one in the #COND) to (*).

Hope this works for you. Ralgith was on the right track, though. :D

Charneus
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Fri Nov 28, 2008 7:00 pm   
 
If the MUD tells you the monster has fled but does not say a direction BEFORE he fled, that usually means that the mob is sneaking. If that's the case, there is no way to tell which direction he went without doing a 'scan' or something similar afterwards.

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Nov 28, 2008 7:10 pm   
 
He wasn't asking for it to say something if it didn't say prior to the fleeing, Rappy. :p

Charneus
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Fri Nov 28, 2008 10:25 pm   
 
I misread, I assumed he was asking about an auto-follow trigger, in which he wouldn't be able to follow... Should have read more closely.

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Nov 29, 2008 4:31 pm   
 
Sorry, was trying to get him to do it himself :p instead of just giving it to him. The code in my mind was pretty much exactly what you wrote charn ;)
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
ZmudNewbie
Newbie


Joined: 28 Nov 2008
Posts: 5

PostPosted: Tue Dec 02, 2008 5:09 pm   
 
Thanks for the answers. I prefer getting the code, and learning by looking it through. But I appreciat your way of doing it too Ralgith :) I just get so frustrated if I can't get it right!

Anyway, I don't seem to get it to work :( not sure if I'm doing something wrong, but I will try some more.

I'm running zmud 6.16. Not sure if that is an issue with this code?
If it is I will upgrade.

Thanks.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Dec 02, 2008 7:01 pm   
 
It may be an issue. What exactly isn't working? Keep in mind that zMUD 7.21 may have features earlier versions did not. However, it shouldn't be the case here. Just telling us you can't get it to work doesn't say much at all. :p

Charneus
Reply with quote
ZmudNewbie
Newbie


Joined: 28 Nov 2008
Posts: 5

PostPosted: Tue Dec 02, 2008 8:01 pm   
 
I have a trigger with:

Pattern: %w walks (%w).

Value: #COND {(%w) has fled.} {#SUB {%1 has fled to the %upper(%t1).}} {Within|param=1}

Is this the right way to do it?

It still just says:

Monster walks east.
Monster has fled.


I remind you, I am a newbie on this :)
Thanks.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Dec 02, 2008 9:16 pm   
 
No no. Take my first reply and just enter it on the command line, copy/paste. What you have essentially done is everytime that trigger firesn it will create a condition for the last trigger you created. So, delete that trigger, and copy/paste mine verbatim. It needs to be on two separate lines (the #TRIGGER blah on one line, and #COND blah starting the next line).

Charneus
Reply with quote
ZmudNewbie
Newbie


Joined: 28 Nov 2008
Posts: 5

PostPosted: Thu Dec 04, 2008 10:09 am   
 
Figured I was doing something wrong like that.

Entered the lines in the command line as you said, but still doesn't get it to work.

Should I be able to find any of the lines when I search for time? Cause I don't.

Really thanks for sticking it out with me Charneus.
Reply with quote
ZmudNewbie
Newbie


Joined: 28 Nov 2008
Posts: 5

PostPosted: Fri Feb 13, 2009 9:12 am   
 
So, I'm not getting this to work :(

Any ideas?
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