# Creating an inventory system menu

**URL:** <https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055>\
**Category:** programming\
**Created:** [July 28, 2004, 3:45am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055 "2004-07-28T03:45:40Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jugglinggoalie](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jugglinggoalie](https://forum.kirupa.com/u/jugglinggoalie)\
**Post date:** [July 28, 2004, 3:45am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/1 "2004-07-28T03:45:40Z")

</div>

Can anybody show me how to create an inventory system so i can pick up items and press a key to get rid of the inventory menu

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 28, 2004, 8:26am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/2 "2004-07-28T08:26:05Z")

</div>

I wish I had an answer. Ironically I am doing the exat same thing at the moment. I think I have it figured out, but it is no easy task.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 7:55pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/3 "2004-08-03T19:55:05Z")

</div>

??? wha tdo you mean like if you press “i” a inventory menu come up and if you press “i” again if disapears?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 10:16pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/4 "2004-08-03T22:16:58Z")

</div>

I think that’s what he means but also how to make things show up in there.

Say he runs over a ‘sandwich’ and it says ‘obtained sandwich’ then he could press ‘i’ to have his inventory come up and the ‘sandwich’ would be in there. Then if he presses ‘i’, it would go away. (Popping up an inventory can be done with load movie)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 12:26am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/5 "2004-08-04T00:26:15Z")

</div>

what exactly do you want?  
some hotkey systhem, where you press buttons like 1,2,3,… and some item is used?

a system how to create an inventory where you can select and use the things?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 5, 2004, 11:18pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/6 "2004-08-05T23:18:59Z")

</div>

i am in the same dilemma…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 6, 2004, 1:33am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/7 "2004-08-06T01:33:30Z")

</div>

what exactly is the dilemma?

the shortcut thing?  
a dynamic inventory?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 6, 2004, 10:57pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/8 "2004-08-06T22:57:09Z")

</div>

how can u make it so that when you hit test with something it goes to the inventory menu and how do u create the inventory menu in the first place

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 7, 2004, 12:28am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/9 "2004-08-07T00:28:22Z")

</div>

use an inventory array and store a reference to an array containing the items’ informations there.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 8, 2004, 11:14am UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/10 "2004-08-08T11:14:17Z")

</div>

u could do a movie clip which has 2 frames in it one blank and one with the iventoryits starts on blank and then when you press i it goes to frame to and shows then when u press i again

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2004, 6:22pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/11 "2004-08-09T18:22:24Z")

</div>

I thinks its simple…, create an array and put the put the item there, when you press a key just assign this key to the array location.

var items\_weapons:Array = new Array();  
var knife = {letter: ‘A’, number = 3}  
if(Key.isDOwn = knife) {  
actual\_item = item\_weapons[knife.number];  
}  
okay, its not perfect but is a poor exemple, you can do it a lot more dinamic and lot more better…:hair:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 10, 2004, 12:27pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/12 "2004-08-10T12:27:05Z")

</div>

I think I have come up with a way to do an inventory system that allows drag and drop, but I am still trying to code out the details and what not.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 12, 2004, 4:04pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/13 "2004-08-12T16:04:29Z")

</div>

Well Behemoth, if you get that drag and drop system working, could you explain how you did it because I am writing an inventory system where theres 5 boxes and if you press Q it will drop down to about 30 boxes and if you press and hold E for 3 seconds, it will automatically fade out all items and switch the stuff in the boxes into a DO menu which gives you commands you can do. Id like to know how to re-arrange the items so you can select the first 5 that are shown in the smaller menu,

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 13, 2004, 10:12pm UTC](https://forum.kirupa.com/t/creating-an-inventory-system-menu/59055/14 "2004-08-13T22:12:39Z")

</div>

this might not work and sum1 else has prob sed it but i dont care…

1 | 2 | 3

* * *

4 | 5 | 6

draw a table with 6 boxes (dont put numbers)

draw a movieclip with nothin in first frame  
banana in second frame (example)  
pear in third frame (example)

put the instance name as the number of what square it goes on (1-6)

put this code on the banana

**if (this.hitTest(\_root.man) && inventory1 == 0) {  
\_root.1.gotoAndStop(2);  
inventory1 = 1  
} else if (this.hitTest(\_root.man) && inventory2 == 0) {  
\_root.2.gotoAndStop(2);  
inventory2 = 1  
}**

etc

hope this helps

yhack
