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
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sat Oct 13, 2001 6:32 pm   

quo system
 
This might become complicated, but I'll give this a shot at explaining it

I need an Idea to build a system that works something like this

I have a set of aliases for healing..of course the mud has a delay where I have to wait to eat another healing potion...but while in combat you can be nailed with like 3 or 4 ailments at a time.....

Now if I eat these cures..they do no good if I eat them before the timer is up, so what I need to do is set up a quoing system, so that when the triggers fire the aliases for the cures of, they will go into a "quo" so that when I recieve the message that I can eat another cure, it will go down the list of aliases, that have fired. This is HUGE so I wont even bother to lay out all the triggers and aliases, but for example


#Alias bur {get cocklebur from pack;eat cocklebur}
#Alias foot {get chickenfoot from pack;eat chicken foot}
#trigger {You suddenly feel dizzy.} {bur}
#trigger {You can't see a thing!} {foot}


Dominic slashes you with his knife, and you suddenly feel dizzy.
bur <------ Alias in trigger fireing
Dominic throws a powder at your head blinding you.
You can't see a thing!
foot <----- Alias in trigger fireing
You get a cocklebur from your backpack.
You eat a cocklebur and your surroundings become clearer.
You get a chickenfoot from your backpack.
You eat a chickenfoot. <--- Ate cure too soon.
Someone slashes your right arm, opening a huge gash.
Someone kicks you in the head.
You may eat another herb now. <----- here is the message

Triggers will fire before the mud says its okay to eat another.
No normally it would be okay to set up a check to test for this line, but in this case, you only see two ailments, if there are 5 or six ailments, and I eat them all at once, only one will cure me because the other four fire before the mud says its okay to eat another.

I'm not sure how to do this, but I thought I would set all these aliases in a variable list. and within the CURE triggers do a check to see if a flag is set(meaning I have already eaten a cure), if condtition is true, put the trigger's Alias(Cure) into a quo list that is set up in another trigger that will fire off of the message....."YOU MAY EAT ANOTHER HERB" at which time I will, set the flag to 0, and eat the next cure in the Stack, reset the flag, so that if another trigger fires it will be added to the stack, if not, fire the alias in the trigger to cure me immediatly, then set the flag so I dont try to cure myself too soon and wait for the trigger "You may eat another" to fire again.

I hope this makes some bit of sense, Im not sure how to explian this any clearer. what Im not clear on is the code on the Test conditions, and flag setting. Flag setting also has me vexed, I dont know what is redundant, and whats not, when doing tests.

Any help would be greatly appreciated on this.
Thanks
-SHYL-
Reply with quote
Cir
Wanderer


Joined: 28 Jan 2001
Posts: 51
Location: Estonia

PostPosted: Sat Oct 13, 2001 9:15 pm   
 
Use stringlist.

Make the triggers on 'You are blinded blablabla' add item to stringlist. Each time you get message that you can eat another herb, send first item from stringlist to mud and delete it.

#additem, %additem, #var, %item, %delnitem are the things you should concentrate :)


Cir Inc.
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Sat Oct 13, 2001 9:17 pm   
 
Okay, I've whipped something up, see if it works for you.

What it does it set the flag @NoCure to 1 when herbs should be put in waiting, and 0 when they should be resolved. Any aliases that are called while this flag is 1 are put into the @HerbInQue variable. When the message "You may eat another herb now" arrives, it will check this alias list and executes the first alias, deleting it in the process, while resetting the flag @NoCure back to 1.


#ALIAS bur {
get cocklebur from pack
eat cocklebur
}
#ALIAS foot {
get chickenfoot from pack
eat chicken foot
}

#VARIABLE NoCure {}
#VARIABLE HerbsInQue {}

#TRIGGER {^You can't see a thing!$} {#IF (@NoCure = 0) {
foot
@NoCure = 1
} {#ADDITEM HerbsInQue foot}}

#TRIGGER {You suddenly feel dizzy.} {#IF (@NoCure = 0) {
bur
@NoCure = 1
} {#ADDITEM HerbsInQue bur}}

#TRIGGER {You may eat another herb now.} {
@NoCure = 0
#IF (!%null( @HerbsInQue)) {
%item( @HerbsInQue, 1)
#DELITEM HerbsInQue {%item( @HerbsInQue, 1)}
@NoCure = 1
}
}

Acaila
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sat Oct 13, 2001 10:58 pm   
 
Reply okay, Only one problem I see Acaila........
When using #additem It will not store duplicates, which I will need to be able to do. as some herbs cure more than one type of ailment. I have tried to alter the code to add it in, but it does not seem to be saving for some reason..... this is what I changed



#TRIGGER {You suddenly feel dizzy.} {#IF (@NoCure = 0) {
bur
@NoCure = 1
} {%ADDITEM(bur, @HerbsInQue}}


now this trigger should allow for adding multiple Items, but it doesnt seem to want to even add the item, instead, I see it giving me this output


HerbsInQue|gin

I'm thinking my syntax is off, but Zmud help says the syntax is as follows

%additem(s, list)

Any ideas?
Reply with quote
Cir
Wanderer


Joined: 28 Jan 2001
Posts: 51
Location: Estonia

PostPosted: Sat Oct 13, 2001 11:07 pm   
 
#var Herbsinque {%additem("bur", @HerbsInQue)}

Cir Inc.
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sat Oct 13, 2001 11:25 pm   
 
Added this line

HerbsInQue=%additem( "kel", @HerbsInQue)

That works

Now the same with problem with #DELITEM, it deletes all occurances, So I need to work with %delitem My syntax sucks...hehe, but I know what I need to work with at least......



#TRIGGER {You may eat another herb now.} {
@NoCure = 0
#IF (!%null( @HerbsInQue)) {
%item( @HerbsInQue, 1)
#DELITEM HerbsInQue {%item( @HerbsInQue, 1)}
@NoCure = 1
}
}


Moving to the same code as above

herbsinque=%delitem( %item( @HerbsInQue, 1), @herbsinque)

This seems to be working well

Now if I can figure out why the trigger is fireing both conditions, this is now my result when the @nocure is set

#alias bur {#say bur fireing}

2113h, 2478m ex-You cant see a thing.
bur Fireing

#show @nocure <-----show's flag is set and equal to 1

So it shouldnt be firing, it should be just adding the item to the quo list
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Oct 14, 2001 1:25 am   
 
quote:

Added this line

HerbsInQue=%additem( "kel", @HerbsInQue)

That works

Now the same with problem with #DELITEM, it deletes all occurances, So I need to work with %delitem My syntax sucks...hehe, but I know what I need to work with at least......



#TRIGGER {You may eat another herb now.} {
@NoCure = 0
#IF (!%null( @HerbsInQue)) {
%item( @HerbsInQue, 1)
#DELITEM HerbsInQue {%item( @HerbsInQue, 1)}
@NoCure = 1
}
}


Moving to the same code as above

herbsinque=%delitem( %item( @HerbsInQue, 1), @herbsinque)

This seems to be working well

Now if I can figure out why the trigger is fireing both conditions, this is now my result when the @nocure is set

#alias bur {#say bur fireing}

2113h, 2478m ex-You cant see a thing.
bur Fireing

#show @nocure <-----show's flag is set and equal to 1

So it shouldnt be firing, it should be just adding the item to the quo list



You want to use #DELNITEM if you want to delete just one item from the list

li'l shmoe of Dragon's Gate MUD
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sun Oct 14, 2001 8:13 pm   
 
Outstanding, I have an excellent start on this system, Now, I need to add a few additional condtion tests Such as:

If Im stunned or get paralyzed, I cannot eat the herbs......so I need to set a test condition for the stunned, so that if the cure trigger fires, and it recieves the message that Im stunned and cannot do anything....that it will add the last cure fired back onto the top of the que stack and fire it again, OR repeat the last alias fired until it is successful.....in which case I will recieve the message You may eat another plant...........

For paralyzed, I need a priority flag, to pause the que list and eat a particular herb Immediatly, or Im dead..if I recieve You are paralyzed and can do nothing at all......All the other herbs in the world can fire, but will do no good cause I cant eat them or move, just get pummeled to death, thus the que flag will be set at 1 forever, and the rest of the que list will never fire...

The problem with both the above is that I get 3 attacks per round, so I will recieve, most likely, three of these 'fail' messages for each condition, if I set up a trigger, it will fire three times, one for each attack, adding 2 cures I dont need back to the stack.........

Then there is a concussion, and I think its trigger proof, cause the game responds as if you have given it random commands, anything from the help menu, to picking your nose....I think I can just set a big bright banner up for this if so that if I fire off a trigger and the result that is expected, You eat soand so particular herb, it fires off a trigger with a big red flashing banner, YER STUPID or Concussion, er something like that, hehe......sorry, kinda got lost in thought there a minute......

Anyhow, any Ideas on how to do the checks in the first and second paragragh would be appreciated, as I said, Im pretty good with knowing what to use, its just the syntax that stumps me more times than not......

Thanks again...... -Shyl-
Reply with quote
Itamar Ravid
Beginner


Joined: 08 Oct 2001
Posts: 17
Location: Israel

PostPosted: Sun Oct 14, 2001 11:32 pm   
 
For checking if you're stunned, paralyzed, off balanced or lost equilibrium, just check the prompt that Achaea sends back. I THINK it also notifies you if you're stunned or paralyzed.

<snip>
#TRIGGER {(%d)h, (%d)m (%w)-} {...}
</snip>

As I`m not very good with scripting, all that is left for you to do is to check if the character "so and so" is in %3. Then, update one of your variables - @IsStunned,
@IsParalzed, etc.

Hope this helped.

-----------------

Oh look, a null pointer assignment...

-----------------

But it isn't even a language! It's just classes!

-Itamar
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Mon Oct 15, 2001 1:28 am   
 
Nope, stunned does not show up in the prompt. so there is no way to check it against that Nor does paralysis, Needs to be flagged off of triggers, Im thinking, and paralysis isnt going to be easy since the messages have random ****** put into the sentence.
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Mon Oct 15, 2001 7:06 pm   
 
Noone can figure anything else out for this one eh?
Im still working on this one too..it's semi working, but only sometimes...kinda like it has a mind of its own......
I think the checks I placed about it are not updating the flags, often enough...as I said, my syntax sucks, thus, I'm getting whacked in combat cause some will fire some of the time, and the rest of the time...well lets just say I end up on the end of a pike heh

Ihljar? Troubadour? Either of you able to work something out on t his one?

Thanks Guys,
-Shyl-
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Mon Oct 15, 2001 8:13 pm   
 
Could you post all you have so far? Maybe I can give it another try...

Acaila
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Nov 06, 2001 12:35 am   
 
Tagged for email notify. If I dont see someting by next week I'll look at it :P

TonDiening
Uses 6.16
Reply with quote
Mirudraas
Newbie


Joined: 03 Dec 2001
Posts: 2
Location: USA

PostPosted: Wed Dec 05, 2001 12:16 am   
 
actually, the paralysis one is really simple to deal with - not easy, but simple. What you do is this:

If i remember correctly, the paralysis text looks something like this: A prickly stinging overwhelms your body, fading away into numbness. - right?

So what you want to do is tell zmud to check each character for either the character or a *. You do that like this:

Instead of "A prickly" (I'm condensing it for space considerations), do "{A|*}{ |*}{p|*}{r|*}{i|*}{c|*}{k|*}{l|*}{y|*}"

In't that pretty? :)
Reply with quote
Mirudraas
Newbie


Joined: 03 Dec 2001
Posts: 2
Location: USA

PostPosted: Wed Dec 05, 2001 3:29 am   
 
As far as your 'priority flag' goes, that one's so simple you probably didn't even see it (so what's that say about me? ;). Just don't put the check in there - take out the thing that says "#if (@nocure = 0)" for your paralysis flag, and then just have it not add the herb to the list for that one (or those however-many) trigger(s). Then it'll keep trying to eat the herb every time it gets the "you're paralyzed and can't do nuthin'" text.

MAN i'm good! (and humble too! *giggle*)

Concussions also are easy to deal with - they give the same warning message(s) as stupidity, so make a general stupidity cure (which would involve getting the herb out and eating it 4 or 5 times (since the game garbles about 1/4 of your commands, having it do it 5 times is pretty safe)

If you get stunned (there's maybe 10 or so things that can do that?) what you can do is set up a few triggers that adjust the "@stunned" flag. If they all stun you for the same length of time, then you're set, otherwise, time 'em and get the times down correctly. then, in each trigger, do #wait (Number of seconds you're stunned for), cuz #wait puts EVERYTHING else on hold until it's done. Move them up nearer the top of the list to give 'em priority.

hmm...

the thing about 3 messages/round does cause issues, though - you're a monk, right? (just checking)

um...lemme see here...

you might be able to get away with it like this:

take all your herb-eating triggers, and gave them a class unto themselves. Then make a general trigger that fires every line (an auto-healer would be good for this, i can help you make one that's fake-flaying proof and is capable of auto-writhing), and put a thing in there that goes like this: #if (@nocure = 1) {#t- herbclass} {#t+ herbclass}

That MIGHT do it for you, but i'm not sure - basically, it says "if you just ate an herb, then turn off all herb-eating stuff", but that might also kill your list-maker (which was pretty cool, by the way)
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