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


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sat Aug 04, 2012 2:39 pm   

Help with a bash trigger
 
Hey guys, I'm very new to zmud (actually only been using for 2 weeks)

I'm trying to make a trigger for bashing.

Currently I have

#TRIGGER END: (%d)

#var bashes %1
#if (@bashes > 150) {bash} {}
#TRIGGER (Your opponent appears momentarily stunned and confused.) {#WA 2000}
#TRIGGER (Your opponent appears briefly stunned and confused.) {#WA 40000}
#var bashes %1
#if (@bashes > 450) {bash} {}

____________________
Once a bash lands it has the chance to stun an opponent.
Momentarily is for one round
briefly is for 3 rounds
I'd like to have the trigger pause when one of the conditions is hit, so as not to waste more endurance (END) by continuing to bash.
Any idea how to make this happen? Thanks
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Aug 04, 2012 11:37 pm   
 
First off, you need curly braces around the trigger pattern, unless its an expression trigger.

Second #WA should not be used in zMUD, as it is rather broken. This is fixed in CMUD.

I dont see how you are getting a value to set your bashes variable, or resetting it..

From what I see I would suggest another route entirely

#TRIGGER {Your opponent appears momentarily stunned and confused.} {bashRounds=1}
#TRIGGER {Your opponent appears briefly stunned and confused.} {bashRounds=3}

#TR {some means of determining when a round has gone by} {#IF (@bashRounds>0) {#ADD bashRounds -1}}

then you can add an expression trigger...

#TR (@bashRounds=0) {#IF (@target) {bash @target}}
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 9:33 am   
 
Ok, I see how that would work.

Here is one problem I run into still though,
bashing does not always result in a stun.
I have made a trigger to bash again on a miss, but sometimes a hit will not stun the opponent, but I get the damage message.
How can I add a trigger if I don't see Your opponent appears * stunned and confused. _ .. bash again that round.

Thanks for the help btw.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 12:41 pm   
 
Does the miss result in a special line of text recieved at no other time?
If so, just make another trigger on that to rebash.
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 1:34 pm   
 
shalimar wrote:
Does the miss result in a special line of text recieved at no other time?
If so, just make another trigger on that to rebash.

Unfortunately it doesn't. You get the hit message, just this time no stun message whatsoever.
I'd like to bash until I get the stun message or until I get You are already engaged (indicating I used up all my attempts for this round)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 2:05 pm   
 
hmm... how much delay you want for this? i would suggest something like...

#ALARM "keepBashing" -2 {#IF (@target AND %null(@bashRounds)) {bash @target}}

as it checks the condition of two variables, you can ensure that the alarm does nothing by setting them accordingly
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 2:18 pm   
 
shalimar wrote:
hmm... how much delay you want for this? i would suggest something like...

#ALARM "keepBashing" -2 {#IF (@target AND %null(@bashRounds)) {bash @target}}

as it checks the condition of two variables, you can ensure that the alarm does nothing by setting them accordingly


Thanks for the quick replies,

Well, I'm not sure. I have basically 3-4 (depending on my settings) attempts at bash each round. I want to keep attempting to bash until I get the stun message. Your getting a little deep for my zmud knowledge (which isn't much, I apologize.)

How would this look all together?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 2:27 pm   
 
on second thought, scrap the keepbashing alarm and the following trigger from your settings:

#TR (@bashRounds=0) {#IF (@target) {bash @target}}

then enter this at the command line

#TR (@bashRounds=0 AND @target) {bash @target} "" "LoopExp"

that should fire on every line of text received from the mud until it no longer matches
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 2:29 pm   
 
You rock!

Thanks for the help, Shalimar
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 8:50 pm   
 
Ok having a weird problem with the script

for #TR (bashRounds=0 AND @target {bash @target} " "Loopexp"

it will bash even though bashrounds doesn't = 0
under test I can see
3=0 AND spider
it will flood my screen with bash spider
obviously 3 =/ 0
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 9:29 pm   
 
instead of
@bashRounds=0
try
%null(@bashRounds)
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 9:34 pm   
 
Nope it still just goes crazy
Heres what I have:

#CLASS {bash}
#TRIGGER {You're already engaged this round!} {#ADD @bashrounds+1}
#TRIGGER {Your bash does no damage.} {bash}
#TRIGGER {Your shield bash soundly trounces the air!} {bash}
#TRIGGER {Your opponent appears briefly stunned and confused.} {#ADD @bashRounds+3}
#TRIGGER {Your shield whooshes through the air.} {bash}
#TRIGGER {Your opponent appears momentarily stunned and confused.} {#ADD @bashRounds+1}
#TRIGGER {%null(bashRounds) AND @target} {bash @target} "" {loopexp|notrig}
#TRIGGER {Bash whom?} {#T- bash}
#TRIGGER {EXP (*)} {#IF (@bashRounds>0) {#ADD bashRounds -1}}
#CLASS 0
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 9:38 pm   
 
in a lot of your triggers you are missing the space between the variable and the amount in your #ADD
also, you are missing the @ for the variable inside the %null

one more thing, your triggers the reissue the bash should no longer be needed, the expression checker should take care of those
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Sun Aug 05, 2012 9:53 pm   
 
#CLASS {bash}
#TRIGGER {You're already engaged this round!} {#AD @bashrounds 1}
#TRIGGER {Your opponent appears briefly stunned and confused.} {#AD @bashRounds 3}
#TRIGGER {Your opponent appears momentarily stunned and confused.} {#AD @bashRounds 1}
#TRIGGER {%null(@bashRounds) AND @target} {bash @target} "" {loopexp|notrig}
#TRIGGER {Bash whom?} {#T- bash}
#TRIGGER {EXP (*)} {#IF (@bashRounds>0) {#AD @bashRounds -1}}
#CLASS 0

Ok, still spams nonstop.

Sorry to be such a pain, Shalimar
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 11:38 pm   
 
i guess the expression trigger doesnt support multiple expressions... try changing it back to...

#TR (@bashRounds=0) {#IF (@target) {bash @target}} "" {loopexp|notrig}
_________________
Discord: Shalimarwildcat
Reply with quote
Daoshai
Beginner


Joined: 04 Aug 2012
Posts: 13
Location: Milton

PostPosted: Mon Aug 06, 2012 12:52 am   
 
Ok it works
#CLASS {bash}
#TRIGGER {You're already engaged this round!} {#ADD bashRounds 1}
#TRIGGER {Your opponent appears briefly stunned and confused.} {#ADD bashRounds 3}
#TRIGGER {Your opponent appears momentarily stunned and confused.} {#ADD bashRounds 1}
#TRIGGER {Bash whom?} {#T- bash}
#TRIGGER {EXP: (*)} {#IF (@bashRounds > 0) {#ADD bashRounds -1}}
#TRIGGER {@bashRounds = 0} {#IF (@target) {bash @target}} "" {loopexp|notrig}
#CLASS 0

BUT, I have too many lines of combat and it'll spam bash when @bashRounds = 0 for one round, then not bash again until it hits 0 again.
There a better kind of loop?
Reply with quote
Petrograd
Novice


Joined: 08 Dec 2005
Posts: 35
Location: Sweden

PostPosted: Mon Aug 20, 2012 11:35 am   
 
Hmm, it'll try to bash too many times? You want it to only do it up to a preset number of times?

If so just add a variable to keep track of it?

Like when bashrounds go to 0, do numbashes = 0
and then do #add numbashes 1 whenever you bash.
And then stop trying to bash when you react your mark.

I can't fully decipher your code, but it could be sorta like this:?

#TRIGGER {@bashRounds = 0} {numbashes = 0;#IF (@target) {#while (@numbashes<4) {bash @target;#add numbashes 1}}} "" {loopexp|notrig}
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