The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: SeMcDun on September 07, 2011, 11:17:18 AM

Title: Grid Crafting System v2.0
Post by: SeMcDun on September 07, 2011, 11:17:18 AM
Grid Crafting System
Version: 2.0
Author: SeMcDun
Date: 09/10, 2011

Version History



Planned Future Versions


Description


The Grid Crafting System gives the player a grid into which they can put items. If the correct items are used
and are in the correct box a product item will appear on the screen and the player can check it
out. If the player decides they want the item, they can click the product box and get the newly crafted item.

Features


Screenshots

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg40.imageshack.us%2Fimg40%2F3360%2Falchemyk.png&hash=b065acc0228c74a7f832b20c6d712fffe22dc114)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg713.imageshack.us%2Fimg713%2F5816%2Fblacksmithf.png&hash=787c1d2a1b7549b5e42ef7cdd120dded1df26305)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg199.imageshack.us%2Fimg199%2F8056%2Ftailor.png&hash=fe44dfe1183944721e8af7340334433676586591)

Instructions

Paste the script above main but below materials.
I think everything is explained inside the script.
(Just say if something isn't too clear and I'll try help and edit the script if needed ^_^ )

Script


Please obtain the script from inside the demo.

Credit



Thanks


Support


If there are any bugs, feel free to post here and I'll try fix it as soon as possible.

Known Compatibility Issues

I don't think I've tampered with anything so there shouldn't be any compatibility issues.
If there is, just post and I'll see what the problem is.

Demo


See attached.

Restrictions

Only for use in non-commercial games.
Title: Re: Grid Crafting System
Post by: SirCumferance on September 08, 2011, 08:54:17 PM
I like it, I do. However, is there a way you could set it up to have more boxes AND the position of the item matter, like in minecraft?

EDIT: Just saw that that is in the planned version. Cool. Maybe make the placement of the boxes editable in the script, so that way, for example, someone could have different amounts and placements based on level/shop. They go to a dirt merchant and he has 3 boxes, shaped like an L, but the very nice shop passed the tracks has 9, shaped like a square...next door is a place with 8, 2 wide and 4 deep...you get what I mean?
Title: Re: Grid Crafting System
Post by: SeMcDun on September 08, 2011, 09:45:23 PM
I think I get what you mean. Well I'm planning on creating two updates to this script but they will only be 2x2 and 3x3 grids and specific placements of items. I would like to make a script that would be more like Minecraft, so you can make a torch in a 3x3 grid but it can be anywhere as long as the coal was above the stick. I'm still quite new to scripting :) so maybe when I get better I'll try to tackle a new script, more like what you described.

Glad you like it so far :)
Title: Re: Grid Crafting System
Post by: SirCumferance on September 08, 2011, 11:45:54 PM
Oh yes, I am surprised it hasnt been done before, with the popularity of minecraft. Keep up the good work.
Title: Re: Grid Crafting System
Post by: crimexxstudios on September 10, 2011, 02:34:25 AM
Great Script, I will use this for my cooking and alchemy systems :D Can't wait for the Updates :D

Great Work,
-Crimexx
Title: Re: Grid Crafting System v2.0
Post by: SeMcDun on September 10, 2011, 05:48:16 AM
Updated to v2.0

If you want one item to be crafted in multiple places (again I'll use Minecraft as an example - sorry if you haven't played this) you just need to declare the recipe several times for each place in the grid it can be.

For example a torch, Coal above a Stick. You would declare it as Coal top left, Stick bottom left, nil for top right, nil for bottom right. THEN AGAIN as nil top left, nil bottom left, Coal top right, Stick bottom right.

Thanks for the positive feedback too :)
Title: Re: Grid Crafting System v2.0
Post by: crimexxstudios on September 11, 2011, 03:30:33 AM
Awesome update, once 3x3 is achieved I will probably switch my smithing from KGC_ComposeItem to this script. Keep up the great work.

EDIT: Now can i make it so a item in a recipe is not used. Like say I wanted to have a chopping board and it uses a knife to chop up the ingredients. Can the knife be left in the Crafting box to retrieve when I'm done chopping up items?

-Crimexx
Title: Re: Grid Crafting System v2.0
Post by: Mushu on September 11, 2011, 03:38:07 AM
With a script, couldn't you set something with the window coord. and if this item is this x and y away from the other it recognizes the combo instead of doing like a 'every possible imprint' scenario?
Title: Re: Grid Crafting System v2.0
Post by: SeMcDun on September 11, 2011, 04:14:44 AM
@crimexxstudios;
I could use an array which holds items that are NOT used up during crafting.
That way you could put the knife into the array, the script will check "is that item in the array?" then if it is, don't set that box to nil. So the item will still be in the grid when you've created the product.

But this way, every time that item is used it will remain in the grid.

Second method, I could create another index in each recipe for every item saying "Is_Used?" That way an item can be used up in one recipe, but remain in another.

I think I prefer the first method... but I'll check out both. Which would you guys prefer?

@Scalinger2;
Yeh I guess you could, but I see the way I've done it as the easiest for implementing checks heh. I guess if I was to do any grid bigger than 3x3 your way would be the more efficient way to do it.
Title: Re: Grid Crafting System v2.0
Post by: crimexxstudios on September 11, 2011, 04:41:45 AM
Half of what you just said blew over my head... :d haha I need to start studying scripting (any suggestions on where to start). If you get the chance,  could you add the solution (if you find one) to the demo so I can visually see what you are talking about. Im not trying to be lazy, I just simply don't understand.

Thanks for the quick replies and all of your support on scripts,
-Crimexx
Title: Re: Grid Crafting System v2.0
Post by: Infinate X on September 11, 2011, 06:22:04 PM
This reminds me of Minecraft :D it's one of things I liked about that game! I'm using this script in my game

EDIT: Tested and it's awesome ^.^ Just noticed it was based off of Minecraft, which means you made it good (b'-')b

EDIT: Can Version 3 have a 3X2 grid? I tried to make that and failed :(
Title: Re: Grid Crafting System v2.0
Post by: flottos on September 12, 2011, 03:55:50 PM
Nice script! I also plan to use this for a upcoming fangame of mine :)

btw, just wanted to ask you if you saw this video yet:

http://www.youtube.com/watch?v=Hn0GUK2Cq2E


I think someone already created the 3x3 system, but i'm thinking he hasn't made it public.
Title: Re: Grid Crafting System v2.0
Post by: SeMcDun on September 12, 2011, 08:48:23 PM
Woah, that script's really nice :) He's went all out and made the inventory and stuff too.

Update: The 3x3 grid is done, but I am wanting to implement recipe costs before I make another demo and release v3.0
Also, there is the option to have retaining items, weapons or armours that do not get used up during the crafting process.

I'll do some more work on it tonight and try get 3.0 out soon.
Title: Re: Grid Crafting System v2.0
Post by: Infinate X on September 12, 2011, 11:42:38 PM
Cool :D

What if you made an equation that shrunk the script and made it more useful by making it so you can pick the number of rows and columns? I think that would be AWESOME!!!

Is it also possible to have features you can turn on and off, such as recipe costs?
Title: Re: Grid Crafting System v2.0
Post by: flottos on September 13, 2011, 12:39:02 AM
Can't wait bro, keep up the good work!
Title: Re: Grid Crafting System v2.0
Post by: Infinate X on September 20, 2011, 05:41:04 PM
IDEA!!! An option where some recipes don't need any form of shape :D
Title: Re: Grid Crafting System v2.0
Post by: SeMcDun on September 20, 2011, 09:55:40 PM
Hi again.

@Infinate X :
   I'm not sure that's the way I want to take this script. Feels like it defies the point of it.

I've had a lot of stuff to do recently and haven't been able to concentrate on scripting.
I plan on overhauling what I have atm and splitting each grid into a separate script, allowing people to have whichever grids they want in their game.

Hopefully get some time to finish v3.0 soon with recipe costs and retaining items.
Title: Re: Grid Crafting System v2.0
Post by: crimexxstudios on September 21, 2011, 02:33:33 AM
Take you Time :D Thanks for all the hard work. Can't wait for v3


-Crimexx
Title: Re: Grid Crafting System v2.0
Post by: Kyriaki on September 23, 2011, 03:13:14 AM
This is a lovely script, it's fun and adorable but I was wondering would there be a way to limit which items are usable at which shop? For example something like a notetag designation for items to only show up in Blacksmith, only in Alchemy, or only in Woodworking; instead of having all items listed in each shop? Or through whatever technique is best, I don't really know this kind of stuff. ^^;
Title: Re: Grid Crafting System v2.0
Post by: Infinate X on September 25, 2011, 02:49:08 PM
This is a lovely script, it's fun and adorable but I was wondering would there be a way to limit which items are usable at which shop? For example something like a notetag designation for items to only show up in Blacksmith, only in Alchemy, or only in Woodworking; instead of having all items listed in each shop? Or through whatever technique is best, I don't really know this kind of stuff. ^^;

TThere is a way off doing that. He used that feature in his demo.
Title: Re: Grid Crafting System v2.0
Post by: SeMcDun on September 26, 2011, 11:40:55 AM
Right now there isn't actually a way of stopping an item from appearing in the item window. I basically copied the method of printing items from the item menu, so it just spits out every item you have.

I'll try come up with a few ways to do what you suggested, Kyriaki, as it sounds like a pretty neat feature :)
Title: Re: Grid Crafting System v2.0
Post by: Jaco on October 22, 2011, 07:39:14 PM
Okay, here's what I have to make my item.
Code: [Select]
$Grid_Crafting_1x2[0] = [6,0,1,14,0,8,0]
And then when I put the correct items into the right places on the grid. Nothing pops up in the result box. What did i do wrong?
Title: Re: Grid Crafting System v2.0
Post by: Jaco on October 22, 2011, 07:53:51 PM
Nevermind, I wasn't including the right index into the proper inventory...
Title: Re: Grid Crafting System v2.0
Post by: sidhenidon on October 25, 2011, 03:49:03 PM
Some time ago I made a script very similar to this, having in mind the system in Minecraft.
Mine, in the other hand, had possibility to infinite x infinite(not recommended over 7 tho) grid sizes, but the GUI was uglier.
I only posted it in a Brazilian community, so I'm gonna post it here too, thanks for the idea!
Title: Re: Grid Crafting System v2.0
Post by: crimexxstudios on October 30, 2011, 08:46:37 PM
Please Update :D I need 3x3 Crafting.

-Crimexx
Title: Re: Grid Crafting System v2.0
Post by: Fizzly on April 06, 2012, 08:21:47 PM
This is so cool. Reminds me of Minecraft. Anyway, you really should make 1x3 and 3x3 crafting grid :)
1x2 would be nice for crafting weapons like swords.
Title: Re: Grid Crafting System v2.0
Post by: B-LAzer on June 29, 2012, 08:30:54 PM
Sorry for necropost.
Any chance to this be ported to VXA? With 3x3 grid? This is awesome script, and it will be great if it will come to VXA.