Best way to design an inventory?

Get help using Construct 2

Post » Mon Feb 20, 2017 7:47 pm

Hey there! ^_^
Basically i am currently designing an inventory system and i would like to ask - what is the best way to do it without causing lags? Ie not hiding it on an invisible layer or something, since having 100 items+, always invis on a laywer may cause delay.
So what is the best way if not using a new layout for it?

Any1 knows or got any examples?
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon Feb 20, 2017 9:12 pm

Greaver wrote:Hey there! ^_^
Basically i am currently designing an inventory system and i would like to ask - what is the best way to do it without causing lags? Ie not hiding it on an invisible layer or something, since having 100 items+, always invis on a laywer may cause delay.
So what is the best way if not using a new layout for it?

Any1 knows or got any examples?


Using the invisible layer would only cause a short lag when the game loads and should not lag after running.

For that many items an array system would be a massive headache and those are the only two ways I know to do it. I use a hidden layer for an inventory of about 250 items and it causes a short lag when loading but I just use a message telling the user to wait while I am creating monsters and objects lol!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Mon Feb 20, 2017 9:50 pm

lamar wrote:
Greaver wrote:Hey there! ^_^
Basically i am currently designing an inventory system and i would like to ask - what is the best way to do it without causing lags? Ie not hiding it on an invisible layer or something, since having 100 items+, always invis on a laywer may cause delay.
So what is the best way if not using a new layout for it?

Any1 knows or got any examples?


Using the invisible layer would only cause a short lag when the game loads and should not lag after running.

For that many items an array system would be a massive headache and those are the only two ways I know to do it. I use a hidden layer for an inventory of about 250 items and it causes a short lag when loading but I just use a message telling the user to wait while I am creating monsters and objects lol!


Hehe nice!! ^_^
So basically when inventory is ''off'' you set the layer to invisible and pause it? Then when its ''on'' you pause the game and make the inventory layer visible ?
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon Feb 20, 2017 10:13 pm

Greaver wrote:
Hehe nice!! ^_^
So basically when inventory is ''off'' you set the layer to invisible and pause it? Then when its ''on'' you pause the game and make the inventory layer visible ?


There are a few ways to do it and that is one. I make it visible on call or you can even do it in a separate layout.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Tue Feb 21, 2017 12:19 am

InyTinny more a system. Can just delete the array, and it still works. But at 1 point you need the array to easily store inventory in local storage and recreate inventory from local storage. And then this is the way to go. Every instance variable on 1 place in the array.

https://www.dropbox.com/s/lofat0vb0xwaf ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Feb 21, 2017 4:10 pm

99Instances2Go wrote:InyTinny more a system. Can just delete the array, and it still works. But at 1 point you need the array to easily store inventory in local storage and recreate inventory from local storage. And then this is the way to go. Every instance variable on 1 place in the array.

https://www.dropbox.com/s/lofat0vb0xwaf ... .capx?dl=0


Hehe wow very nice!! ^_^
Is there a way to do this without drag and drop? Like with cursor for control?
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Tue Feb 21, 2017 4:16 pm

99Instances2Go wrote:InyTinny more a system. Can just delete the array, and it still works. But at 1 point you need the array to easily store inventory in local storage and recreate inventory from local storage. And then this is the way to go. Every instance variable on 1 place in the array.

https://www.dropbox.com/s/lofat0vb0xwaf ... .capx?dl=0


Now that is a real nice use of arrays!

I think I will borrow that for my platform builder. The window popup and drag and drop is prefect for that use.

Thanks!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Tue Feb 21, 2017 5:06 pm

Greaver wrote:Is there a way to do this without drag and drop? Like with cursor for control?


Yes of course. In fact, all the drag&drop does (and matters) in the example is selecting inv spots and objects.
Any other way you pick them is fine.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Feb 21, 2017 6:40 pm

99Instances2Go wrote:
Greaver wrote:Is there a way to do this without drag and drop? Like with cursor for control?


Yes of course. In fact, all the drag&drop does (and matters) in the example is selecting inv spots and objects.
Any other way you pick them is fine.


If by controller, then how to do it -> picked up item, pin on first available slot? Instead of doing it urself?
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Tue Feb 21, 2017 11:03 pm

Instead of doing it urself? Ya mean literally? Cant believe i fall 4 that.
Anywayz, as i said already: all you need is a system that selects things.
You should have made one that YOU like&love to play with, and shared it.

But since you are literally. Here goes 1 way of 1 billion.

https://www.dropbox.com/s/6el1j20sbr0rl ... .capx?dl=0

I cant test this myself, i dont own a 90tys game pad. At least change the button to something you can remember/use.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to How do I....?

Who is online

Users browsing this forum: ChoosyZerk and 60 guests