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
jeeperv6
Beginner


Joined: 28 Oct 2001
Posts: 10
Location: Canada

PostPosted: Wed Feb 12, 2003 11:12 pm   

simple problem?
 
I'll admit first off I don't follow the programming ettiquette in Zmud. I can do very simple triggers and commands, and that's it. What I'd like to do is have my character do is to take out a second water container(in this case a buffalo waterskin) and drink from the second waterskin if the first is empty.

I've tried doing a few variables and if statements, but I can't seem to get it the hang of it. Could someone more experienced with zmud's code give me a hand with this this?

Thanks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Feb 13, 2003 12:00 am   
 
quote:

I'll admit first off I don't follow the programming ettiquette in Zmud. I can do very simple triggers and commands, and that's it. What I'd like to do is have my character do is to take out a second water container(in this case a buffalo waterskin) and drink from the second waterskin if the first is empty.

I've tried doing a few variables and if statements, but I can't seem to get it the hang of it. Could someone more experienced with zmud's code give me a hand with this this?

Thanks.



#trigger {drink from first container} {}
#cond {{success|failure}} {#if (failure) {get 2nd water container;drink 2nd water container} {#noop do nothing, you're done}}

li'l shmoe of Dragon's Gate MUD
Reply with quote
jeeperv6
Beginner


Joined: 28 Oct 2001
Posts: 10
Location: Canada

PostPosted: Thu Feb 13, 2003 12:53 am   
 
I substituted the words the mud uses and I tried your suggestion. It still doesn't work.

I've got a trigger that will respond when the mud tells me I'm thirsty. But it won't get the 2nd waterskin out of the bag and drink from it.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Feb 13, 2003 3:35 am   
 
quote:

I substituted the words the mud uses and I tried your suggestion. It still doesn't work.

I've got a trigger that will respond when the mud tells me I'm thirsty. But it won't get the 2nd waterskin out of the bag and drink from it.



You apparently only substituted the pattern of the trigger. You also need to make sure you are sending the correct commands to get the buffalo waterskin out of the bag and then drink from it.

li'l shmoe of Dragon's Gate MUD
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 13, 2003 3:38 am   
 
Edited.

You could just a play on Lightbulbs work here.

or something simple like Matt suggested:

#TRIGGER drinkswitcher {^You drink from a buffalo waterskin.} {#NOOP move to the next state and wait for the empty condition}
#CONDITION drinkswitcher {^Your buffalo waterskin is empty.} {get buffalo bag;put 2.buffalo bag;drink buffalo}

Change the triggers to match real output. Works only if you are using
two same water containers; ie what is detected as empty. The trigger
resets when you successfully drink so not to cause it to loop

Need coffee as I'm full of looping trigger ideas today!

Ton
Reply with quote
jeeperv6
Beginner


Joined: 28 Oct 2001
Posts: 10
Location: Canada

PostPosted: Fri Feb 14, 2003 4:33 am   
 
Ok, I tried your suggestion, subsituting the mud's output correctly. What it does now is completely screw up the mud. It created a class! It completely locked me out of the mud until I was able to delete the class it created. It kept up popping up the word "thirsty" and that of course had the mud continually replying unknown command.

Is there any way could enter these commands in the trigger window? I hate entering commands via the command line personally.

All I carry is 2 buffalo waterskins. The replies from the mud are:

Success:
You drink from a buffalo waterskin.

Failure:
It is already empty

I know it shouldn't be that difficult, but so far it's just not working.

For now I'm just using my original trigger I entered in the window.

You are thirsty. get buffalog bag;drink buffalo;put buffalo bag. simple and works as long as it's full. when it's not, I just manually pull the other one out. It's tiresome though.

thanks for any more suggestions :)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 14, 2003 6:57 am   
 
Pattern: It is already empty
Value: get 2.buffalo bag
drink buffalo
put buffalo bag

Be sure to refill the buffalo skins before the second one runs dry.

LightBulb
Advanced Member
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Feb 14, 2003 7:50 am   
 
Anyone have a copy of 6.16 around to see what happens when you put a
#CONDITION trigger into the command line? Does it create a folder;
what does it do exactly.

Been so long that I've forgotten ^_^

Ton Diening
Reply with quote
Deneir
Beginner


Joined: 14 Feb 2003
Posts: 19
Location: USA

PostPosted: Fri Feb 14, 2003 10:32 am   
 
Try something easy :)
#trigger {Its Empty} {drink 2.skin}
or u can set up a bunch of variable type triggers
#Trigger {You drink water out of container} {#if (@Drink=0) {drink container 1} {drink container 2}
When u drink from the container count how many times till its empty then set a trigger to the Drink Prompt
#trigger {You drink from a waterskin} {#add Drink -1}
#trigger {You fill a waterskin from a fountain} {#vari Drink 20}
u2u of course i prefer multiple triggers to one big long one more chances of mistakes on the long one

The Shadows of the world will on day inhabit true form and dominate all your souls....
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Feb 14, 2003 12:31 pm   
 
I guess it will do the same as it would do for any other command it does not recognize: ignore it.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 14, 2003 7:16 pm   
 
It's only been two months. I agree with Kjata, #COND will be ignored. What might be creating a class folder is the #TRIGGER command.

In any case, I already provided a simple trigger in Editor format (trigger window), as jeeperv6 requested.

LightBulb
Advanced Member
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