Add Review
Subscribe
Nominate
Submit Media
RSS
Implementing Shemri
AubreyTheBard- 09/01/2022 02:16 PM
- 181 views
This month my primary focus was on adding Shemri as a playable hero. Making animations for thrown weapons proved more difficult than I had anticipated. A small dagger looks okay-ish spinning quickly around with just four frames of animation that are 90-degree rotations of each other, but when I tried the same thing with a larger weapon like a staff, it looked frenetic and unconvincing. This meant I had to fill in more frames at smaller angles, which wasn't easy to do since pixels are essentially squares and can't be rotated by anything that isn't a multiple of 90 degrees without some fudging of data. The technique I eventually settled on was to copy-paste an image into Photoshop and do the rotation there, producing a blurry but essentially well-shaped and positioned approximation, then copy that back over to iDraw3 and use it as a template for drawing the weapon in the clean-cut style I'm using for the game. It's still a bit work-intensive and imprecise, but it's good enough for images that flash onto the screen for a single frame.
I also got stuck for a good while on the code implementation of the Throw ability. My battle system so far was set up to look at the equipped weapons of a battler if a skill involved using a weapon, but in this case the player was choosing a weapon from the inventory. My first attempt to rectify this was the hacky method of temporarily switching what weapon Shemri actually had equipped while the calculations were being done and then switching it back, but I ended up getting crashes I couldn't figure out. e.ea So I backed up and actually added a new 'override weapon ID' parameter to my skill effect calculation function, changing the logic to allow using that instead of looking at the equipped weaponry. That helped, but I still had bugs in the menu -- it wouldn't seem to update to reflect the fact that the thrown weapon was gone. Eventually I figured out that I was updating some variables tracking the ID and durability of the weapon in my code for the Throw ability, when I should've left that for my updateEquipment function. Funny how you can be a little too conscientious and at the same time not quite enough. X)
Tangentially, I also made a little update to my DynParams plugin (although I haven't published the new version yet). I ran into occasional crashes having nothing to do with the battle system and the dialogue popup said the problem was in DynParams, so I decided to add the capability to output log information to a file so I can hopefully figure out where exactly the problem is next time it happens. I suspect I just set some of the dungeon generation parameters poorly when I changed them to test the stealth rooms, but it'll be good to verify there isn't something else going wrong.
I also got stuck for a good while on the code implementation of the Throw ability. My battle system so far was set up to look at the equipped weapons of a battler if a skill involved using a weapon, but in this case the player was choosing a weapon from the inventory. My first attempt to rectify this was the hacky method of temporarily switching what weapon Shemri actually had equipped while the calculations were being done and then switching it back, but I ended up getting crashes I couldn't figure out. e.ea So I backed up and actually added a new 'override weapon ID' parameter to my skill effect calculation function, changing the logic to allow using that instead of looking at the equipped weaponry. That helped, but I still had bugs in the menu -- it wouldn't seem to update to reflect the fact that the thrown weapon was gone. Eventually I figured out that I was updating some variables tracking the ID and durability of the weapon in my code for the Throw ability, when I should've left that for my updateEquipment function. Funny how you can be a little too conscientious and at the same time not quite enough. X)
Tangentially, I also made a little update to my DynParams plugin (although I haven't published the new version yet). I ran into occasional crashes having nothing to do with the battle system and the dialogue popup said the problem was in DynParams, so I decided to add the capability to output log information to a file so I can hopefully figure out where exactly the problem is next time it happens. I suspect I just set some of the dungeon generation parameters poorly when I changed them to test the stealth rooms, but it'll be good to verify there isn't something else going wrong.










