Alchemy

About

The project

Alchemy is a multipurpose crafting system created by J. Sena and released as CC-BY. The current version of the system requires the 3.1 beta 11 (or newer) version of the Godot Engine. You can change the code to make it work on previous versions but things may not work as they should.

The license

I put a lot of time and effort on this project to make sure it is bug free (as much as possible), easy to use and fits the needs of most projects. By releasing it under the CC-BY license I don't intend to have my name included in the credits of your game (it would be awesome if you do but you don't have to). Just make sure to credit me if you share the code of your project (i.e. game jam projects). Feel free to get in touch to tell me you're using my script on a project. It will greatly help me to keep myself motivated and release new versions.

The setup

The system is in an early stage and requires only a few things to be customized. I plan to make the whole code much more clean and consistent but right now it's very stable and can be used without any trouble if you know GDScript.

1. alchemy.gd

The file containing the features and the recipes.

The variables

item_scene A base item scene to be used for displaying items.
recipes Must be an array of arrays. The first element of each subarray must be the result of the recipe, followed by the ingredients. (See the example bellow)
max_slots The maximum number of items used on a recipe. The minimum is always 2.

Code example of recipes:

var recipes = [ ['small_dagger', 'iron_ore', 'iron_ore'], ['short_sword', 'iron_ore', 'iron_ore', 'steel_ingot'], ['long_sword', 'iron_ore', 'iron_ore', 'steel_ingot', 'steel_ingot'], ['health_potion', 'green_herb', 'green_herb', 'purple_herb'] ]

2. progress.gd

The file where the inventory and the items' informations are stored.

The variables

items A dictionary of dictionaries containing all the items on the game. Each child dictionary should have the item ID as the key and have the 'name' and 'icon' values.
inventory Must be a dictionary. The key should be the item ID and the value must be an integer.

Code example of items:

var items = { 'iron_ore' : { 'name' : 'Iron Ore' ,'icon' : 0}, 'steel_ingot' : { 'name' : 'Steel Ingot' ,'icon' : 1}, 'green_herb' : { 'name' : 'Green Herb' ,'icon' : 2}, 'yellow_herb' : { 'name' : 'Yellow Herb' ,'icon' : 3}, 'purple_herb' : { 'name' : 'Purple Herb' ,'icon' : 4}, 'dragon_blood' : { 'name' : 'Dragon Blood' ,'icon' : 5}, 'dragon_scales' : { 'name' : 'Dragon Scales' ,'icon' : 6}, 'fire_stone' : { 'name' : 'Fire Stone' ,'icon' : 7}, 'small_dagger' : { 'name' : 'Small Dagger' ,'icon' : 8}, 'short_sword' : { 'name' : 'Short Sword' ,'icon' : 9}, 'long_sword' : { 'name' : 'Long Sword' ,'icon' : 10}, 'health_potion' : { 'name' : 'Health Potion' ,'icon' : 11} }

Code example of Inventory:

var inventory = { 'iron_ore' : 7, 'steel_ingot' : 3, 'green_herb' : 4, 'yellow_herb' : 3, 'purple_herb' : 2, 'dragon_blood' : 1, 'dragon_scales' : 3, 'fire_stone' : 1 }

F.A.Q.

Can I use more than 4 ingredients?

Yes. You can use how many ingredients you want. Just make sure your UI supports it.

Why not use JSON files?

I think loading external files for no good reason is always a bad practice. If the system evolve into something much more complex and I think it would bennefit from storing the recipes externally I'll do it but that's not the case right now.

What are the features planned for the next version?

Actually I have no features planned for the next version. My main goal is creating a base system that fits as many games needs as possible. Crafting systems are very different from each other because of game design reasons so I'll continue working to make it better and bug free but don't expect some very specific feature that only you will use.

Is this project still being developed?

If you are reading the online version of this page, the answer is yes.

When the next version is going to be released?

I honestly have no idea. It can be tomorrow, next week or next month. Since I'm working on this project on my free time I cannot tell for sure when the next version is going to be availabe. Be sure to follow me on Twitter and/or favorite the official repository to know when it is available.

I have some ideias. How can I contact you?

If you have any suggestions you can open an issue in the official repository of contact me via Twitter but do not expect your suggestions to be accepted unless they are really useful.

My game have some specific needs that may not fit the project. Are you available for hiring?

Yes. I'm available as a freelancer programmer (for Godot only). Contact me via Twitter and we'll talk about your project. ;)

Changelog

Mar 6th, 2019