by Bainespal » Tue Dec 20, 2011 6:00 pm
I must have forgotten about the run directive. Thanks for pointing out that I need to set the verbroutine, too. Now it compiles, at least, but it still doesn't do what I want.
The PC has a plate on which is a meal object that he eats as part of the scene (the object counts the number of bites taken, but that code doesn't affect this). If the player tries to eat without holding three silverware objects, the game asks, "What, with your fingers?" using the Informal Questions code. If the player responds, "yes", the same action that happens without a question if the PC is holding the silverware is triggered, but a different suffix is printed after the message (", picking it up messily with your hands.").
The library DoEat verb appears to be designed to be implemented in after routines. Therefore, the actions taken in response to eating the meal are implemented in your_meal.after, including the printed message. There's a condition in after to print a period if the PC is holding the silverware, because then the suffix about eating with your hands hasn't been printed.
I decided to check if the PC is holding the silverware and to call NewQuestion in before, since its naturally called before after gets a chance.
I could test for whether or not the silverware is carried in the same routine in which the main code for handling DoEat is located, but I would still need a way to jump back to the main DoEat code, to print the message and execute the rest of the code. I thought it would be easier to go back and forth if I used both before and after. What I ultimately need to do is call your_meal.after from DoYes, and then go back to DoYes to print the suffix.
This is the only way my brain can conceive of structuring this code. Maybe I'm making it more complicated than it needs to be. Sorry to waste your time. :)
I must have forgotten about the run directive. Thanks for pointing out that I need to set the verbroutine, too. Now it compiles, at least, but it still doesn't do what I want.
The PC has a plate on which is a meal object that he eats as part of the scene (the object counts the number of bites taken, but that code doesn't affect this). If the player tries to eat without holding three silverware objects, the game asks, "What, with your fingers?" using the Informal Questions code. If the player responds, "yes", the same action that happens without a question if the PC is holding the silverware is triggered, but a different suffix is printed after the message (", picking it up messily with your hands.").
The library DoEat verb appears to be designed to be implemented in [b]after[/b] routines. Therefore, the actions taken in response to eating the meal are implemented in your_meal.after, including the printed message. There's a condition in [b]after[/b] to print a period if the PC is holding the silverware, because then the suffix about eating with your hands hasn't been printed.
I decided to check if the PC is holding the silverware and to call NewQuestion in [b]before[/b], since its naturally called before [b]after[/b] gets a chance.
I could test for whether or not the silverware is carried in the same routine in which the main code for handling DoEat is located, but I would still need a way to jump back to the main DoEat code, to print the message and execute the rest of the code. I thought it would be easier to go back and forth if I used both [b]before[/b] and [b]after[/b]. What I ultimately need to do is call your_meal.after from DoYes, and then go back to DoYes to print the suffix.
This is the only way my brain can conceive of structuring this code. Maybe I'm making it more complicated than it needs to be. Sorry to waste your time. :)