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


Joined: 06 Jan 2003
Posts: 10

PostPosted: Mon Jan 06, 2003 1:09 pm   

More complicated triggers
 
I have another question...=P

If the text from my mud says "You wield blah blib boo" and I want the trigger to change a variable (is that what I should be using?" to 'blah blib boo' and not just 'blah', how do I do that? The purpose is so that I can write another triger that returns "wield blah blib boo" if I get disarmed.

There's obviously other good uses of such a technique, I just can't remember what I wanted to do with it. What I do remember is being frustrated that I couldn't do it...=P Sorry about the wierd place fillers...=P

Thanks!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 06, 2003 2:16 pm   
 
#TRIGGER {You wield (*)} {#VAR myvar "%1"}

Kjata
Reply with quote
Yourmom
Beginner


Joined: 06 Jan 2003
Posts: 10

PostPosted: Mon Jan 06, 2003 10:05 pm   
 
Thanks!
Reply with quote
hukster
Newbie


Joined: 06 Jan 2003
Posts: 4
Location: USA

PostPosted: Mon Jan 06, 2003 10:45 pm   
 
Kjata,
Can you help me with a similar trigger?

Lets say i am wielding a longsword.
Some one disarms me and pattern is

Knight disarms you. You drop your longsword

Is there a way to setup up the trigger so i can auto pick up and wield any weapon that was disarmed?

Thanks
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Mon Jan 06, 2003 10:53 pm   
 
I am not Kjata but I this might be a possible fix.

#tr {^(*) disarms you. You drop your %1} {get %1;wield %1}
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Jan 06, 2003 10:59 pm   
 
Most places wont allow you to wield the short name but a keyword:

#TRIGGER {^* disarms you. You drop your (*)} {get %word(%1,%numwords(%1));wield %word(%1,%numwords(%1))}



Ton Diening
Reply with quote
AzCowboy
Adept


Joined: 09 Nov 2000
Posts: 222
Location: USA

PostPosted: Mon Jan 06, 2003 11:54 pm   
 
quote:

I am not Kjata but I this might be a possible fix.

#tr {^(*) disarms you. You drop your %1} {get %1;wield %1}





You should NOT be using %1 through %99 in a trigger pattern... They're not intended for that use, this trigger should read:

#tr {^* disarms you. You drop your (%w)} {get %1;wield %1}

This would match any single word...

%1 in a trigger pattern is fairly unpredictable, and since it's not a proper usage, may stop working at any time(ie: Zugg could fix it so this doesn't work)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jan 07, 2003 6:25 am   
 
Because the last word in the weapon's name might sometimes not be its keyword, it's usually best to get the variable when you wield the weapon in the first place, instead of when it's disarmed.
#AL wield {#VAR wield %1;~wield %1}
#TR {disarms you. You drop your} {get @wield;~wield @wield}

This also helps when you want to be sure of getting back your "King Alfred's longsword" (keywords = king, alfred, or longsword) using the keyword alfred instead of the "commoner's longsword" that you made your opponent drop by casting heat metal.

LightBulb
Senior Member
Reply with quote
AzCowboy
Adept


Joined: 09 Nov 2000
Posts: 222
Location: USA

PostPosted: Tue Jan 07, 2003 4:32 pm   
 
Ah, but what if you're wielding a shortsword in one hand, and a dagger in the other, huh?

*ducks*
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jan 07, 2003 6:29 pm   
 
Make a second alias for the other one of course.
#AL wield2 {#VAR wield2 %1;~wield %1}
#TR {disarms you. You drop your} {get @wield;~wield @wield;get @wield2;~wield @wield2}

LightBulb
Senior 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