TEXT   102

Devlog 2

Guest on 3rd May 2022 05:32:12 PM

  1. Steps on how I went about integrating each feature -
  5. 1) Downloaded animations for rifle firing from Mixamo and converted them to be able to use it with ALS character. Not doing so and directly retargeting ALS skeleton to the animations caused the animations to mess up.
  7. 2) Creating an animation montage of the fire animation and adding slots. Creating slots just for the spine and head didn't work that well so I created slots for the left and right arms as well.
  9. 3) Duplicating the "Get Roll Animation" function under the movement system in the player character blueprint and deleting nodes that weren't needed.
  11. 3) Creating a variable for the animation montage and connecting them to the nodes that to the rifle node.
  13. 4) Using the Play Montage node and getting the animation instance as the target and setting it to play once the fire event was triggered.
  15. 5) Just like for firing I used the camera manager in the same way I used the camera manager for recoil.
  17. 6) Adding a custom event to the weapon parent blueprint and using controller pitch and yaw inputs. Making a float variable to calculate recoil.
  19. 7) Setting values for recoil in weapon child blueprints and calling the recoil event in the fire event.
  21. 8) Creating a new boolean variable for the burst fire in the parent weapon blueprint allows setting the burst fire rate individually for each weapon.
  23. 9) Adding ADS so that player can shoot only when it's aiming. Copying the aim action code from the ALS blueprint and adding three boolean variables one to check if player can fire other one to check if player is aiming and the last one that'll allow the player to fire.
  25. 10) All of this is connected before the fire event gets triggered. Once the fire action key is released the "is firing" is set to false.
  27. 11) After adding ADS, in the weapon parent blueprint making a new float variable to calculate fire recover time and attaching its values to the delay node given "burst fire" and "is firing" booleans are true.
  29. 12) Looping the delay node with the line trace channel and setting the value for the child weapon blueprints burst fire for the rifle was made.
  31. 13) Making five integers - capacity in the magzine, max capacity player can hold with them, current ammo magazine has, current ammo the player is holding with themand the last one to count how much ammo the player has fired.
  33. 14) Creating a function in weapon parent blueprint  to calculate ammo everytime fire is pressed. Also this function is called in the custom fire event and connected to a branch node which if true will allow the player to continue firing.
  35. 15) Reconnecting the burst fire loop back to the ammo calculation function and setting ammo values in the weapon child blueprint.
  37. 16) In the weapon parent blueprint class adding a custom reload event and calling it in the fire event branch.
  39. 17) Adding input action for reloading in the project settings and connecting it to the reload event.
  41. 18) My reload calculations got a bit messy since five different situations had to be considered.
  43. First branch handles and calculates if the magzine is empty and if the ammo the player is holding is more than the magzine capacity.
  44. Second branch handles if the the magzine is empty and if the ammo the player is holding is less than the magzine capacity.
  45. Third branch is added to handle when the player reloads manually and there is already ammo in the magzine.
  46. Fourth branch is for when there is enough ammo in the magzine as well as in player's pockets.
  47. Fifth branch handles if player has no ammo left neither in the magzine nor in the player's pockets.
  49. 19) The source for reload animations were different but steps were similar to me when I added fire animation.

Raw Paste

Login or Register to edit or fork this paste. It's free.