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


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Thu Dec 07, 2006 9:06 pm   

Looking for a creative silution
 
I could do with some ideas to help me sort out my characters healing.
I play a PKILL game with both PKILL and bots

Without getting too in depth I have split the attack/defemce into areas of poison-herbs runes-spells swords-bows and (astro wierd stuff i aint even thinking about yet).

So taking the poisons as a good example I wish to create a system that shows me whats going on and yet lets me cure and not triggered cures (been told thats the quickest way to die here). I started with 69 triggered lines that tell me I have some form of disease. I am trying to put those with also the 40 or so types of cured messages into a system that allows me to use about 20 cures (mainly about 10 as some are obscure)

I started having each each trigger flag a condition eg bla bla bla @disease 1
then I tried using the @disease like (if any of the following have 1 then #sh Cure1

Its getting way out of hand now and im getting really lost so was wondering if anyone has a simpler concept or ideas on how i might tackle this type of problem.

I hope it explains what i need as i dont want to go into the actual nuts and bolts until i actually have an outline of how to use 69 triggers 40 cured messages and 20 cure types easily enough that i can actually hit them once in a while.

Thanks
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Dec 07, 2006 9:23 pm   
 
There isn't really a simpler way to do this... there's a more complex yet more elegant way, but the syntax is a little different. I'll go into that in a minute.

First, though, I'd like to say that it's very very rare that a MUD manages to defeat automation of any kind. With a properly setup automated curing system, you should be in much, much less danger than if you were curing everything manually. Any decisions you make about what to use to cure something and when to cure it are usually simple enough to be coded into the system. It wouldn't be simply

#trig {%w smacks you over the head.$You feel dizzy.$} {cure dizziness me}

it would have to make decisions about what to cure and when. I'm sure it can be done, though - what's the address of this MUD? I'd like to see one that purports to not benefit from automated curing ^_^

Back to your problem. The system I prefer for this (I first saw it used by Larkin, and I reckon it's the best way to do it) is to use a database record variable. The syntax is this:

@varname.keyname.

The Variable will contain many keys, each of which has its own value. This way you can have

@Diseases.ThinBlood 1
@Diseases.Dizzy 0
@Diseases.Nauseous 1

and so on. You use the #ADDKEY command to add keys (and their values) and the #DELKEY command to remove them. When you want to refer to them in scripts, you simply use @varname.keyname.

If your problem is losing the messages, there are many ways to make them more visible. Try using colours (use the #MXP command and the MXP tag <color> for many, many more colour options - palegoldenrod is my favourite :P) and asterisks/exclamation marks to make the text stand out. You could also display the text in a second Alerts window if you like using the Window:command syntax (it's in the helpfiles under multiplaying I believe).
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Thu Dec 07, 2006 9:54 pm   
 
I am sure triggers can work on some things - I think people here (Avalon) beleive its difficult to put in all the variables like balance, potion saturation, equilibrium etc etc.

I like the idea of a database of disease .... other idea was to put each disease or complaint and have it in a (group, class db whatever) then have something that would work through the cures in order of importance and when blance etc is up.

eg anorexia1 vomitting1 vertigo1 amnesia1 etc all in @cure1 ..... then maybe cure1 knows it has to work through 4 times as each cured its taken of list and as a new one is hit it joins the list so to speak .... giving this a chance to be semi automated.

Any other thoughts? ..... i think automation is best leaving me some focus on kicking butt ;)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Dec 07, 2006 10:10 pm   
 
That's exactly my philosophy, stark. As I recall, Iron Realms' MUDs are inspired by Avalon, or vice-versa. Here's a snapshot from the main healing alias of a system designed for Achaea, one of Iron Realms' games:

(Okay, it's too long to fit into the forums. Let me put it this way: it's 27 lines in this box I'm typing in now, and the whole of the sentence above exactly fills up one line - no pretty formatting, just solid text.)

just to give you an idea of the level of complexity that we're talking about here. But I maintain that it IS possible.

That's one way to do it, sure. You could have a string list variable @cure and make it contain a string of all the afflictions you have vomiting|vertigo|amnesia and so on, using the #additem command to add something to the list. Then you do the following:

#if (%ismember(vomiting,@cure)) {cure vomiting} {#if (%ismember(amnesia,@cure)) {cure amnesia}}

expanded for however many afflictions you want to cure. The %ismember function checks to see if a string is a member of a string list - if it is, it'll return true, if it's not, it'll return false. The false-command of this if statement is another if statement that checks another affliction. If you want to add more, just add them in as else commands, and it'll cure the first one it finds to be true and then stop. This is easier in CMUD, because you have the #switch command, but in zMUD a set of nested #ifs is the best you can do.
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Dec 08, 2006 4:05 pm   
 
Ok I am sort of getting there very slowly but its good learning.

1sr I tried to use some scripts from the game you mentioned and got my whole zmud in a nasty loop so started from scratch which is probably better.

Ill keep this a simple as possible but need to outline my thinking first.
I am starting with a couple of disorders that are both cured by a puff of a pipe containing a herb called arkasu

ok when i recieve

trig pattern1 Your legs have become wobberly as a jelly all of a sudden
trig pattern2 The demonic pestilence gives you confusion

i have it do this

trig value1 #additem arkasucure1 clumsiness
trig value2 #additem arkasucure1 confusion

ok thats good so far and my #Var arkasucure1 has now got a string of clumsiness|confusion in it

then i have a couple

trig patt1 You are cured of clumsiness.
trig patt2 You are confused no longer.

and then i did

pattern1 #delitem arkasu1 clumsiness
pattern2 #delitem arkasu1 confussion

so far great

Here's the problems now

1. do I have a trigger almost every round that says (checkout the variable arkasu cure and if there is something in the string act on it)?

2. If I type diagnose I get a list like this

You perform a self-diagnosis.
You are not plagued by any form of evil eye.
You are cursed with insomnia.
You have a health of 1020/1020 and a mana of 1020/1020.
Your clothing will afford well-clothed protection. The weather is fairly warm.
You are blessed with eight safe encounters with Death.
You are satiated. No need for food.
You are slaked of any thirst.
You are afflicted by clumsiness.
You are afflicted by confussion.

You are afflicted by the ucklice herb.
You are afflicted by insomnia.

ok 2 things here 1 it would be nice to maybe take all the above out and put in a seperate diagnose window or something like that so it isnt always taking up my main screen if i use it often
2nd it would maybe hel if i triggered the 2 red lines above to add to the list above incase it didnt trigger before or if its a line i havent got.

Alternatively if it isnt here it would be good to take it out of the list also

So my point is is there a way to only allow 1 entry of 1 condition in arkasucure1 eg it can only ever contain 1 clumsiness and when its cured it has 0 again
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Dec 08, 2006 4:48 pm   
 
The #additem command will not allow duplicate items in the lists it creates. It'll never add clumsiness twice to the string list - you need to use the %additem function if you want duplicates.

As for your diagnose problem:
#trig DiagTrig {You perform a self-diagnosis} {#temp {YOUR PROMPT PATTERN HERE} {#state Diagtrig 0}}
#cond {You are afflicted by (*).} {:Windowname:#echo %line} {Manual}

First, this creates a trigger with the ID DiagTrig that'll go off when you diagnose yourself. I'll move onto what the #temp part is for in a minute.
Then it creates a second state for the trigger that will only be active after the first state has fired (Multi-state triggers will only fire in order, I might've mentioned that already). This "You are afflicted by" state has the manual option - it won't advance to the next state until the #state command tells it to. That's the purpose of the #temp trigger the first trigger state - once your prompt is recieved, that'll be the end of the diagnose and it'll stop looking for afflictions and start looking for you to diagnose yourself again.

:Windowname:#echo %line

echoes the line that set off the trigger ("You are afflicted by something something something") to the window Windowname without changing focus. See the help on multiplaying for more explanation on that.

Finally, there are a couple of ways of setting up your automation. The most common way is to have a variable tracking whether or not you can smoke (I assume Avalon has some kind of "smoke balance" to stop you from smoking your pipes one after the other all the time) and then check this variable on every prompt. If you can smoke, it'll cure. If you can't, it won't until you're able to smoke.

You could also use an expression trigger, but I wouldn't recommend that in zMUD, they can be a bit temperamental.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Dec 08, 2006 5:06 pm   
 
So before i try any that do you think i should use cmud instead as i am not too far into this already if so i got a problem as when i try to put my code in it says wrong name when i put my name in?
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Dec 08, 2006 6:00 pm   
 
No smoking is only restricted by the fact that each time you fill a pipe with a herb you get 12 puffs at it .... then you have to get herb from pouch .... fill pipe with herb..... light pipe ... smoke pipe .... none smoking blance or capacity it seems like.

I suppose as smoking only cures a percentage of illness they think the potion balance is fairly tough

so ok i got something like this every round

(%d)h, (%d)m so I guess i trigger that to check the variables you mention before .... so say i want it to check whether to do 10 tasks how does it

a) know whether or not its needed, i mean it looks for @cure1 - no illness so then looks at @cure2 1 illness (trigger cure) looks at @cure3 no illness etc

I know i can cure more than one thing at once so each round i could maybe have up to 3 different smoke cures (if needed) at least a couple potions and a few herbs

b) I dont want to bog you down with this but I am really starting to learn by going through this exercise ;) - can you give me a simple idea of what the trigger might look like from the trigger pattern above to say check 2 variables and how i turn that into something like this

trig pattern (%d)h, (%d)m
trig value

look for a few healing variables such as(eg arkasu1 used before)
if need then fire the cure

nearly there (have patience once i get this im sure i can then expand it all to what now seems sort of possible)

thanks again in anticipation
only way i can pay you back is if you got trouble with your golf game ;)

Stark62
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Sat Dec 09, 2006 9:40 am   
 
Ok no wonder I die alot I didnt test things enough .... there is a small herb lag

potions have no lag except a health potion and an Allheal potion
therefore my point stands that I can cure few things together however I am going to need to use some IF's But's and Maybe's in there. ;)
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