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


Joined: 06 Jun 2003
Posts: 4
Location: Estonia

PostPosted: Sat Jun 07, 2003 12:38 am   

some tricky substitute triggers - need help
 
Hello.

The problem is that i would like to substitute the following words...
like "extremely hard" to "extremely hard 18+" and etc...

The problem is that i have not managed to separate the words:
"extremely hard" ... and "hard" - because the HARD trigger matches
also EXTREMELY HARD pattern (and VERY HARD pattern.. etc)

My triggers are:

NAME: extremely hard
VALUE: #sub extremely hard 18+

NAME: hard
VALUE: #sub hard 12-14

NAME: very hard
VALUE: #sub very hard 15-17


My substitution almost works... but now,
when someone is hit "extremely hard" the text is shown to me as "extremely hard 18+ 12-14"
i would like it to be like "extremely hard 18+" (and thats it - the word hard also gets other substitution trigger to work and i can't get rid of it)


The mud output is exactly like that...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
A gnarled old orc strongly hits your right arm and tickles it.
A gnarled old orc hits Player1's left foot extremely hard.
A gnarled old orc hits Player1's left foot hard and tickles it.
A gnarled old orc strongly hits Player1's right arm and tickles it.
You strongly slash a gnarled old orc's body and tickle it.
A gnarled old orc lightly hits Player1's body and tickles it.
Player1 strongly slashes a gnarled old orc's left arm and tickles it.
Player3 barely slashes a gnarled old orc's head and tickles it.
Player2 (b) smites a gnarled old orc's left arm extremely hard.
Player3 slashes a gnarled old orc's head extremely hard and tickles it.
Player2 (b) smites a gnarled old orc's head extremely hard and shatters it.
Player1 lightly slashes a gnarled old orc's left leg and tickles it.
Player3 slashes a gnarled old orc's body and tickles it.
Player3 slashes a gnarled old orc's left foot hard and tickles it.
Player2 (b) smites a gnarled old orc's right hand extremely hard.
Player3 slashes a gnarled old orc's right hand very hard.
Player2 (b) smites a gnarled old orc's head extremely hard and shatters it.
Player1 slashes a gnarled old orc's body very hard and shatters it.
You slash a gnarled old orc's body hard and shatter it.
Player2 (b) smites a gnarled old orc's right leg extremely hard and shatters it.
A gnarled old orc is mortally wounded and will die soon if not aided.
Player3 slashes a gnarled old orc's head extremely hard and shatters it.

You receive your share of experience.
Congratulations! This is the first time you've killed it!
Your blood freezes as you hear a gnarled old orc's death cry.
A gnarled old orc is dead! R.I.P.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I know that if i would write like a million triggers, every single one of them separately and correctly matched, the problem would be *almost* solved, but then again i would trigger on same output line very many triggers at once...

To get it work right i would be very much interested on some good triggerline, that would trigger only when needed and substitute only what is needed, and correctly :D

I hope i have managed to make myself clear about my problem...
Thanks in advance
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jun 07, 2003 1:15 am   
 
The problem here is how to make the match precise enough. The best solution seems to be creating a record variable with all the phrases you want to match. This can be done easily in the settings editor, but I will make a few to start the pattern. Then you need to match a word prior to the start of the phrase so that the largest phrase is matched, this is a form of anchoring.

#CLASS CombatSub
#VAR DamPhrase {}
#TR {({arm|foot|body|head|leg}) ({@DamPhrase})({|and tickles it|and shatters it}).} {#SUB {%1 %2 %db(@DamPhrase,%2) %3.}{
#CLASS 0
#ADDKEY DamPhrase {hard} {12-14}
#ADDKEY DamPhrase {very hard} {15-17}
#ADDKEY DamPhrase {extremely hard} {18+}

I am sure you will discover more uses to the setup and may want to move the 'and ??? it' portion into the phrase list when you find they indicate a specific modifier to the number. Of course you will probably also find that the 'hits' versus 'strongly hits' also changes how much damage occured, but when you figure that out I am sure you will be able to handle scripting it.
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