Biosware |
Ok, here's the deal: Me and my friend are currently writing a simple AGI game (both complete newbies with it) - and got stuck in the second room :D It's supposed to include a fridge which you could open and take the food inside. So how do we make sure the program knows when the food is taken? Is there an "if cel"-command or something to do this with, or must we use flags? Thanks for taking time to think about something this stupid... :D |
Kon-Tiki |
There's no if-cell command, but there're two ways of doing what you want. The easiest and most secure way is by setting a flag. This way, when the object is gone by using it, it won't be in the fridge again. The other way is by using the if (has(objectname)) {-command. This checks wether the player has an object in his inventory. Off course, if he lost it later on it the game, it'll be back there. |
Rich | Even better than that. Set the object to being in that room when you create it. Then do a if(obj.in.room()) command to see whether it can be gotten or whether a cel should be drawn for it. |