Today, I made progress on the back end of crafting - building the core functionality for it to work. Specifically, I finished a script that was intended to be finished years ago - the DELITEM script.
In crafting, there are two essential scripts that I needed. I attempted to finish crafting when the project first developed, but gave up because I was frustrated. These two scripts are the ADDITEM and DELITEM scripts. I completed the ADDITEM script easily - it's the script that adds an item to your inventory. To craft an item, both scripts must be utilized - the DELITEM script to remove the ingredients of a crafting recipe from the player's inventory, and the ADDITEM script to add the newly crafted item to the player's inventory.
The DELITEM script also gives a value of '0' if it doesn't detect the proper materials to craft the item, and a '1' if it detects the proper materials.
Today, I've split the two functions of the DELITEM script into two scripts: the EXISTITEM script and the DELITEM script. The DELITEM script deletes items, while the EXISTITEM script checks if certain items exist.
For example, here's the code for a torch's crafting recipe.
All three scripts must be used to craft the item.
Expect a development video tomorrow about this. Until then, see you later!
November's monthly task is to finish the inventory rewrite (Crevis) and to begin drafting levels (Nesus).
The author of the blog is Niften, or Sour Apple. He posts daily near the end of the day, usually before 11:00 PM.