AS: Inventory 1 2005-07-02 17:04:07
This covers very very basic inventory creation, no knowledge of arrays needed ;)
My next inventory tutorial (Inventory 2) will cover better inventory creation.
This will allow you to create:
A simple 1-about 20 object inventory.
So let's begin:
All objects (that are pickable) on the screen need to have an ID (identifier number to differ them from other objects), and the following code
_root.inventory[_root.available].gotoAndStop(<id code here>);
remmember to have _root.available=1 on the first frame actions;
each ID will have it's frame on the inventory symbol, the inventory symbol itself is a square movieclip. remmember to name each inventory symbol inventory1 inventory2... inventoryN
now on _root you need to select available, paste this code, the onEnterFrame part runs every frame, if you don't want to mess with this code, you can just create 8 different inventory symbols, each with a different "object" to fit, and each will have gotoAndStop(2); when the object is present and gotoAndStop(1); if it's now.
every time you click an item (add it) you
btw, to remove an item you move every item in the following inventory ID's (1... N) one MC back, and change a var or something.
So how do I check for the objects?
run a simple loop on the inventory symbols or keep a variable ;)
ask any questions, wasn't very detailed, so feel free.