Been trying to figure this out all day. I have base damage set to 5, health is 100. The first attack that lands does 55 damage, then each attack after does the normal 5. I can’t figure out why it’s multiplying for the first hit. Second part is that the enemy won’t resume normal walk speed after 8 seconds, but if I get close enough for it to attack it seems that walk speed resets after the attack animation plays.
Print String
damage after Event Any Damage
- what does it say? How often does it print? You see the expected value or something strange? How is this value treated in the widget later on? Perhaps it’s a matter of formatting?
You destroyed that actor. So the script after the Destroy
node will not work correctly since the actor IceBolt
no longer exists. Put the slow down script in the Enemy blueprint instead, it belongs there.
I already did that, that’s how I know the first hit does 55 and the rest are 5. It prints damage done per hit. Nothing unusual besides the first being 55.
All right, so move the set slowed before the destroy actor then? The slow down script is in the enemy bp, only the set variable is in the skill bp.
I already did that, that’s how I know the first hit does 55 and the rest are 5. It prints damage done per hit. Nothing unusual besides the first being 55.
How about when damage is applied - is the correct value being printed before you push the value in? How many times does it trigger?
This script is no good and will stop working as soon as you have more than 1 enemy. Read the tooltip on the Get Actor of Class
node. Consider removing it altogether and try the following in the enemy:
Why complicate life with booleans and waste performance with ticking. Later on, once you have this stuff working the way you need, you could look into the Damage Type
(see pin on the Event Any Damange
node) - this will allow you to identify the incoming damage better. Ice will slow the character down but Fire will apply a DoT effect of some sort, surely.
health is 100
I’d triple check that. Measure twice, cut once. You have this Health
variable flagged as Instance Editable
- perhaps it was changed from the Class Defaults.
It’s a single print per hit. First one prints out 55, then each hit after prints 5.
Well, I’m kind of winging it here. Been weeks since I had time to mess with this and just been learning as I go since I started a few months back. Thanks for the info, man. I’m probably just going to scrap these files and start over this part over.
Is this applied or received? This is still not too clear at this point. Simplify the whole thing as much as you can to debug it and get to the bottom of it:
- in one blueprint:
- and in the other:
What do you get?
I just rebuilt it from the ground up. I’m sure there’s a better way… but this works just fine for the moment. Two problems I have now is I can’t get my burning DoT to stop after 10 seconds and figuring out how to attach a particle effect to the enemy per status effect. IE, flames for burning, frosty cloud for chilled(slowed), etc, etc. Red circle was just a desperate final attempt. Didn’t expect it to work but, yeah this whole thing is just a learning project.
A really versatile method I can’t recommend enough is through actor components.
When event happens, we dynamically create and attach an actor component to target actor. This components can deal damage, heal, shows particles, count time and handle anything related to this effect. When the timer expires, the component destroys itself.
Some examples:
The official vid I learnt it from:
This approach allows you build modular, easily scalable systems where the functionality is encapsulated within the component - so you do not need to burden the Player, NPC, Enemies or world entities with all possible combinations of what could happen to them.
You instead spawn a desired effect on them and it goes away on its own.
Cool, man, thanks. I’ll look into it.
Two problems I have now is I can’t get my burning DoT to stop after 10 seconds and figuring out how to attach a particle effect to the enemy per status effect. IE, flames for burning, frosty cloud for chilled(slowed), etc, etc.
Consider this as a kick-starter:
- a parent actor component and a bunch of children responsible for various effects:
- a trap actor in the world that will spawn an effect component:
- the component we give to the actor when they walk into the trap - AC_FireTrap:
- The result:
The component lives on the player for 3s, does its job and then destroys itself.
Good luck!