Author Topic: If cel...?  (Read 1633 times)

0 Members and 1 Guest are viewing this topic.

Biosware

  • Guest
If cel...?
« on: January 17, 2004, 02:32:22 PM »
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

  • Guest
Re:If cel...?
« Reply #1 on: January 17, 2004, 05:54:19 PM »
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.

Offline Rich

Re:If cel...?
« Reply #2 on: January 17, 2004, 07:39:51 PM »
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.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.037 seconds with 17 queries.