[SUPPORT] Advanced Turn Based Tile Toolkit

Ok, try this as a starting point: In the example map set the enemy units’ movement to 0 and their ranges so that some will reach the players and others will not. Set their DefaultAbility to BP_Ability_Attack.

Now, in BP_Unit make it so “Show Unit Selection” is only queued if the activated unit is not AI controlled. Next, in BP_Ability_Attack you similarly call Show Unit Selection only if the unit is AI controlled and is actually about to execute the ability (meaning it found valid targets). If you do it this way you’ll have to set up all abilties your AI will use in a similar way, so might be able to find something less clunky if this gives you something close to what you had in mind.

What you need to change in BP_Unit:

What you need to change in BP_Ability_Attack:


(incidentally it seems the first branch here is something left over from some testing I did, which should not have been included in the released update, so you can safely skip that part)

Let me know if this is similar to what you had in mind.

This worked great. Thanks a bunch!

Another (hopefully) quick question for you. In most modern tactics games, the player is able to click on enemies to see their stats, attack range, etc. Currently in ATBTT you are unable to click on enemies at all? I tried adding “event ActorOnClicked” to Units but the event never fires. Is it possible to make enemies clickable? Thanks!

no i use the same animation for all parts.

i have the next eror then i add abilyti and then bomb .




Hey, sorry for the terribly late answer. I’ve been very busy these last days, but things are getting a bit better now. Glad my previous solution worked well! So what you are asking now is unfortunately not trivial, but it can absolutely be done. I have made such a feature on a couple of occasions before, but I haven’t found one that is general enough that I have included it in the toolkit.

So there are a few different ways to go about doing this. One is to have all of the functionality contained within the ability your units are using. You can make it so that when you click an enemy (which you can check in ServerInteract of the ability) you would call on the GridUI of that ability to display the attack range of the enemy, similar to how it is done on Activate for displaying the attack range of the player.

This is not terribly difficult to set up, but a bit awkward if you have many different abilities and need this behavior to be accessible to all of them. You can of course add this functionality directly to the parent ability (BP_Ability) to make it accessible.

There are other ways to achieve an effect like this as well, but what is best depends on your game. Let me know if you have any further questions on this.

You use the same animations for all, but I assume they are each using their own animation blueprint?

For your error it is probably because you ahve filled the Abilitites array with several empty values. Make sure every item in the array is a valid ability class.

i try at start only with bomb and only one value.

is used one animation for all component


i mace a kopy of WBP_Abilitybox for cheange the position and received the error.
what is need to cheange? how to add new box to unit?


Do you get the same error when you set things up like in the screenshot above?

You assign a specific animation instead of using an animation blueprint? You probably want to be using animation blueprints for animating your skeletal meshes.

When you make a duplicate of a widget (or of any actor), any code that is referencing the old object will not be able to simply access the old object the same way. With regular Objects and Actors you can create a child actor to get around some of this, but not with widgets. You will have to go through any place that references the old widget type (using FindInBlueprints, likely) and set them to use your new widget. Alternatively you can just modify the original one directly.

Hello,How are you recently? I come again for some new questions and forgive my poor English.
I want to creat a button “Restart Game” .When I click this button in the game anytime, the game will restart with the initial condition. In that way I don’t need to exit game and run it in the Editor.
In this button,I think I should kill all the units, and spawn them in the initial locations ,maybe I should destroy all the actions too. I’m afraid that will cause some bugs. So how to do that in proper way ?

Hi, long time no see! Doing fine, thanks. Your question is difficult to answer without doing extensive testing. There are a lot of systems that could potentially be affected by a restart if you want to do every step of it manually. I think you will just have to start the way you are suggesting and see if you run into any issues.

Actions are set to be automatically destroyed when they are no longer needed, so you might not have do destroy any actions. Try just destroying and adding back units to start with and see if that works. I can’t see any immediate reasons why that wouldn’t work. Test it out and see if you get any issues. I you aren’t able to resolve them yourself, let me know.

Hi ,
I’m trying to display multiple splines/paths in different colors. The problem is, the overlapping section of the paths “flicker” as the engine tries to display both paths. Is there a way to show the latest “display path” call on top/over the previous display path calls? Thanks!

Hi, the flicker you are seeing is called z-fighting. You can generally prevent it with a very minor difference in height. You would want to add a slight and increasing offset to the spline mehses. I’d need to know a bit more about how you are displaying all the different splines if I am to give you a specific recommendation, but the general approach would be to add an input to DisplayPath in BP_GridUI with an offset.

worked like a charm thanks (FYI added an offset input to DisplayPath passing it to DisplaySplineMeshPath and in there just adding offset to the 2 SplineHeight nodes)

Hope you don’t mind another question =P
I’m trying to link several teleporters together (Thanks for the 2 teleporter tutorial videos, they were well done and very informative!) and can’t seem to get it to work. So, instead of just a paired teleporter, I have an array of teleporters as possible destinations. If I understand things correctly, the Pathfinding should determine where a unit can reach in its movement range using the teleporters or am I missing something? When I click to select a move destination, the teleporting doesn’t work correctly and the unit does not end up moving to the clicked destination… I’m probably doing something wrong queuing Actions?

Glad that my path spline suggestion worked :slight_smile: A bit difficult to answer your teleporter question. I’d need to know a bit more, and perhaps even see some screenshots. So to do this you would need to add edges from the source teleporter to all the possible options. There are known issues with the teleporters, though. Pongo on the ATBTT discord has been working on finding fixes to issues with the teleporter and has posted them there. I recommend joining the Discord channel and looking at his code and see if the fixes might apply to your own code.

Question regarding the renaming and moving of files, I had to restructure content, and was able to move/rename files, and rebuild redirectors, but when i run a test game (demo map) i’m having camera problems, and the session is throwing the following errors.

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetPlayerControllerATBTT_PlayerControllerATBTT”. Blueprint: WBP_UnitHUD Function: Execute Ubergraph WBP Unit HUD Graph: EventGraph Node: Bind Event to On Camera Tick

Unsure why this didn’t get fixed when i updated redirectors, but is there a quick and easy way to update this function to support the new location?

Hi, Unreal Engine can be pretty annoying about moving and renaming. Updating redirectors fixes a lot of these issues, but sometimes that just isn’t enough. If that doesn’t work then I don’t know any quick and simple way to fix it. You’ll likely have to hunt down the issues one by one and manually reset the references. When you get an error in UE4 you’ll get some links to the location of the error in the log. Use these to see where you need to fix the reference.

In your specific case the issue is in WBP_UnitHUD, which is not able to access the player controller from the function library I’ve created for accessing ATBTT specific singletons. I’d check out GetPlayerControllerATBTT in BPFL_Singletons and see if everything there looks like it does in a fresh ATBTT project.

New version of ATBTT is out! Main attraction this time is a Heroes of Might and Magic or King’s Bounty style example map. This contains several new features, described below.

If you have no need of this example map and are making a game on a square grid, there is no real reason for updating to this version.

However, if you are making a game on a hex grid I strongly recommend updating the ConvertIndexToLocationNaive function in BP_GridManager_Hex, as it greatly increased the precision of converting world locations to hex grid indexes, such as when you hover the mouse over the grid.

Full list of changes can be found on my Trello. To find all changes within the project, search for “v3.2” in the “Find in blueprints” window. Note that some of the UI features are not currently networked. Highlights of the update below:

v3.2 (for version 4.27. Live 03.09.21):

  • FIXED: Imprecise math for converting from world location to grid index for hex grids
  • HoMM-style map with several new features:
  • Dynamic, context dependent mouse cursor
  • Showing enemy movement range on right click
  • Initiative bar
  • Flying movement
  • Move path suggestions when hovering over an enemy target
  • Counter attacks
  • Unit stacks

Hello . Hope you and your family are well.
Thank you for the big update!
FLYING and STACKING… Been waiting for these…
It all = FUN…
THANKS!!!

Hey ! Long time no see :slight_smile: Glad you’re excited for the update. It was a lot of fun to make.

Hello,

the update looks really exciting! Can’t wait to explore it!

That said, I do currently have a problem that I need to fix first. I’m fairly new to UE and have been exploring both it and your awesome toolkit. So this is probably a fairly simple thing to fix, but I’m stuck.

Whatever I did, I seem to have broken my unit’s ability to attack. When I try, it gives me the attack range tiles, but when I select the target, it does not fire an animation, nor is damage applied. No error message, the puppet just does nothing. I can end turn and move another puppet, but again, can’t attack:

From what I can tell when trying to track the issue down, BP_Action_Attack never even runs at all. BP_Action runs fine though.

Maybe a broken reference somewhere? But I don’t know how to fix it. Help would be really appreciated!