I started off the day very focused on the fact that this game will require a Crafting system, and I didn’t disappoint myself with what I got accomplished.

Before anything though, I fixed a couple of bugs;

Line of sight while in buildings, now the unit will see a bit better from the top of the watch tower, and in the townhall so they’re not just hiding then coming out over and over.

I found a bug when building roads, if you held shift it would remove double the resources before placing the second building – This was because I used a script to check if the player had the resources, and the same script would also remove the materials if the building was flagged as placed – so when shift was held and I checked for the resources again, the placed flag was active and would remove resources again. But all is well now

Fixed collision masks for the Watchtower – it was causing units to not be able to move slightly behind it.

Fixed the depth of roads to be ground level – for some reason units appeared to be walking under them; so I added a depth = 0 to the end of my script that attaches the road pieces.

Fixed an infinite loop if the arrow was unable to get out of where it was being shot from – having to do with the Ranger unit.

Then the good stuff –

Crafting! – This was a pretty big task, made a bit bigger by my son staying home from school sick, playing Far Cry until noon! So when the player starts the Crafting tab is not accessible – you get a message that says “You need to build a workshop before you can begin crafting!” Or something close to that. When you have your workshop, you’ll be able to right click on items that you have the materials for – they are listed in the description – which will create a new item to give to your units! I figured out how to use scripts as functions in an if statement here after an hour of frustrating head scratching.

Next I created a means to check for the given items in the units inventory before being able to upgrade that unit to a new job! – It was lucky that it came to me this way, rather than checking if it was in the global inventory, you actually have to give these items to your unit before choosing a job. When you open the job select bar it will tell you the required items to have.

I came up with 7 different craftable items for now, but the framework is in place to make 100 if needed.

I did an attack animation for the Ranger that I drew last night – so now it will hold a bow in the attack state.

Then I implemented the Ranger as a unit. This was a bit of a job because it’s the first actual ranged unit. It is coded to move upto half of it’s line of sight towards the enemy and if the enemy is moving away it will follow. The speed is adjusted for now at -20% while attacking. It has the same functionality as a swordsman; go here, protect, follow, stop. One thing the rangers can do though that the swordsman can’t so much is fight a tree mimic, but it is still a challenge! And of course I don’t want you to imagine that fight, so here it is. Tree mimics also drop a 30% hp ring so it’s worth the fight!

Another note on ranged fighting – the attack scheme now uses the collision_line function in game maker to check for another player unit in the path of the arrow before firing it. So hopefully few ranger vs ranger deaths!

That is pretty much it for today, hopefully you made it through the whole thing – and if you just clicked the links that’s ok too! I’ll be back tomorrow to tweak how everything works, and play around with the crafting some more.

Thanks for reading!