Today was a fairly productive day. I tackled trees, scriptable items, and a few inventory bugs.
I pretty much did trees the same way as vegetation - create them as tiles and give them special properties to have the player ignore them when checking for collisions.
I also created scriptable items! This means that when consuming an item I can run a script - eating, drinking, potions and various effects are now possible. I created a test item 'Nifedipin' that allows me to noclip in the world. This is pretty useful when taking screenshots and generally flying around. Back on track: I created scriptable item functionality without adding any more variables to the long list of existing variables for the items.
TL;DR - There are a ton of variables in the item array and I decided to reuse them.
Notice the variables block_tile, block_obj, and block_hard. These are all variables that aren't being used because the it's an item that can't be placed. Because they aren't being used, I can use them for the scriptable items.
Block_tile tells the engine that it's a scriptable item, and from that point the game recognizes that there's a script in the block_obj variable and a parameter in the block_hard variable. Then I simply plug these variables into something like this:
Until next time!
February's task is to improve the combat system and create a system for enemies and their AI.
The author of the blog is Alec. He posts weekly, usually on the weekends on Saturday.