simple inventory

Get help using Construct 2

Post » Wed Mar 13, 2013 12:13 am

Before i start, I know this subject has been discussed before and I have read through the topics I can find. but most are to complicated for what I need or not relevant to what I need.

I want to build an inventory that works as follows:

  • player finds an item (lets say key)
  • player clicks on key
  • key is added to inventory
  • player comes to locked door
  • player clicks on door, if player has key door opens, key is destroyed


I know how to do the above... next the bit I cant do:

  • player clicks inventory button
  • pictorial representetain of iventory is displayed
  • player clicks on item
  • item discription is shown (ie if player has a map, map is shown)
  • player moves from layout 1 to layout 2, inventory remains intacked.


any help would be very helpful
B
10
S
4
G
3
Posts: 53
Reputation: 2,613

Post » Wed Mar 13, 2013 1:25 am

I'm not exactly sure what you consider simple, but unless you're only going to have an inventory big enough for a couple items, you'll need to get comfortable using Arrays. There are some very helpful tutorials going over the basics of array in the tutorials sections of the site. I'd recommend you check them out.

Here's an annotated demo. The inventory is stored in an array, so it will be saved between layouts.

Demo
Capx

I hope this helps.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Wed Mar 13, 2013 11:42 am

thanks for the response, that looks exactly what i am looking for, however your capx was made in the 121 beta, so i cant load it into my 119 stable, could you possibly save your 121 capx as a 119 for me please
B
10
S
4
G
3
Posts: 53
Reputation: 2,613

Post » Sun Mar 17, 2013 1:23 pm

I have been playing around with this and come up with a very simple way of doing this using the dictionary. I found that arrays were just too complicated, and overkill.

Capx:
https://www.dropbox.com/s/goul4up17byozb9/simpleinv.capx
B
10
S
4
G
3
Posts: 53
Reputation: 2,613

Post » Tue Nov 04, 2014 5:01 pm

thanks for sharing the inventor
but i have problem when i change layout it reset the inventory

oh player moves from layout 1 to layout 2, inventory remains intacked. i didnt see :D
B
7
S
1
Posts: 16
Reputation: 561


Return to How do I....?

Who is online

Users browsing this forum: Kagubro and 25 guests