Stopping a command line + gum

dennis
19 Feb 2005, 00:20
Any chance of stopping a command line in its tracks??

I tried to make a "as if user input a command" hoping that would brake off my code to stop the player getting the global chew command done to all the new instances to the different stages of chewing gum.. But of course being a bear of little brain - that too failed. Is there any way of stopping a process in a command line.

I really would not fancy having to have 4 different chewing gum items - because I'd like for the player only to need to type "chew gum". Not "chew gum" then "chew chewed gum" etc..

Ideas anyone?
Heres my bad excuse for chewing gum code:


	command <Chew gum; Chew #text#> {
if got <gum> then {
msg <Holy!... Wow.. thats.. Mmm|nYeuch! Horrible!!|n>
hide <gum>
give <Sticky lump of chewed licoriche gum.>
exec <wait>
}
else msg <Um... No, on second thoughts. No.>
if got <Sticky lump of chewed licoriche gum.> then {
msg <Uhh.. Not pleasant.. really really.. well salty..>
hide <Sticky lump of chewed licoriche gum.>
give <Chewed Sticky lump of chewed licoriche gum.>
exec <wait>
}
if got <Chewed Sticky lump of chewed licoriche gum.> then {
msg <Brrr.. Hmm.. well.. It's not good.. but.. well. Not too bad you suppose.>
hide <Chewed Sticky lump of chewed licoriche gum.>
give <Chewed out really sticky lump of gum.>
exec <wait>
}
if got <Chewed out really sticky lump of gum.> then msg <Yum.. It's quite good. A shame the flavour all but chewed out now..>
}
command <wait> msg <Time passes..>



(Now I must really get some sleep, rock'n'roll lifestyle etc. tomorrow..)

paul_one
19 Feb 2005, 06:13
Instead of hiding the object, try moving the object to a different room (to a room that doesn't exist is good).

That way, the player doesn't have that item, so it won't do that part of the code.

dennis
19 Feb 2005, 14:07
I'm now moving the gum to my 'inventorium' instead, and the effect is the same.

The problem is, I believe, that the player is given the gum in the same instance as it is chewed, so all the gum variants are given out while the chew command is still active.

I need for the chew gum command to stop when the gum has been exchanged for Chewed gum. When the next chewed gum command is given it checks for the Chewed gum and gives the player the "very chewed gum"etc..

I have yet to succeed.. But I will figure it out or die!

paul_one
20 Feb 2005, 02:32
Put all the if's in the reverse-order...

What's happening right there is that it's going through one after the other, giving the player the item, then checking, then moving on down.
If you put the if's upside-down, then it will check, then move onto the next check - instead of giving him the next item.

dennis
20 Feb 2005, 16:52
That is deviously clever!