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.
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 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
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:
Hi there! It is a bit hard for me to know exactly what is going on here. If you can end the turn and move a new puppet etc. then I doubt it is something wrong with the Action, as that would likely stop the action queue and prevent any further actions from occuring (or at least throw an error).
Since I donβt know what you have modified I canβt give you the exact answer, but these are the steps I would personally use to investigate this: In BP_Ability add a breakpoint to ServerInteract. This is the event that should fire when you click a valid tile with any ability. When you click the enemy to attack it, it should trigger the breakpoint. From there keep clicking Skip and see at which points it breaks off before leading to the attack. Consider comparing this by doing the same in a fresh project and see where they differ. Perhaps this will let you solve the problem on your own. If not, report back to me on the behavior and Iβll weigh in.
Pfff and as I hoped/suspected, the problem was really simple, which was great - but also really embarrassing, haha.
The breakpoint troubleshooting showed the ability didnβt have a valid target. Apparently in my testing around with puppet classes and changing meshs, at some point I replaced the enemy puppet without realising it and never designated the replacement as an enemy. No wonder the attack action didnβt run, it had no enemy to target. Now I feel like facepalming. Leaving this up anyway, maybe someone in the future stumbles across the same dumb mistake and finds this here, haha.
Welp, at least I learned a lot about troubleshooting. Thank you so much again! Your toolkit is a big reason Iβm even learning UE in the first place, because this is 100% the sort of game I adore and would like to make for my project and even from outside, the toolkit already made such a useful and comprehensive impression.