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
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Fri Mar 24, 2006 2:22 am   

Stumped on a trigger.
 
Ok, I've thought about this for a while, and tried a few things, thus far without success.

I have a trigger on an assassin character to automatically switch from his piercing weapon to a sword after backstabbing, and send his first attack command (death - for death technique) and then switch back to his piercer after whatever he's fighting dies. I run into a problem when he crits (instantly kills) with his backstab. I get this message:
Your backstab <<<<=- SLAYS -=>>>> the mobname instantly!
followed by:
Your backstab (damage message which depends on the health of the mob) the mobname!


In most cases the second damage message is:
<>-*-<><>-*-<> EXTERMINATES <>-*-<><>-*-<>
which, along with slays, I've had trouble using in an If statement :P

So my problem is, both of the "your backstab" message fire a trigger which sends: wear sword; death tech

So if I crit with backstab, it sends wear sword;death tech;wear sword;death tech, and on mob death an instant later it sends wear dagger, resulting in an unreasonable amount of lag for an instant kill.

I've contemplated simply turning the wear sword;death tech trigger on the <<<<=- SLAYS -=>>>> message, but it will still fire once, and ideally I'd like him to simply ignore the instant kills so he can move on as quickly as possible.

Really, my problem is that I cannot figure out how to capture the slays or exterminates message to test against an if statement, and in a perfect world I'd like to ignore the second message whether it says exterminates or not, which should be easy, but only if I can manage to capture the slay message successfully, which can be difficult when the mob name can contain virtually any number of letters, numbers, characters, and spaces, like:
Your backstab <<-*-<+>-*->> SHATTERS <<-*-<+>-*->> A -={\Recluse/}=- clan member!

This reminds me of a feature I'd really like to see in a future version of zmud, so I suppose I'll have to post a note there too.

Llohr

P.S. Sorry for rambling so much, I'm rather distracted :P
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Mar 24, 2006 3:31 am   
 
Llohr... you can can already do what you describe. You should look up the %match and %regex functions. Also the #REGEX. You should also note that you can use Perl regular expressions in your triggers that you can cleverly do what you're asking for that way as well.
_________________
Asati di tempari!
Reply with quote
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Sat Mar 25, 2006 1:58 am   
 
I guess I'm not seeing it. Looks like with any of those functions I'd have a rather large trigger to perform a really simple function, would be really neat to be able to simply make a trigger like:
Your backstab Value: #if (this line contains slays) {} {wear sword;death}
wow would that be easy :P

I guess I'll start reading and see if I can figure that stuff out.

Llohr
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat Mar 25, 2006 10:26 am   
 
#if ("slays" ~= "%1")
_________________
Taz :)
Reply with quote
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Sat Mar 25, 2006 11:14 am   
 
Well, that didn't seem to help much, but I realized that, as I always, I'd been making the problem much more difficult than it needed to be. Just made two triggers in one class, one on:
Your backstab %1 the %2 instantly! which simply turned that class off, the other trigger being: Your backstab %1 the %2! which turned the class off, sent wear sword and death
Then of course another trigger to turn the class back on at the end of the fight.
Not that you needed to know all that I guess, it was my problem to begin with :P

Llohr

The simplest solution is generally the best, and often the hardest to look for.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat Mar 25, 2006 5:56 pm   
 
Oops I got it the wrong way round, it should have been =~ not ~=
_________________
Taz :)
Reply with quote
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Sun Mar 26, 2006 7:59 am   
 
alrighty, I realized with further testing that a crit would fire either trig since the 'instantly' would just fit into the %1 :P
but I used your example Taz, and got it working great, thanks :)
if anyone's curious, it looks like this:

trigger: Your backstab %1 the %2~!
Value: #if ("<<<<=- SLAYS -=>>>>" =~ "%1") {#class classname 0} {
#class classname 0
wear sword
death
}


Thanks much for your help, I'm a bit slow with this programming type stuff yet :)

Llohr

P.S. looking up the =~ operator led me to a few other handy things, sometimes the biggest problem I have is knowing just what to look up :P
Reply with quote
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Mon Apr 24, 2006 3:31 pm   
 
Well, it DID work, a few times, then would randomly work or not work for a while, now it never works :P

Tried a whole bunch of things, separate triggers for mob names starting with "a", "the", or "an", then
^your backstab(%s)(%1)(%s){a|the|an|%s} %2~! and a whole bunch of variations on the theme.
None of it works reliably, there's just too much variation in mob names I think.

Llohr
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