Making the enemies being able to attack the player with ranged weapons required two things: first was allowing defining initial inventory for mobs (so that they could have ammunition for the weapons).
This was already possible for NPCs, but not for MobTypes. I considered merging this data together but rather decided against it so that you could have NPCs share MobTypes without having to duplicate data. So now you can define initial inventory for both (and it will be added together).
After modifying the “base” mobs tileset to handle two types of soldiers (swordSoldier and xbowSoldier) with different weapons and inventory, I ran into problems with the process of embedding the tileset on the tiled map. It just doesn’t seem possible to update the embedded tileset with modifications (Once embedded it’s copied into the map, and I couldn’t find a way to replace it without deleting the tiles that were already using it).
However, on a second thought, I think it makes sense for the mob types and NPCs to be used in a given map to be embedded as tiles on its tileset. This means I’m ditching the idea of a “master” external tileset for the mobs, instead, each map will have tiles with custom properties for it.
Once that was in, I implemented some basic AI for the enemies, if they have a ranged weapon and there’s a clean LOS, they will fire instead of bump-attacking. This worked well, however, I hit a problem with the hybrid realtime-turn based model since the combat mode was not being kicked until the projectile animation was over, it was possible to affect the flow just by moving around evading the projectile while on exploration mode.
Plans for M1 are looking good, this is the list of pending tasks:
- Implement “triggers” in combat based on a number of turns passing.
- Transport to another map via trigger outcome
- Fix bug: NPC interaction depending on having pressed a key
- Fix bug: Crash when all party members killed
- Add indicator for party member’s HP (New)
- Fix conflict between party members and friendly NPCs in combat
All this should be done by the end of the week.
I’m also in the process of setting up a website for the project. This includes it having a logo, so if you think you can contribute with a cool looking logo, please let me know 🙂
One thought on “OpenArthurianX6 – Enemies doing ranged attacks”