Seemple eenventory

Get help using Construct 2

Post » Mon Sep 02, 2013 6:17 am

Okay like totally, like oh my goood, like whatever, liiiiike....

Totalleh can't figure this out, I mean, I look up tha tutorialz on inventories and I just don't get it, but they get real descriptibe about a bunch of stuff my mind cannot comprehend.

I wish I could understand arrays, I really do, I look up videos and read stuff online and I see things happening but I just don't get it.

What practically all of them lack is a reference to how certain things would work with actual video games. If they showed stuff like that, that would make everything like totalleh easier. I guess i'm more of a visual learner.

Anyways I just started on a tangent so I will just ask this quick.
I'm working on a rpg, and have gotten to this very crucial part. I just need an inventory system where you get an item, and they show up as text in a menu that can be pulled up later. I also of course need it possible to throw away items, and have all items able to be stacked. If you ever played super hydlide, that is EXACTLY the system I am looking for.
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Mon Sep 02, 2013 7:45 am

Visual Learning Array:
http://www.youtube.com/watch?v=oyqW_UJNux8

Now that you watched video:
This is pretty good: https://www.scirra.com/tutorials/614/array-based-inventory/page-1
And so is this one:
https://www.scirra.com/tutorials/244/rpg-inventory-drag-and-dropDUTOIT2013-09-02 07:48:28
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Mon Sep 02, 2013 7:56 am

Dictionary is simplier than array.
slot1 = "text1"
slot2 = "text2"
etc
Delete key "slot2" deletes entire slot2 entry.

And you can get either the key or value so you can see if he has slot2 filled, or if he has cold coin
Its super easy to understand
Add key "slot3" value "text3"

So we have:
slot1 = "text1"
slot2 = "text2"
slot3 = "text3"
Very simple inventory system. But arrays are better, but dictionaries are simple.
https://www.scirra.com/manual/140/dictionaryDUTOIT2013-09-02 07:57:32
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Mon Sep 02, 2013 6:19 pm

The video was fine, but I still don't know how to come up with an inventory idea out of it. The tutorial here https://www.scirra.com/tutorials/614/array-based-inventory/page-1

Was okay until he showed his visual algorithm, because then everything just got real complicated way to fast. And the last tutorial isn't exactly what I'm trying to do.

B
11
S
2
Posts: 91
Reputation: 1,017

Post » Tue Sep 03, 2013 7:42 am

You can't build an array without wrapping your head around how it works/looks
Think 3 dimensional.
http://www.plantation-productions.com/Webster/www.artofasm.com/Linux/HTML/Arraysa2.html

And when you understand, then its a lot of work and lots of testing to ensure that correct data is being stored, retrieved etc

It doesn't always work out as you planned and requires a lot of trial and error. I've been busy for the last month on data storage and retrieval. Some data needs to be randomized, some needs to checked against multiple criteria, no duplicates etc etc etc and I have not even halfway done.

Inventory systems are easy - wait till you have your hero accoplish tasks and check that those task are done in order to unlock/lock other tasks - lol.
I haven't made a rpg, but what I've heard it is one of the hardest games to make - lol, don't worry, they say it's also one of the most rewarding.

Check out C-7's game - http://www.scirra.com/forum/courier-play-now_topic62387.html
For inspiration Motivation And help keep you see bigger picture DUTOIT2013-09-03 07:51:42
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Wed Sep 04, 2013 2:59 am

An rpg does seem difficult to create, but I have a good idea on how to implement everything so far, stats, leveling, attacking, algorithms and all that.

But this inventory system is literally the one thing that has been standing in my way the past few days. I really would like to figure this out. You mentioned dictionaries, those seem like a better idea for this.

Can you go a little more in depth with them? Are they able to work this way: Items can get added and show as text, maximum amount of slots, items can be thrown away, number of specific item shown next to it?

Please if you could just explain a little bit more. This has been really frustrating. I found this tutorial and it seems to be what I want https://www.scirra.com/tutorials/583/easy-inventory-using-an-array but I'm having a stupid amount of trouble trying to figure out how to replace the imagery with text.
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Wed Sep 04, 2013 3:25 am

[QUOTE=Basilboy]I found this tutorial and it seems to be what I want https://www.scirra.com/tutorials/583/easy-inventory-using-an-array but I'm having a stupid amount of trouble trying to figure out how to replace the imagery with text.[/QUOTE]

Hi, tutorial creator here. Could you explain what exactly you mean by "how to replace the imagery with text." I'm sure I could help you figure it out.
B
46
S
14
G
7
Posts: 603
Reputation: 8,116

Post » Wed Sep 04, 2013 3:27 am

So your items are images and change animations depending on the item ID right? Well i'm trying to replace it so that instead of the colored block showing in the slots, it's text depicting the item instead.
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Wed Sep 04, 2013 3:56 am

You could store all the item names in a string as Item1;Item2;Item3 then replace all the stuff to do with the item object using a text object. And then for setting the animation name just do
Text: Set Text to tokenat(ItemNames, ItemID - 1, ";")
That will get the item name from the string at ItemID. the - 1 is there because 0 in your item index would be nothing whereas the itemlist's 0 would be an item name.

I'm not completely sure if the above makes sense, I'm very tired right now.EncryptedCow2013-09-04 04:01:03
B
46
S
14
G
7
Posts: 603
Reputation: 8,116

Post » Wed Sep 04, 2013 4:06 am

Could you make a capx of what you explained sometime?
B
11
S
2
Posts: 91
Reputation: 1,017

Next

Return to How do I....?

Who is online

Users browsing this forum: htmlgames, Matei511 and 61 guests