00:00
00:00

AS: Inventory 1

6,210 Views | 24 Replies
New Topic Respond to this Topic

AS: Inventory 1 2005-07-02 17:04:07


AS: Main

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

on(release){
_root.inventory[_root.available].gotoAndStop(<id code here>);
_root.available++;
}

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.

Response to AS: Inventory 1 2005-07-02 17:40:23


Not bad,pretty basic.


BBS Signature

Response to AS: Inventory 1 2005-07-02 18:02:06


of course it's basic, I have 6/8 advanced tutorials but only 1 basic one :P

Response to AS: Inventory 1 2005-07-02 18:10:48


You're really getting into this AS:____ stuff? I need to think of a good tutorial to make, while I'm on the subject :-)


BBS Signature

Response to AS: Inventory 1 2005-07-02 18:11:44


I kinda wanted to make a basic tutorial since most of my stuff is advanced and probebly won't reach that much people ;)

yea, I'm getting into AS: _____ stuff :P

Response to AS: Inventory 1 2005-10-17 11:06:11


Wow, this could come into handy when making future games. The AS: collection is so handy.


"Actually, the server timed out trying to remove all your posts..."

-TomFulp

Response to AS: Inventory 1 2005-10-17 13:52:28


At 10/17/05 11:06 AM, IWantSomeCookies wrote: Wow, this could come into handy when making future games. The AS: collection is so handy.

Wow Observation of the year award


- Matt, Rustyarcade.com

Response to AS: Inventory 1 2005-10-17 14:07:54


At 10/17/05 01:52 PM, Ninja-Chicken wrote:
At 10/17/05 11:06 AM, IWantSomeCookies wrote: Wow, this could come into handy when making future games. The AS: collection is so handy.
Wow Observation of the year award

You're not funny loser.

Response to AS: Inventory 1 2005-10-17 15:26:48


You didn't define the inventory array, meaning it wouldn't work


wtfbbqhax

Response to AS: Inventory 1 2005-10-17 15:49:12


At 10/17/05 02:07 PM, oscar_the_duck wrote:
At 10/17/05 01:52 PM, Ninja-Chicken wrote:
At 10/17/05 11:06 AM, IWantSomeCookies wrote: Wow, this could come into handy when making future games. The AS: collection is so handy.
Wow Observation of the year award
You're not funny loser.

ha ha welcome to newgrounds prick oops sorry youve been here a while so you should know the rules including
NO ALTS

faggot

- Matt, Rustyarcade.com

Response to AS: Inventory 1 2005-10-17 16:13:54


At 10/17/05 03:49 PM, Ninja-Chicken wrote: ha ha welcome to newgrounds prick oops sorry youve been here a while so you should know the rules including
NO ALTS
faggot

actually that account was created by puzz over a year ago, the password is pretty well known, it could be just about anyone

Response to AS: Inventory 1 2005-10-17 16:26:53


At 10/17/05 04:13 PM, Inglor wrote:
At 10/17/05 03:49 PM, Ninja-Chicken wrote: ha ha welcome to newgrounds prick oops sorry youve been here a while so you should know the rules including
NO ALTS
faggot
actually that account was created by puzz over a year ago, the password is pretty well known, it could be just about anyone

Really
Why is there only 2 posts then?
Oh well whoever it was is a fag and is obviously too scared to show who they really are


- Matt, Rustyarcade.com

Response to AS: Inventory 1 2006-04-29 11:58:53


i dont get it... its not explained very well for someone who hasn't the faintest idea what the hell your talking about...


BBS Signature

Response to AS: Inventory 1 2006-04-29 12:04:23


i understand it now, but it doesn't work... i am using flash mx 2004, i dunno if that will change it...


BBS Signature

Response to AS: Inventory 1 2006-04-29 12:09:18


fixed it, if your using flash mx, this will replace the code on the item:
on(release){
_root["inventory"+_root.available].gotoAnd
Stop(<id code here>);
_root.available++;
}
hope that helps ;)


BBS Signature

Response to AS: Inventory 1 2006-05-18 03:05:05


the briefness of this confuses me. so you make an MC with an instance name of inventory
on the first frame in this MC add _root.available=1

make a button with no instance name. add this code to the button:

on(release){
_root.inventory[_root.available].gotoAndSt
op(1);
_root.available++;
}

and then if you click the button it adds it to the inventory? not working for me... and im sure yall are gonna say nooooo you noob. well yes im a definate noob

Response to AS: Inventory 1 2006-06-22 18:28:35


Love it, great tut man :D, will definetly use it.

Response to AS: Inventory 1 2006-07-09 14:57:20


none of this has worked!(im using flash 8)ive tried everywhere and nobody has any help!nothing works!i am such a noob and i know it but just please help!


We are the resistance, we are the underground, we are Newgrounds: home of the original cock joke.

The world takes everything too seriously.

This is not a signature.

Response to AS: Inventory 1 2006-07-29 13:18:06


You should have made this in a flash tutorial.

Response to AS: Inventory 1 2006-07-29 13:27:24


ok see i have an inventory with five slots each instance names inventory1 inventory 2 and so on and so forth. i need the AS for when i click an object the object goes into the inventory slots.


Crews:

Graffiti Crew

Stoner's Club

BBS Signature

Response to AS: Inventory 1 2006-12-11 19:43:48


It's basic, a little too basic.
I think you need to explain a little more.
If it fits into the basic section, you need to explain a lot because it's for beginners.

Good code in the end though. :)

Response to AS: Inventory 1 2007-04-23 12:59:37


Hey Inglor, your tutorial rocks, but I couldn't get one thing: how does the item add itself to the second slot if the first one is occupied?


HEADSHOT!

BBS Signature

Response to AS: Inventory 1 2007-04-23 13:06:52


Is the ID code the instance name?
Good tutorial though. :)

Response to AS: Inventory 1 2007-04-23 14:13:30


can you post an example swf to see if this is what i want(or what other people wnat)

Response to AS: Inventory 1 2007-08-27 15:27:25


I don't understand this at all