Inventory engine for rpg

Looking to build a team or have a job to offer?

Post » Fri May 08, 2015 11:18 pm

I want an inventory with drag and drop like the one in the store that is 40 dollars. Its not just knowing arrays I still need to know the instance variables to setup, system actions, and strings to use, and know how to set it all up. I also like to understand the sequence of actions so that i know whats going on than just messing around. Fireche somethings aren't as easy to some people especially when im more of a visual learner not a reader. which is why i asked for people to skype me and that way i can show through share screen whats going on, i think i'm close to my goal though . I like what lennaert said though its also nice to converse on the forums so that everyone can have this knowledge. feel free to jump in and share how you would tackle this problem

thank you everyone for your thoughts
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat May 09, 2015 1:10 am

In this example that lennaert gave me wouldn't the inventory array 0,2 = check for swordstrength not the amount of the item? i just started creating these arrays and i ran into this question. sorry if this is a silly simple or obvious thing, bear with my dumbness. but i would think i need another Y variable in all items array for "amount" am i right?

example

all items
x,y

0,1 = "sword"
0,2 = swordstrength number
1,1 = "shield"
1,2 = shield strength number
2,1 = "potionX"
2.2 = potion health amount number




Then you have 1 small array, where each item you posses take up a X index, where its Y(1) hold the id from the x based index of your total inventory array, and the Y(2) determine how many you have of them.

Player Inventory
x,y

0,1 = 0 (x ID from the sword)
0,2 = 3 (you have 3 swords)
1,1 = 2 (x ID from the potion)
1,2 = 10 (you have 10 potions)
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat May 09, 2015 1:20 am

oh shoot another dumb question where am i exactly assigning these x,y values?

I was looking at this first image on this tutorial is this how its supposed to setup? is there an easier way to setup per item since i'm going to have tons of items?

https://www.scirra.com/tutorials/614/array-based-inventory/page-3
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat May 09, 2015 1:59 am

There are ways to import data to arrays, JSON for example, or fetching info elsewhere with Ajax, or the dictionary.
Otherwise an on start of layout can be used.

The examples I gave with names and indexes do not relate to any tutorials, though there may be similarities.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Sat May 09, 2015 2:22 am

ok now thats just confusing me cuz now i need to look up JSON and AJAX and all that

i understand your indexes didn't relate to any tutorials i just saw that and was ... oh is that how i assign the x,y for each item and that would mean for alot of actions per each item
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat May 09, 2015 3:18 am

ok i come back 2morrow (been working on this for 8 hours) i've been searching for how dictionary works but they keep leading me to json and ajax and that they load these things. my brain hurts after looking at the manual and tutorials. maybe some more detailed info can lead me right way ..... and i thought all i needed to know was ARRAYS ,shots fired at Fireche!!! lol
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat May 09, 2015 9:06 am

none will tell you here step by step how to do a full inventory, that's way too much work (which is why there is one in the store for 40 dollar). But we can give you advices on how to start it. Using arrays alone can be enough for a simple inventory system btw.

But here is how I would do it:
Use a 2D-Array. (X = ID of item, Y = is item slot free) When you drag and drop item X into the inventory you check for an empty spot in the inventory. After you set the ID of the droped item into the X axis.

If you want to save multiple items you could use an instance variable of an object to save its amount. (If you drag and drop an apple onto another apple in the inventory you add to the apples instance variable ("amount") +1.

What did you try so far? Did you try something on your own without any tutorials?
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Sat May 09, 2015 6:24 pm

yes i did try somethings let me show you my capx of my attempts

http://www.mediafire.com/download/tngv8zhp38segzw/Myinventory4.capx

In this first build a programmer helped me put it together and taught me about picking and strings that i didn't know how to use

each item is a frame of the slot and when you gain an item slot 1 will change to animation frame of the item, if its a gear it will go to next slot if its a bug or anything else it will stack

but then i wanted drag and drop ability what if i drag item to elsewhere like a gear to my character sheet to equip it .... then that means the slot wouldn't be there anymore

so then i build this

http://www.mediafire.com/download/9kpchwyxsfbp762/Inventory+drag2.capx

this has drag and drop and i have inventory next to character equip slots (i combined the sheet to make it easier) the item being pinned to a item icon because each item i wanted not in a family so each gear can have random rolls for STR,VIT,DEX, ect. but the items all go to one slot and i'm doing something entirely wrong.
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat May 09, 2015 9:22 pm

fireche first off you say its easy to build an inventory with array , then you say its too much work for someone to help build a full inventory. well if everyone actually didn't make half ass tutorials and did a step by step for fully working inventory, i wouldn't be here. I have seen many long tutorials that show alot of work so dont tell me anything is too much work. If someone wants to, they can create as big of a tutorial as they can. Its people that like you who are lazy acting like you know it all.... everythings easy..... and making it sound like i'm dumb. I am in the dark on these subjects so be my mentor and teach and that way it might help everyone

YES- I see your way of using the ARRAY, I understand how ARRAYS are used

NO- I dont understand JSON's or AJAX, I dont understand alot of other things that need to get to where i need to be

so if anyone here who wants to touch on a subject that will help me learn please feel free to add to the know how, i think it would be cool if we had this thread as a full tutorial of an inventory. i'm not mad at anyone i simply just want help and nobody to hold back even if its alot of work to educate. you dont have to sit and type or tell me everything all at once i dont expect to have all the information right away. just feed a lil bit at a time
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat Jun 06, 2015 7:44 pm

Hi @Gussy, I can walk you through it and help you make it the way you imagine, but I need it to be paid work. Are you interested?
B
5
S
1
Posts: 13
Reputation: 403

Previous

Return to Job Offers and Team Requests

Who is online

Users browsing this forum: No registered users and 0 guests