Ok, Iām still not 100% sure if I understand the question, but are you asking how to check the range of the targeted unit to make sure it is in range so that it can counter attack? If that is what you are after, I think this change will do the trick:
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.