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
HollyC
Novice


Joined: 10 Apr 2003
Posts: 45
Location: USA

PostPosted: Sat Apr 30, 2005 12:37 am   

Seeking Assistance debugging a few Triggers for Achaea
 
I'm looking to try and debug a few triggers in Achaea. For those of you veteran ZMud scripters who don't play Achaea, I'll try to explain as thoroughly as I can.

I have an alias that goes like this:

#ALIAS afflictme {#addkey Afflictions %1 1}

Any time I receive an affliction message that triggers this alias, it will store the affliction in a variable, such as @Afflictions.stupidity or @Afflictions.confusion.

Now, some afflictions (an umbrella term for any one of a number of different illnesses you can get; some potentially fatal, some just designed to impede you) can be illusioned. Since scripting is pretty much mandatory for combat in Achaea, shrewd players try to mess up each other's "systems" through illusions that are designed to make the opponent's "system script" THINK you have gotten a particular illusion, when you actually haven't. This messes up your curing and healing, hopefully long enough for you to gain a decisive advantage.

To deal with this, most people have illusion failsafes. Mine works like this, through the following alias:

#ALIAS illafflictme {#if (!@PKMode) {afflictme %1} {#if (@Attacked) {afflictme %1}}}

What this alias does, when I receive a message of an affliction, it checks to see if I have set the variable @PKMode to 1 or not. If I haven't, it will execute the afflictme alias and then execute the appropriate healing for the affliction.

If I HAVE set the @PKMode variable to 1-- something I always do through another alias when I begin an arena spar (a form of player vs. player combat does in an arena where you don't lose curing supplies and suffer none of the normal penalties associated with death) -- it's supposed to then proceed to the "then" portion of the #IF command, which is to check to see if the @Attacked variable is set to 1 before registering the affliction as true. The @Attacked Variable is set to 1 if the system detects any one of the existing attack messages. If that message is not detected, the system will treat the affliction message as an illusion, and ignore it. If the attack message IS detected, the affliction is entered and considered true.

During a recent arena spar, the following appeared on my screen:

Lightning-quick, JoeBlow jabs you with an ornate steel rapier.
You gasp as your fine-tuned reflexes disappear into a haze of confusion.
Opponent viciously jabs an ornate steel rapier into you.
Your limbs grow heavy and you groan feebly.
1485h, 2353m e-

I have the following two triggers:

#TRIGGER {Lightning-quick, %w jabs you* with } {Beenattacked 2}
#TRIGGER {viciously jabs * into you.$} {Beenattacked 2}

The pattern "Lightning-quick, %w jabs you* with" has been detected (JoeBlow plugged into '%w,' and * being left blank), and so it executes the "attacked" alias, like so:

#ALIAS Beenattacked {#var Attacked 1;#temp {^%dh, %dm} {#var Attacked 0;#var DoubleSlash 0} "" {nocr|prompt};#if (%1 = 2) {#var DoubleSlash 1}}

The pattern "viciously jabs * into you" (where 'an ornate steel rapier' is plugged into the '*') is also detected, and executes the attacked alias as well. The Attacked variable is triggered twice, and so the DoubleSlash trigger is also set to 1 (true).

Now, the line, 'You gasp as your fine-tuned reflexes disappear into a haze of confusion.' is a trigger value that executes the illafflict alias:

#TRIGGER {You gasp as your fine-tuned reflexes disappear into a haze of confusion.$} {illafflictme clumsiness;healme}

It's SUPPOSED to detect that I've been attacked, hold the @Attacked variable at 1 (true) until it sees my next health/mana prompt (which is 1485h, 2353m e-), then set the @Attacked variable back to 0. It's SUPPOSED to hold the @Attacked variable as true long enough to meet the #IF conditions of the illafflictme alias, and thus set the varaible @Afflictions.clumsiness to 1 (true) meaning I have the clumsiness affliction.

The problem is, my system never cures it. At no point in the spar does it attempt to execute the proper cure for clumsiness in the game, despite ample opportunity to do so.

I've decided that there's some kind of problem in the illafflictme alias or the Beenattacked alias that it relies on, in order to filter out illusions. For example, if the line:

'You gasp as your fine-tuned reflexes disappear into a haze of confusion.'

appeared on my screen WITHOUT any of the known attack messages preceding it, my system is supposed to treat the affliction line as an illusion and ignore it. The problem is, I think the way my system is set up, it treats the line as an illusion even though it detects the attack message just before it... meaning my system ignores the affliction as an illusion, when in truth I actually HAVE it and suffer the appropriate effects throughout the spar.

Let me know if you need more information. If what I've included looks all correct, is anyone able to figure out what's wrong? Why my system does not execute the healme alias to cure the clumsiness affliction when I've actually gotten it? I think it's because my system is somehow falsely assuming the affliction line is an illusion, even though the necessary IF checks to classify it as real, are supposed to be met-- at least I think they are, which is the crux of the issue.

Thanks
Holly
_________________


Last edited by HollyC on Sat Apr 30, 2005 3:12 am; edited 1 time in total
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Sat Apr 30, 2005 1:35 am   
 
This just to be clear (I dont play on your mud but sounds facinating!)...

Scenario 1 [is this an illusion?]:
<some random line>
You gasp as your fine-tuned reflexes disappear into a haze of confusion.

Scenario 2 [is this an a true affliction?]:
Lightning-quick, JoeBlow jabs you with an ornate steel rapier.
You gasp as your fine-tuned reflexes disappear into a haze of confusion.

I just need to know more specifics on when you *know* its an illusion or not...
Reply with quote
HollyC
Novice


Joined: 10 Apr 2003
Posts: 45
Location: USA

PostPosted: Sat Apr 30, 2005 1:53 am   Clarification on illusion vs. real
 
Quote:
Scenario 1 [is this an illusion?]:
<some random line>
You gasp as your fine-tuned reflexes disappear into a haze of confusion.


This is an illusion, as <some random line> would almost certainly not be one of the attack messages.

Quote:
Scenario 2 [is this an a true affliction?]:
Lightning-quick, JoeBlow jabs you with an ornate steel rapier.
You gasp as your fine-tuned reflexes disappear into a haze of confusion.


This is a true affliction, as the necessary attack message is detected (or is SUPPOSED to be detected) before the "you gasp as...." etc. affliction line, meeting the conditions for the illafflictme alias (@Attacked variable set to 1).

The problem is that the affliction is not being cured, and I think the reason why is that my script is treating a true affliction as an illusion and therefore ignoring it. I think there's a problem with my illafflictme alias.

JoeBlow (not the character's real name) is a member of a certain character class that is not able to use illusions, meaning any time I see an affliction message while sparring him, it's real. He can't illusion them.

Holly
_________________
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Sat Apr 30, 2005 2:49 am   
 
Well the only thing I see kinda funny there is the not inside the parenths. Ive had bad luck with that. Try placing it outside...
#ALIAS illafflictme {#if !(@PKMode) {afflictme %1} {#if (@Attacked) {afflictme %1}}}

Another way (possibly better maybe not) would be conditions. IE:

#TRIGGER {^Lightning-quick, %w jabs you} {}
#COND {^You gasp as your fine-tuned reflexes disappear into a haze of confusion.$} {healme} "within|param=1"

This kind of trigger really cant fail because the second will never happen without the first

edited condition
Reply with quote
Hazmeech
Novice


Joined: 27 Mar 2005
Posts: 31

PostPosted: Sun May 01, 2005 2:59 am   
 
where it says #if (%1 = 2),
it should be #if ("%1" = 2)
:OP

edit your alias and put these three lines at the start so you can test which values are true and what is the parameter that is being passed.
#echo pkmode~: @pkmode
#echo attacked~: @attacked
#echo parameter~: %1

when you get the sickness message you should get the three lines echoed to your screen;
first line would be: pkmode: 0 or 1
second line: attacked: 0 or 1
third line: parameter clumsiness or whatever

and if everything passes through correctly then the problem must be in your healing alias that you didn't give an example of.
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