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
Ash
Novice


Joined: 17 Nov 2000
Posts: 31
Location: USA

PostPosted: Sun Sep 01, 2002 3:52 am   

Im sure this could be done but how!
 
Im having problems with a potion quarfing thing. What I want is to be able to quarf a certain kind of potion with one alias and when thats out it'll try the next potion and when thats out the next.

I think the best way would be to keep track of the potions and how many of each there is.
Like theres 5 green.potions, 6 yellow.potions, 4 red.potions and so fourth.

Each time you grab one out of the bag it could subtract 1 from a variable, and vise versa when you put one in a bag it could add one.

What im not sure is how would I create the trigger or alias that could check all this stuff, and move from one potion to the next when its out. And what kind of variables might I need. Im kinda novice to the zmud language and still picking up bits here and there so any help would be mucho appreciated.

-Ash
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Sep 01, 2002 4:47 am   
 
If you're wondering about how to create this, check here:

http://zuggsoft.com/forum/topic.asp?TOPIC_ID=8052&FORUM_ID=7&CAT_ID=1&Topic_Title=Wondering+about+a+Potion+System&Forum_Title=zMUD+General+Discussion

li'l shmoe of Dragon's Gate MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 01, 2002 8:07 am   
 
The easiest way doesn't need variables at all. Get different containers. Use one container for your miscellaneous stuff (armor, loot, etc). Use another container, with a different name or number for healing potions. When you need to heal, just grab any potion from the healing container, no matter what color it is. After all, every potion you put in it will be for healing.

You can use additional containers for mana potions, refresh potions, cure poison potions, etc.

LightBulb
Senior Member
Reply with quote
Ash
Novice


Joined: 17 Nov 2000
Posts: 31
Location: USA

PostPosted: Sun Sep 01, 2002 8:41 am   
 
You got a good point, I never really thought of that. But on the mud I play your dex determines how much you can store in your inventory, so I gotta watch the number of containers I have. But the way I got now if anyones curious is this.

#alias po
#IF (@potion1 > 0) {
get plat.satchel bag
quaff plat.satchel
}
#IF (@potion1 = 0) {#IF (@potion2 > 0) {
get herbal.potion bag
quaff herbal.potion
}}
#IF (@potion2 = 0) {#SH Nothing in Inventory that Heals!!}

#VAR Potion1
#TRIGGER You get a potion encased in a platinum satchel from a small bag.
#AD Potion1 -1

#TRIGGER You put a potion encased in a platinum satchel in a small bag.
#AD Potion1 1

And the same for the next potion I have them in seperate classes within a potion-system class so I dont get them mixed up.

I was wondering, would there be a way to re calibrate my variable numbers, so I could when I start the game examine my small.bag and it'll show you got two potions in a plat satchel, three green potions and whatnot.

I was messing around some and found you could by making triggers for each one but I couldnt figure out how to reset the variables to zero, so I could use the #add to readd how many I had in the container, thus recalibrating how many I had for each.

-Ash
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 01, 2002 4:38 pm   
 
You can set a variable to 0 with:
#VAR potion1 0
A better idea would probably be to make 0 its default value, then it would automatically be set to 0 whenever you connect.
#VAR potion1 0 0

LightBulb
Senior 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