How do I Crafting System?

Get help using Construct 2

Post » Sun Apr 10, 2016 2:36 am

Oh sweet ya I usually use Googles Spreadsheet and export as a JSON from there. Or at least that is how I have done it in the past I haven't tried text file or xml before though.
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,471

Post » Mon Jul 25, 2016 11:43 pm

So this has been dead for awhile, I ran into some issues that frustrated me so I basically called it quits for awhile. I started from scratch about two days ago and thought I would share my progress. I feel like I'm starting to get close although it is not completely finished yet and I have more work to do and probably a lot of code to streamline but this is what I have so far.

https://dl.dropboxusercontent.com/u/729 ... index.html

CONTROLS
A,D - LEFT AND RIGHT
SPACEBAR - JUMPS
TAB - OPEN INVENTORY/CRAFT MENU
MOUSE WHEEL - SCROLLS CRAFT MENU
LEFT CLICK INV ITEM - ALLOWS YOU TO SORT YOUR INVENTORY
LEFT CLICK BACKGROUND - ALLOWS YOU TO DROP AN INVENTORY ITEM INTO THE WORLD

Basically if you have played Terraria the controls should be second nature.
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,471

Post » Tue Jul 26, 2016 5:06 am

Rather than using "tokenat" expressions to find your values in your dictionary string, you could do a nested dictionary instead.

Think of having one dictionary for each crafting recipe, so the keys and values are specific to a single recipe... then you have all of those dictionaries stored in a single "master" dictionary. It means instead of having to count tokens, you can simply reference things by the key names.

This is how I made my sprite tile-map. Each tile has it's own dictionary to set specific values/variables/etc and each tile dictionary is compiled into a single dictionary for saving/loading via JSON format.

Let me know if you think this might be of help/use - I can explain in more detail and share some of the events I used to make a nested dictionary.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
81
S
34
G
40
Posts: 3,031
Reputation: 30,422

Post » Tue Jul 26, 2016 8:17 am

Have you tried these 2 great plugins, they work kind of like the old .ini files used to.

https://www.scirra.com/forum/plugin-table-2d-dictionary_t125862
B
43
S
22
G
20
Posts: 735
Reputation: 11,977

Previous

Return to How do I....?

Who is online

Users browsing this forum: jaytrott86, tarek2 and 10 guests