Unknown2007-08-27 18:48:18
Hello. The problem is simple: salves and health potions both have the same message when applied. How to track them separately?
If they would regain balance in the same order in which they were applied, it would be possible to set a FIFO list: 'So, I applied health and mending (in that order), and that means I will regain health balance first, and then the salve one'. This approach fails on, say, apply health + apply regeneration, when you have no wounds/afflictions. Healing potion balance recovers faster (in fact, it is not spent at all) than the regeneration one, and my balance tracking is messed up completely.
I tried to track corresponding curelines. Like, if the line is 'The deep damage in your left leg partially heals', it means potion_balance = 0. But again, it fails miserably in certain cases. For example:
apply mending to legs
apply health to legs
You take out some salve and quickly rub it on your legs.
The salve has no discernable effect.
You take out some salve and quickly rub it on your legs.
The salve has no discernable effect.
How would you tell what balance to reset?
Thoughts, ideas, opinions, code snippets - everyrthing will be of a great help. Thank you.
If they would regain balance in the same order in which they were applied, it would be possible to set a FIFO list: 'So, I applied health and mending (in that order), and that means I will regain health balance first, and then the salve one'. This approach fails on, say, apply health + apply regeneration, when you have no wounds/afflictions. Healing potion balance recovers faster (in fact, it is not spent at all) than the regeneration one, and my balance tracking is messed up completely.
I tried to track corresponding curelines. Like, if the line is 'The deep damage in your left leg partially heals', it means potion_balance = 0. But again, it fails miserably in certain cases. For example:
apply mending to legs
apply health to legs
You take out some salve and quickly rub it on your legs.
The salve has no discernable effect.
You take out some salve and quickly rub it on your legs.
The salve has no discernable effect.
How would you tell what balance to reset?
Thoughts, ideas, opinions, code snippets - everyrthing will be of a great help. Thank you.
Drathys2007-08-28 03:49:39
Probably best not to reset the balance on triggering those lines. Just use a failsafe timer to reset after a predetermined time.
Unknown2007-08-28 08:04:56
QUOTE
Probably best not to reset the balance on triggering those lines. Just use a failsafe timer to reset after a predetermined time.
I'm using failsafe timers for every balance, but it won't help much in this case. For example, salve_balance is set to 0.5 when the apply mending string is sent to MUD. When you see You take out some salve and quickly rub it on your legs, you set salve_balance to 0. Then if in a few seconds it's still 0.5, reset it to 1 - in fact salve was not applied. How would that help to discern salve and health applications? Or am I missing something?
Unknown2007-08-28 19:29:28
QUOTE(Skaldi @ Aug 28 2007, 03:04 AM) 436590
I'm using failsafe timers for every balance, but it won't help much in this case. For example, salve_balance is set to 0.5 when the apply mending string is sent to MUD. When you see You take out some salve and quickly rub it on your legs, you set salve_balance to 0. Then if in a few seconds it's still 0.5, reset it to 1 - in fact salve was not applied. How would that help to discern salve and health applications? Or am I missing something?
I do not know how the 'commercial' systems do it, but you could always use an alias to track it. For example (off the top of my head):
#ALIAS APPLY {#if (%1 = "health") {#VAR health_balance 0.5} {#VAR salve_balance 0.5};#VAR applying %1;~apply %-1}
#TRIGGER {You take out some salve and quickly rub it on your} {#if (@applying = "health") {#VAR health_balance 0} {#VAR salve_balance 0};#VAR applying ""}
There is a chance you can apply a salve while stupid, but I don't think that you ever apply health due to stupidity, so in this case you lose salve balance by default, and lose health balance only if you have sent "apply health". There might be some bugs or something in this (I just typed it in without any thought) but is there any reason something like this wouldn't work?
Unknown2007-08-28 20:23:29
Well, the simple answer is to avoid applying a salve and health in the same curing check. Apply one thing, and when you see the result from that (or a failsafe fires) you apply the next thing. It's somewhat akin to smoking coltsfoot and myrtle at the same time. How do you know which one succeeds and which fails?
Personally, I'd love it if the messages for applying a salve or smoking a pipe would at least tell us the type of vial or pipe used, just the way sipping does. That'd make it possible to at least keep things in specific vials or pipes and track them via a data mapping system.
(And, yes, mitbulls, there is a reason why that wouldn't work, as pointed out in my first sentence.)
Personally, I'd love it if the messages for applying a salve or smoking a pipe would at least tell us the type of vial or pipe used, just the way sipping does. That'd make it possible to at least keep things in specific vials or pipes and track them via a data mapping system.
(And, yes, mitbulls, there is a reason why that wouldn't work, as pointed out in my first sentence.)
Forren2007-08-28 20:25:09
QUOTE(Zarquan @ Aug 28 2007, 04:23 PM) 436777
Well, the simple answer is to avoid applying a salve and health in the same curing check. Apply one thing, and when you see the result from that (or a failsafe fires) you apply the next thing. It's somewhat akin to smoking coltsfoot and myrtle at the same time. How do you know which one succeeds and which fails?
Personally, I'd love it if the messages for applying a salve or smoking a pipe would at least tell us the type of vial or pipe used, just the way sipping does. That'd make it possible to at least keep things in specific vials or pipes and track them via a data mapping system.
(And, yes, mitbulls, there is a reason why that wouldn't work, as pointed out in my first sentence.)
Personally, I'd love it if the messages for applying a salve or smoking a pipe would at least tell us the type of vial or pipe used, just the way sipping does. That'd make it possible to at least keep things in specific vials or pipes and track them via a data mapping system.
(And, yes, mitbulls, there is a reason why that wouldn't work, as pointed out in my first sentence.)
The same problem exists when smoking faeleaf and myrtle at the same time. Faeleaf takes no herb balance, so you can do it whenever.
I wish the messages were different.
Unknown2007-08-28 20:39:07
Amen. At least if smoking faeleaf took herb balance (not that I want it to!), we'd know we lost it for certain. Let's envoy it, somehow, to change the messages!
Arundor2007-08-28 21:28:22
Attempting to code this in my system has been quite a headache for me as well.
If you guys can envoy it, please do!
If you guys can envoy it, please do!
Shryke2007-08-29 07:30:29
I like it as is.
Unknown2007-08-29 08:34:53
Currently I have two versions implemented and swaying back and forth between them, trying to choose one. Tracking last salve applied I can cure very fast, but sometimes it goes wrong and I have to realy on my failsafe timer to reset the balances. Blocking salve applications while the health one is going through works just excellent, though I lose 0.5-1 sec every time I need to use both health and salve at once.
I agree, it's possible to work around these issues. What I don't understand, is the reason behind such things. Everyone wants his system to be well-defined, efficient and reliable. We have separate balance messages for herbs/purgatives/salves and have the equal ones for health/salve. We can see which vial we are drinking from and can't see which pipe we are smoking. Is that intentional or just an old code legacy? Note, I'm not talking about Blackout, Doublewhammies, Aeon, Stupidity and many other things that can mess up your curing. They are okay, as they have a realistic explanation. They are afflictions, after all :) But health/salve and pipe issues just... don't make sense?
I agree, it's possible to work around these issues. What I don't understand, is the reason behind such things. Everyone wants his system to be well-defined, efficient and reliable. We have separate balance messages for herbs/purgatives/salves and have the equal ones for health/salve. We can see which vial we are drinking from and can't see which pipe we are smoking. Is that intentional or just an old code legacy? Note, I'm not talking about Blackout, Doublewhammies, Aeon, Stupidity and many other things that can mess up your curing. They are okay, as they have a realistic explanation. They are afflictions, after all :) But health/salve and pipe issues just... don't make sense?
Unknown2007-08-29 12:32:16
QUOTE(Zarquan @ Aug 28 2007, 03:23 PM) 436777
Well, the simple answer is to avoid applying a salve and health in the same curing check. Apply one thing, and when you see the result from that (or a failsafe fires) you apply the next thing. It's somewhat akin to smoking coltsfoot and myrtle at the same time. How do you know which one succeeds and which fails?
Personally, I'd love it if the messages for applying a salve or smoking a pipe would at least tell us the type of vial or pipe used, just the way sipping does. That'd make it possible to at least keep things in specific vials or pipes and track them via a data mapping system.
(And, yes, mitbulls, there is a reason why that wouldn't work, as pointed out in my first sentence.)
Personally, I'd love it if the messages for applying a salve or smoking a pipe would at least tell us the type of vial or pipe used, just the way sipping does. That'd make it possible to at least keep things in specific vials or pipes and track them via a data mapping system.
(And, yes, mitbulls, there is a reason why that wouldn't work, as pointed out in my first sentence.)
Isn't this how you used to track which pipe to light in your old system? My example creates just a simple variable, but if you use this with a queue instead to track the order in which balances were lost, it seems like it should work...at least, in theory.
Unknown2007-08-29 13:13:09
QUOTE(mitbulls @ Aug 29 2007, 08:32 AM) 436980
Isn't this how you used to track which pipe to light in your old system? My example creates just a simple variable, but if you use this with a queue instead to track the order in which balances were lost, it seems like it should work...at least, in theory.
Yes, but it wasn't fool-proof, so I changed the way I track pipes. Using a queue isn't a bad idea, except when a command fails for any reason. If your tracking of wounds and afflictions is fairly solid (or synchronized once in a while with diag/wounds), you won't run into the double "no discernable" situation, and that's probably the best way to deal with it.