Resetting Enemies After Resting
Last updated
Was this helpful?
Last updated
Was this helpful?
In Soulslike Framework, there isn't specific functionality for "resetting" enemies after resting. However, it is not difficult to implement such logic. In this page, we'll go over this briefly.
Head into the Soulslike Enemy (B_Soulslike_Enemy) class, which is the parent for all enemies. Go into the "INITIALIZATION" collapsed graph. Here, we will cache some transform data:
Next, lets begin building an event which will be responsible for resetting Enemy data. Create a new event and name it as you like. You will notice that you do not have some of the methods used in this event below:
Now, we'll create those missing methods that will help us reset the enemy data. Head into AC_AI_CombatManager and go into the "DEATH HANDLING" collapsed graph. Create a new event "Event ResetDeath" and connect it like this to the Do Once node:
Next, head into AC_AI_BehaviorManager and add a new event "Event Reinitialize" to actually reinitialize the behavior component:
That's it! Now you will be able to fully build the Event ResetEnemies. Now, we must ensure that we call this new event we've created when we are resting. To do this, head into the AC_InteractionManager component and go into the "RESTING" collapsed graph. Create a new event which will trigger resetting for all actors of type Soulslike Enemy:
Call this new event wherever you like. For this example, I will call it when we're leaving/exiting resting mode:
Finally, we'll fix an issue inside BTT_GetStrafePoint which causes some null reference errors upon resetting the enemy. Head into the task blueprint and adjust the "SetStrafeLocations" method:
Result: