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


Joined: 05 Jul 2003
Posts: 5
Location: Germany

PostPosted: Sun Jul 06, 2003 1:29 pm   

Trigger problem
 
i've got some problems with my combat triggers. i want to trigger the output {you hit monster} and {you hit monster hard}. one trigger looks like {you hit *}. the other {you * hard}. on {you hit monster hard} both trigger come up, but only the second one should do. how can i solve this ?
Reply with quote
broadnax
Beginner


Joined: 15 Oct 2000
Posts: 29
Location: USA

PostPosted: Sun Jul 06, 2003 2:17 pm   
 
If you're going to have two seperate triggers anyway, why not make them exactly what they are shown as?
Reply with quote
Syron
Newbie


Joined: 05 Jul 2003
Posts: 5
Location: Germany

PostPosted: Sun Jul 06, 2003 3:37 pm   
 
ok, the problem is that {monster} could be everything, and one, or more words, so i need to use the *
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sun Jul 06, 2003 4:32 pm   
 
Alright. How about

#TRIGGER {You hit *} {#IF %pos(hard, %1)} {} {command}}
#TRIGGER {You * hard} {command}

The first trigger will check for the word "hard" in the string, and if it sees it, then it'll do nothing, otherwise, it'll execute the command. Alternatively, if the string for "You * hard" would work just as well if it's "You hit * hard", then you can just slip that command in the empty {}, and have it work in the same trigger. You can, of course, use the same idea for different levels of hits by setting more #IF %pos commands, if so desired.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 06, 2003 5:36 pm   
 
It would help if you showed what you intend to do with these triggers, so that we could see why you actually need two of them. The most likely reason is that you want to know what's being hit, so I've included #VAR commands for either case.

Assuming that you do actually need two different triggers, concentrate on what's different about them. The second one ends with "hard" (and probably a period). You then need to do something along the lines of what geniusclown suggested, although using %ends would probably be more precise.

#TR {You hit (*).} {#IF (%ends( "%1", " hard")) {#VAR target {%leftback( "%1", 5)};commands1} {#VAR target {%1};commands2}}
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