Forum Topic: AS: Inventory 1

(4,083 views • 24 replies)

This topic is 1 page long.

<< < > >>
None

Inglor

Reply To Post Reply & Quote

Posted at: 7/2/05 05:04 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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.


None

Toast

Reply To Post Reply & Quote

Posted at: 7/2/05 05:40 PM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,918

Not bad,pretty basic.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/2/05 06:02 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


Happy

Nemo

Reply To Post Reply & Quote

Posted at: 7/2/05 06:10 PM

Nemo LIGHT LEVEL 34

Sign-Up: 06/13/03

Posts: 1,895

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


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/2/05 06:11 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


None

IWantSomeCookies

Reply To Post Reply & Quote

Posted at: 10/17/05 11:06 AM

IWantSomeCookies LIGHT LEVEL 13

Sign-Up: 08/20/04

Posts: 3,295

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


None

Rustygames

Reply To Post Reply & Quote

Posted at: 10/17/05 01:52 PM

Rustygames LIGHT LEVEL 18

Sign-Up: 05/07/05

Posts: 6,662

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


None

oscar-the-duck

Reply To Post Reply & Quote

Posted at: 10/17/05 02:07 PM

oscar-the-duck NEUTRAL LEVEL 01

Sign-Up: 07/24/05

Posts: 8

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.


None

fwe

Reply To Post Reply & Quote

Posted at: 10/17/05 03:26 PM

fwe DARK LEVEL 08

Sign-Up: 07/24/03

Posts: 3,361

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

wtfbbqhax


None

Rustygames

Reply To Post Reply & Quote

Posted at: 10/17/05 03:49 PM

Rustygames LIGHT LEVEL 18

Sign-Up: 05/07/05

Posts: 6,662

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


None

Inglor

Reply To Post Reply & Quote

Posted at: 10/17/05 04:13 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


None

Rustygames

Reply To Post Reply & Quote

Posted at: 10/17/05 04:26 PM

Rustygames LIGHT LEVEL 18

Sign-Up: 05/07/05

Posts: 6,662

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


None

Hoeloe

Reply To Post Reply & Quote

Posted at: 4/29/06 11:58 AM

Hoeloe LIGHT LEVEL 28

Sign-Up: 04/29/04

Posts: 5,014

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

Sex!
------------------------------
Super Nuke Bros. Melee, the web's no. 1 awaited Super Smash Tribute Game!

BBS Signature

None

Hoeloe

Reply To Post Reply & Quote

Posted at: 4/29/06 12:04 PM

Hoeloe LIGHT LEVEL 28

Sign-Up: 04/29/04

Posts: 5,014

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

Sex!
------------------------------
Super Nuke Bros. Melee, the web's no. 1 awaited Super Smash Tribute Game!

BBS Signature

None

Hoeloe

Reply To Post Reply & Quote

Posted at: 4/29/06 12:09 PM

Hoeloe LIGHT LEVEL 28

Sign-Up: 04/29/04

Posts: 5,014

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 ;)

Sex!
------------------------------
Super Nuke Bros. Melee, the web's no. 1 awaited Super Smash Tribute Game!

BBS Signature

None

mazuibentou

Reply To Post Reply & Quote

Posted at: 5/18/06 03:05 AM

mazuibentou LIGHT LEVEL 06

Sign-Up: 11/10/04

Posts: 182

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


None

Plumb

Reply To Post Reply & Quote

Posted at: 6/22/06 06:28 PM

Plumb NEUTRAL LEVEL 07

Sign-Up: 05/06/06

Posts: 132

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


None

catman03

Reply To Post Reply & Quote

Posted at: 7/9/06 02:57 PM

catman03 DARK LEVEL 16

Sign-Up: 07/05/06

Posts: 2,127

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.


None

mothballs

Reply To Post Reply & Quote

Posted at: 7/29/06 01:18 PM

mothballs DARK LEVEL 23

Sign-Up: 11/16/05

Posts: 2,662

You should have made this in a flash tutorial.

Why did the rooster cross the road? COCK JOKE, LOLOLOL
Metal Hell
Dog penis.

BBS Signature

Questioning

UKZ

Reply To Post Reply & Quote

Posted at: 7/29/06 01:27 PM

UKZ NEUTRAL LEVEL 16

Sign-Up: 04/11/06

Posts: 298

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

None

sniffy-gerbil

Reply To Post Reply & Quote

Posted at: 12/11/06 07:43 PM

sniffy-gerbil NEUTRAL LEVEL 08

Sign-Up: 04/14/06

Posts: 166

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. :)


Questioning

AshSamael

Reply To Post Reply & Quote

Posted at: 4/23/07 12:59 PM

AshSamael LIGHT LEVEL 22

Sign-Up: 01/19/04

Posts: 33

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

Questioning

jobizzie

Reply To Post Reply & Quote

Posted at: 4/23/07 01:06 PM

jobizzie NEUTRAL LEVEL 04

Sign-Up: 08/21/06

Posts: 92

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


None

Jereminion

Reply To Post Reply & Quote

Posted at: 4/23/07 02:13 PM

Jereminion NEUTRAL LEVEL 07

Sign-Up: 11/06/05

Posts: 1,155

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

Kill zombies http://www.newgrounds.com/portal/vi ew/503827
Manage a smoke shop. http://www.newgrounds.com/portal/vi ew/507244
Want to help with a flash game? visit my blog.


Crying

WasabiClock

Reply To Post Reply & Quote

Posted at: 8/27/07 03:27 PM

WasabiClock EVIL LEVEL 11

Sign-Up: 08/17/07

Posts: 293

I don't understand this at all


All times are Eastern Standard Time (GMT -5) | Current Time: 11:44 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!