Hello all. Thanks to Alex I wa finally able to sign up for the forum again. I am sure you probobly don't remember me because it has been soooo long. I lost internet access for a long time, and had a computer crash so lost all that hard learned code that madbrit had helped me write. I wish I remembered how to do loops. But I haven't forgotten everything. Still, I need help. Right now I am working on trying to figure out how to make drinks for my tavern that don't last forever.
command <drink #@object#> if type <#object#; drinkable> and action <#object#; drink> then { doaction <#object#; drink> dec <drinkammount; 1> if ( drinkammount = 0 ) then { doaction <#object#; empty> lose <#object#> } } else { if type <#object#; drinkable> then { msg <You take a drink of the #object#.> dec <drinkammount; 1> if ( drinkammount = 0 ) then doaction <#object#; empty> } else msg <You can't drink that.> } end define
define object <beer> invisible action <order> { msg <Guir slides a mug of beer across the counter to you and you pick it up.> clone <beer1; a mug of beer; Silver Dagger Inn and Tavern: Common Room> give <a mug of beer> } end define
define room <Food Storage>
define object <beer1> alias <mug of beer> alt <beer> take prefix <a> type <drinkable> type <TLTcontainable> properties <drinkammount=10> action <order> action <drink> action <empty> msg <You finish the beer and set the mug on the counter.> end define
I know I am likely missing something extremely obviouse, so if someone would just point out my mistake I would be ever so grateful.
Thanks, Shadow
witch wyzwurd
10 Oct 2006 18:06
Trying to decipher your code, and with my small amount of knowledge in eyeing hard-ASL, the only thing I see is that your "if drinkammount" statements lack %-symbols enclosing your numeric variable name.