Money system and end level.

For questions about using Classic.

Post » Wed Oct 22, 2008 1:27 pm

At least 14 different types in all, I think that the easier way will be sufficient for now, once i know how to do the basics i catch on pretty quickly.

Edit: I should say, max number that would be in the inventory (unequipped) is five or so.
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Fri Oct 24, 2008 4:32 pm

Sorry to bump this, but i still need advise please.
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Fri Oct 24, 2008 6:12 pm

[quote="mikybee93":13pxc04p]Sorry to bump this, but i still need advise please.[/quote:13pxc04p]

Post an example of how you're doing it either in [code] tags, or by posting your .cap. It'll be easier for one of us to see what's going wrong.

(Oh, hey... my sig is active :).)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Oct 25, 2008 7:10 am

Hmmm it sounds like you want to have a very "Diablo" style inventory system...

That's a little tricky... in fact, I'm not even quite sure where to start.

One other thing... will each item take up "1 square" in the inventory, or will some items be larger than others, taking up more squares?

All of these questions will help me figure out exactly what you are wanting to do, so I can try to come up with the best way to go about it.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sat Oct 25, 2008 7:51 am

Okay, here's as much detail as i can give.

Each item takes up one square, sort of like most RPG games, not like diablo.
I'm going to have somewhere around 5-10 items in the inventory at max.
It doesn't matter if it is always showing, like a bar on the bottom of the screen. I don't need it to pop up when i click something.
All i really want is for someone to be able to click on a weapon and equip it with that click.
Also, i need the weapon to be transferred to the inventory when you buy it from the shop.

I really have no idea how this would be possible at all, since this is my first time every attempting to create a game.
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Sun Oct 26, 2008 2:10 am

OK cool, that gives me enough information to give you some direction, at least to get started.

Keep in mind I tend to take a very practical approach to things since I am terrible at maths... so I'm sure there are better ways of going about this, but, this should work just as good.

Lets assume you are making an inventory that can hold 5 things, and it's a menu/quick bar somewhere on the screen.

The first thing you will need is a global value to indicate the amount of free spots in the inventory, so in this case 5. Make a global value called "inventory" or something like that, and at the start of the layout set the number to 5, so you have 5 free spaces.

Next, make each square of your inventory as a sprite object. You should be able to make just one object and copy+paste the rest. Each of these objects will need a private variable called something like "item", and the values will need to be set to 0 (0 for no item, 1 for item is in that spot). Again at the start of the layout set all the private variables for each box to 0.

Now, you will obviously need some icons for your items so you can see them in the inventory when you pick them up etc. Once you have these, and have some items to collect...

When you collect an item, compare the global value "inventory" and make sure that it is at least 1 or greater. If it is 1 or greater, then minus 1 from that value, then pick one of the inventory boxes, and compare the private value "item" and make sure that it is equal to 0. Make that value 1, then set the icon for the item type to the x.y of the inventory object.

It is a very basic way to make an inventory system, but it should work pretty well, especially since you don't seem to require any crazy dynamic inventory sorting system.

Basically see if that information helps... if not then I'll try to make something simple to give you the idea, but I haven't got a lot of time lately since I have been really busy at work etc. Christams is coming and we are starting to pick up in the shop already.

Hope that helps a little at least.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Oct 26, 2008 9:49 am

That really helps =)

One thing though is that when i try to add the condition 'Inventory' greater than 0, it keeps changing 'Inventory' to 'Money'.
Is this common?
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Mon Oct 27, 2008 12:53 pm

[quote="mikybee93":t3uxo4kk]That really helps =)

One thing though is that when i try to add the condition 'Inventory' greater than 0, it keeps changing 'Inventory' to 'Money'.
Is this common?[/quote:t3uxo4kk]

Not exactly sure what you mean by this?

Each variable is seperate... do you mean the variable "money" is getting the value for the variable "inventory"?

Maybe post your .cap or something if you can't figure it out, then I can take a look at it. :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Tue Oct 28, 2008 8:48 am

What i mean is, when i try to say 'inventory' it automatically changes to 'money'

PS: This isn't with the final sprites yet, i have a lot of work to do. At the moment I'm trying to make the engine.

http://www.mediafire.com/?imc0tmnkjln

The problem occurs on the shop page, event # 5
It says 'Money' greater or equal 1
I want it to say 'Inventory' greater or equal 1
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Tue Oct 28, 2008 10:24 am

Change [code:3c34awed]'Inventory'[/code:3c34awed] to [code:3c34awed]global('Inventory')[/code:3c34awed]
I think that fixes it...
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests