Download

[SUPPORT] Advanced Turn Based Tile Toolkit

Added: I solved this problem below. In ability blueprint (BP_Ability_MoveAttack) check grid manager based on name of blue print, but If I duplicated grid manager, then name of blueprint is changed. and result of check is changed, then problem happens. I had to change that name of blueprint in check node.


This.

It was very tough rollercoaster. wheeew. At now, no problem!!! I will keep going to make fog of war based on latest version of ATBTT!

Added again:

I was scared very much by this problem. So I spent some time looking for a solution to a similar problem. And… I got these XD!!!

Hi Monokkel, New problem with latest version!

If I duplicate example level and BP_GridManager_Hex, and use them, then the move hover marker apeared as square, not hex.

  1. I duplicated Example Level. Name of new level is “DuplicateTestMap”
  2. I duplicated BP_GridManager_Hex. Name of new BP is “BP_GridManager_HexDuplicated”
  3. I opened the level “DuplicateTestMap”
  4. I deleted old grid manager “BP_GridManager_Hex”
  5. I added duplicated grid manager, “BP_GridManager_HexDuplicated” into level.
  6. Select All of units, tiles, and walls, and unset and set “Auto Grid Placeent”, So they can reference new grid manager, and they can get new grid index from grid manager. (sometimes, I just move them little on gird for this.)
  7. play
  8. then, move marker apeared is blue square, as you see that screenshot. This looks “SM_Marker_Move”, not “SM_Marker_Move_Hex”.
    But, value of “Default move marker” of grid manager, is set as “SM_Marker_Move_Hex”, as you can see in that screenshot.

This is latest version of ATBTT, with Unreal Engine 4.23. So, You can reproduce this very easy.

Is there Something I forgot or missed? I’m looking BP_Ability_MoveAttack now, but there is something confusing. If this is more clearer, I will post here agian.

I suspect this, too. I experience something like this link said:
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/114654-my-variables-constantly-being-reset-to-default
But, I made that grid manager with “duplicate”, not with “making child”.

I suspected - some kind of problem by SVN version control system. Because, sometimes SVN prohibit writing, so unpredicted problem happens.
But, I tested this by creating new project without version control system. In this case, problem was happened again. so, SVN is not cause.

Added:

  • If I use grid manager made through duplicating, in new level, same thing happens.
  • If I make a child from BP_GridManager_Hex, same thing happens.
  • When I change the value of “Default Move Marker Mesh” of grid manager, If that grid manager is child of BP_GridManager_Hex, or duplicated from BP_GridManager_Hex, then changed value is not applied. But, when I use just BP_GridManager_Hex, changed value of “Default Move Marker Mesh” is applied well.
  • This problem seems some kind of bug of unreal engine, like that link that I said above. I want to cry. should I try another version of unreal engine?

Added

  • I tryed with unreal engine verson 4.20. when I duplicate the BP_GridManager, It failed to compile, with ModifyBigUnitArrayByUnit function. but when I delete and remake node of ModifyBigUnitArrayByUnit, then it compiled well. but, after it, unit snapping on grid does not work. Shouldn’t I use the duplication and making child of blueprint?

@HyalineV: Glad to see that you figured it out yourself. I’m sorry, but I tried to reply to you earlier, but Epic did not allow me to log in until now. Gave me an error message because I loggen on too frequently.

Do you have any remaining questions that you have not fixed yourself?

Edit: By the way, the code for setting up the marker meshes in the abilities is mostly there for ease of setup when you’re experimenting and switching between grid types. If you use your own marker meshes or make your own abilities you can also just set the static mesh of the markers directly in the component list:

Hey Monokkel,

I still haven’t figured out the movement but I have made it so only the super effective attacks allow people to go again.

Thanks, EagleEyeGamma

Hey, sorry for ignoring your previous posts. Just absent-mindedness. You can use a status effect for temporary buffs. On activation you would apply the buff and on UnitEndTurn you would revert the buff. Check out the BP_SE_MindControl status effect for an example of a temporary effect. Just replace the mind control stuff with your buffing.

Your setup seems reasonable. Only thing I would change is that you spawn the emitters during the ExecuteAbility function, which is dedicated to game logic. You should keep the visual stuff within the AnimateAction events (unless it is truly immediate stuff that is not queued and displayed to the client, such as moving mouse hover markers etc.). If not, the emitters might trigger before the rest of the attack is played.

I’m sorry, but I don’t understand what you mean when you want the player to have full movement before attacking. Do you want to click a unit and have the active unit automatically both move and attack?

I want to make it so after they make an attack they gain full movement again and then repeat until they make a effective or not effective elemental attack.

Thanks, EagleEyeGamma.

Hey, I was wondering, what’s the best way to change the camera settings so that it doesn’t hop around as the active unit changes. Also, what would you recommend for making the sky visible when played? Even in a new level with a sky, when I play the project it disappears.

Thanks :slight_smile:

@Monokkel At now, I’m ok. No problem. Thank you!

If you’re using BP_Ability_MoveAttack as a base, when the ability is activated 2AP means the unit can move and attack and 1AP means that it can only attack. If you want it to be able to do both after an attack, make sure that the unit’s current AP is set to at least 2.

Great :slight_smile:

From a standard topdown template project how would I go about adding a turn
based encounter?

Take a look at the “Hybrid” map in Maps/Experimental. It shows how to set something like that up using the Third Person template. You should be able to do something very similar with the top down template. Try following that approach and let me know if you run into any difficulties.

Heya Monokkel,

I am using the hybrid/experimental version of ATBTT to create my game with free roam until combat. I would like to use a radial wheel to have the player select possible actions (movement, attack types, magic, etc…). Can you suggest a good spot in the code to insert my radial wheel creation? Any other suggestions for this type of game would be greatly appreciated.

Thanks,

Sounds kind of like the ability bar used in the Advanced map, but displayed on a wheel and that can be hidden/shown by clicking? If this seems right use the ability bar as a starting point, but change the layout to a radial wheel. Then in the player controller you can tie an input event to showing and hiding the wheel.

You can access the ability box like so:

Hi @Monokkel !

Because your help, my work is going good:D! Thank you!

Today, I got a suggestion. Of course, decision is yours. But consider this once please.

This is function “SetupTileMarkers” in BP_Ability

It check if grid manager is hex, then set the tile marker mesh and decal to hex.

I changed like this

c41541e68047889caeb3639609dea58d391763e1.jpeg

In yours, for checking grid manager is hex or not, you use name of grid manager by GetClass.
Because of this, When I use new grid manager with inheritance, I have to change name of those parameter of GetClass functions.
To check if grid manager is hex or not, using the class name of grid manager looks not good in flexibility.

Especially, if I use many different grid managers in same game, this can be problem.

In here, I use casting to BP_GridManager_Hex, but I don’t think it’s best way. Maybe gameplay tag will be good option. Or, there will be more better way that I can’t imagine now.
(There are simmilar things in ATBTT. From now, I have to modify all of them.)

How do you think about changing the way to check if grid is hex or not? And, If you have more good idea about this, please tell me:)
I want to use your toolkit when you upgrade ATBTT continually, So I suggest this:)

Thank you!

Thanks for the suggestion :slight_smile: I agree that this part is one of the ugliest hacks in the toolkit, but it is mostly there for debugging purposes. In a real game I would probably not use that code at all, and it is set up so that it is ignored if the ability does not use the default hover marker mesh. In an actual game I expect people to either use only hexagonal grids or only use square grids, so there is no reason to have code that checks what type of grid you are using. So when making abilities for your game I recommend just selecting the components directly in the ability’s component hierarchy and assigning the mesh manually. The code is simply there for simple testing and debugging, so I don’t worry too much that it is not extendable, as I would not recommend extending on this code unless you’re making a very uncommon TBS that utilizes both hexagonal and square grids using the same abilities. Regardless, what you have changed might be a cleaner solution than what is currently in the toolkit and I will consider adding it in a future update.

Hey Monokkel,

Thanks for the tip on the ability bar to radial wheel switch. For my game, I like the free roam till combat trigger of the hybrid system, but I would like the combat (ability bar/or wheel) that is set up in your advanced map. Is there a way to combine the two?

Thanks

I cannot see any reason why it should not be able to combine the too. The advanced example differs only in the blueprint components added to the grid manager and units, while the Hybrid map differs from default by its turn manager and unit. If you add the CoverSystem and/or StealthSystem to the GridManager you’re using and UnitAbilitySystem, UnitExtraAbilities and UnitStealthSystem to the units you are using that should be enough. Let me know if you run into any difficulties.

Monokkel, combining the hybrid and advanced worked like a charm. I have another question though, after reparenting the BP_ThirdPersonCharacter to my own custom character has caused the attack part of the turn based combat not to engage. I can click the movement icon and move, but neither the AI character or the player controlled character can attack. I once again thank you for any and all advice you may have.

Thanks,

P.S. The problem occurs when i click the attack icon, the blue(movement) squares disappear and the red (attack) squares never appear.

Hmm, odd. Could be any number of things happening, really. I’ll have to ask you to look into it a bit more if I am to give you a solution. What abilities are you using? If you’re using BP_Ability_Laser (the one from the advanced example), red squares only appear under enemy units in range and not on empty tiles. Might this be what is happening? If this is not the case you can try using breakpoints to see at what point the execution chain fails. For example you can add a breakpoint to OnClicked in WBP_Ability and then use FrameSkip to step through the execution chain. See if anything seems wrong here. Does the correct ability get activated? If so, is FindTilesInRange called etc. Give me a description of what seems to happen and I’ll try to help you out.

Monokkel,

The only change I made was to reparent the ThirdPersonCharacter to my own MannequinCharacter that uses the Advanced Locomotion System for movement. I am not using the BP_Ability_Laser. The series of events happens like this:

  1. Character spawns in the hybrid area and I run him into the first room.
  2. Combat trigger fires and I enter turn-based mode.
  3. The blue movement squares appear and I am able to move the movement spline around but not click a tile to move.
  4. I am also unable to click on the enemy to attack.
  5. I am able to click on the end turn.
  6. After clicking on end turn the the BP_Unit_Anim_Debug runs to my character and stops.

The breakpoint added to OnClicked never engages. Could this be a possible HUD conflict? Or the mouseover?

Monokkel,

After making a few changes, I think my problems are related to changing the BP_ThirdPersonCharacter’s skeletal mesh and anim class to my own for use with the Advanced Locomotion System. I am unsure of how much using this anim class and skeletal mesh affects the ATBTT. Any advice would be greatly appreciated.

Thanks,