Sorry for the confusion. My example was in the ExecuteAbility function. It has a TargetInputIn parameter. In the AttackUnit function you can instead use the TargetUnit parameter. You just need to change a cople of small things:
Hi ,
I’ve just noticed that the health bars/unit huds are not showing up over units. I haven’t done anything with the HUD. I’ve checked in the debugger and “event set health bar fill” is being called, but health bars are not appearing. Any ideas as to why this might be?
Hi phuoclam, since I do not know how you have modified your project this could be caused by any number of things. Does the game otherwise function as expected? Death animations playing when sufficient damage has been done to the units, for instance? Do you recall what part of the code you were working on when you first encountered the bug? Might give us an indication of where you broke something.
Another question for you, I’m spawning some enemies during runtime but, on the spawned enemy’s turn to move, the puppet is stationary, a “grid location capsule” appears at the destination, and a bunch of runtime errors occur: “Accessed None trying to read property MovedActor… Blueprint: BP_Action_Move” What do I need to do to fix this? FYI, the spawned enemy is a child of BP_Unit_Anim. Thanks!
Game otherwise does function as expected (death animations, etc), the health bar is just not visible. It’s strange as I haven’t modified the actors or HUD in any way. I have custom children of BP_Unit_Anim but that shouldn’t affect the health bar. Even stranger, I’ve tried adding BP_Unit to the level (and BP_Unit_Anim_Debug) and no health bars. Unfortunately, I don’t know where in the code I was working when the bug first occurred
This is an issue I’ve seen before, but which I believe should have been fixed. You are using the very latest version, or did you start the project a while ago? In the MpSpawn map does spawning work correctly? How are you spawning your units?
Extremely hard to know the cause, then. But a few things you can do to look for the issue. In the UnitHud widget and WBP_UnitHud, try printing some values to see if they are being triggered at all during gameplay. Way to check that the underlying code is running correctly, at least.
Check out my “Terrain Costs” tutorial. There I explain how to have different units be able to move over different tiles. That should work for flying units in your game, I believe:
I didn’t realize there was a spawn map… I need to clarify. I want to create additional enemies during a match (not just at the beginning/before a match starts) and call “SpawnActor” to create the units. I obviously need to do something more to attach a working puppet to the newly created units?
(fyi, I am using latest version, MpSpawn map does work).
figured it out, I just needed to call Unit->spawn puppet lol. You’d just expect the puppet to spawn when you spawn a unit… Looking at BP_AbilityBase_SpawnUnits you do not call spawn puppet either so that’s weird…
Hi, those are many different things. Most of those can be made through abilities, but in very different ways. Can you choose one to start with and describe a bit more how you want it to work?
Ok, glad you got it working, but the unit should indeed be spawning the puppet on its own. Wonder why that isn’t happening here. Where are you spawning the units? Is it during BeginPlay or at a later point? Could you show be the spawn node with how you have set up the inputs? Any chance you might be spawning it on the client?
units are being spawned during gameplay, not BeginPlay (ie. when a waypoint is reached, and when the previous “wave” of enemies is defeated). The “spawn new monster wave” (attached) is in BP_ATBTT. I believe it is server side, but not 100% sure as I intend the game to be single player only and haven’t diligently made sure. Anyway, the issue is resolved by spawning the puppet and it may be best to leave it there as time may be better spent on other things now
Another question for you, I’m trying to create a “stun trap” which ends a unit’s movement (and turn) when the unit enters the tile with the trap. Because of how BP_Ability_Move, pathfinding, and the action queue work, the unit continues to move to it’s destination after entering the trap tile. I figure the easiest thing would be to remove the “move action” from the action queue. But doing this (or otherwise manipulating the action queue directly) freezes the game. I’ve tried calling all the “action manager” functions I can think of: Action Destruction Loop, Attempt Destroy Action (in a loop), Play Next Action, End Action, etc. but they are not doing what I want. Any ideas? How do I stop a Unit’s movement? Thanks!
I’ve been playing around lately with the Hex grid and I was wondering if it’s possible to integrate the Cover&Stealth systems with it. Units seem to ignore completely the walls and tiles and the abilities from enemies. I have added the BP_CoverSystem & BP_StealthSystem to the grid manager and the BP_UnitStealthComponent to the units.
If at least I could use the cover system with the hex grid, that’d be superb!
There is already a heal ability included in the JungleRaid and Demo maps. Does this not work the way you want it to?
Hi Arkanos, the Stealth system should work just as well for hexagonal grids, so not sure what might be wrong there. When you say completely ignoring walls and tiles what do you mean?
For having the cover system work on a hexagonal grid, one of the devs on the ATBTT Discord channel recently got it working. I recommend hitting up kiltedfrog on the Discord (link to Discord on the ATBTT store page) to see what changes they made.
I meant that there was no interaction between the units and the blocking tiles, like if the CoverSystem was not working at all. Sorry to mix both components in the same sentence. I have read it again and it’s kind of misleading.
I will double check on the Stealth system and try to understand why it is not working as intended.
Yup, we are already having a little chat and has helped me with some tricks and hacks
Ok, try this out. You should do some testing to see if it gives you the results you want. Pay close attention to the nodes I have highlighted here to make sure you add all the relevant changes: