ZMud Queues and Priority?

by Raikas

Back to Mechanic's Corner.

Raikas2006-01-15 04:00:19
Okay. I've been working on putting together a zMud system for some time, and it's almost entirely in place. I've got a -lot- of the diagnose/symptom lines (mostly from scavenging through posts here biggrin.gif ), variables for every affliction that are setting and unsetting properly, and everything is pretty much set to go. I've got this nice pretty shell, and now I'm trying to write the healing queues to drive it, and I'm having a lot of trouble.

I understand nesting #IF statements, and it's worked in all of the other places I've tried it. I guess I just don't know what to do about the ELSEs, meaning...

QUOTE
#if (@aeon=0 and @slickness=0) {#if (@lostarm=1) {app r arms} {#if (@salvebalance=1) {#if (@lostleg=1) {app r legs}


I can get it to apply regeneration to whatever if I'm not aeoned and not slickery without any trouble, but what do I do if I am one of those? What's the best way to check for these priority afflictions and cure them first? Enh, I hope that makes sense to someone. doh.gif
Unknown2006-01-15 07:38:40
Could you do triggers that offset and onset conditions? Like say 'slickery' hits via some dude's venom on a sword and the line is 'dude hits you and you feel all slickery', then your reflex goes to cure it and at the same time offsets a condition/variable/whatnot, the onset being the cure line (if you succeed in curing it) 'you are no longer teh slickory', sommat. The condition/variable/whatnot is an IF for some other trigger that instantly makes you apply regeneration when it's set for some affliction relevant?

Really not sure man I'm not too good at more complex ZMUD workings myself. But I thought I'd give it a shot since you hadn't gotten any replies yet. See if you can make my stream of conciousness translate into something viable?

Probably not, dosn't even make sense to me anymore. What about just using diagnose?
Raezon2006-01-15 07:43:07
You just have the if aeon=1 dolaurel in your if statements. If you're not aeon=0, it's not going to fire that cure until you are, so as long as you have a cure for it, you're fine. Now for prioritizing, you go from top to bottom. So if you had slickness and aeon, and wanted to cure aeon first, just make it higher on the if statements than slickness assuming you have the whole thing run by an herb balance toggle.
Raikas2006-01-15 10:35:19
Hm. I recognize that if statements go from top to bottom in priority, but I was mostly wondering how I could heal the important things that are healed by different means: like slickness cured by an herb, anorexia cured by a pipe, etc. If I'm only running a queue on herbs or pipes, how do I check for both of these important afflictions? Or does it matter? Does it even make sense?

So I'm thinking that my question must basically just be too complex. For one, I don't think I can articulate well enough what I mean to ask. smile.gif And I don't think anyone will really be able to answer it without seeing how I've got everything else set up. So, thanks for the tries, y'all, but I think this may just be a tinkering issue. Trial and error, and whatnot. We'll see.
Unknown2006-01-15 14:17:07
If I understand you correctly, then you can tie all your different queues (herb, salve, pipe, focuses, etc.) with one "master" queue. The master queue would check for special cases and affliction combinations and then, conditionally, execute any cure queues.

For example, if you wanted to check if you had anorexia and slickness at the same time, and if yes - cure anorexia and skip herb cures, you could do something along these lines (in pseudo-code):

CODE

function MasterQueue
 if (anorexia == 1 and slickness == 1) {
   var skipHerbs = 1
 } {
   ... check for other special cases
 }
 
 if (skipHerbs == 0) {
   HerbQueue()
 }
end function


Then the master queue would be responsible for handling complicated situations which involve deciding between several cures types for one affliction or avoiding certain cures, while curative type queues would deal with straightforward cases and would be executed only if you can afford to ignore the relations between different afflictions and curing balances.
Murphy2006-01-15 15:49:06
the best way to do it, is to have an 'active mode' and 'passive mode' setup.

So when you get aeon, or sap or even when you are teleporting or doing something where you don't want to auto fire your cures, go into passive mode.

just have all your auto stuff to go #IF (@active =1) {do your curing here}

When you get aeon, you can go trigger you move sluggishly to turn your active statements off, so you are still tracking the afflictions you get but not curing them till aeon is gone.

so you move slugglishly would trigger you to go into passive mode, then go #IF (@anorexia = 0) {sip phlegmatic} {focus mind} or something.

as for slickness and other things that stop you applying, just do #IF @slickness = 0, if its 1 then your herb queue should catch it just fire them all at once off the prompt.