# \[SUPPORT\] Advanced Turn Based Tile Toolkit

**URL:** <https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930>\
**Category:** UE Marketplace\
**Tags:** unreal-engine, fab\
**Created:** [February 26, 2015, 8:30am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930 "2015-02-26T08:30:16Z")\
**Posts on this page:** 20\
**Page:** 30

<div class="post-metadata">

**Author:** ![LDodds](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDodds](https://forums.unrealengine.com/u/LDodds)\
**Post date:** [October 28, 2015, 10:11pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/617 "2015-10-28T22:11:05Z")

</div>

My mistake on that, Actually turns out its the wandering unit that is repeating his turn over and over again.  
Abit easier to debug and see what the issue is anyway

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [October 30, 2015, 2:47am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/618 "2015-10-30T02:47:33Z")

</div>

Finally got some time to work on my project again for a few hours. I managed to make a Macro that returns an area of indexes based on the size of an object and which tiles it is over. It has a few constraints such as the object needs to be centered on it’s scene component. It also uses the object’s bounds so it might not be ideal for all objects.

Once I get the blue print cleaned up I will share it maybe someone can make it run better. Or at the very least other people can use it for their projects.

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [October 30, 2015, 1:14pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/619 "2015-10-30T13:14:50Z")

</div>

I know it is not super clean but here is the basics of it. It takes the Transform and Bound vector of an object as well as the Grid Manager Ref. Since the bound is a positive number and the registration point is in the middle of that it needs to be divided in half to get the positive and negative value. Subtract that from the location to get the lowest value edge. Multiply the bound size by 2 and divide by the tile size this gives you the number of passes on both x and y. Run it through nested loops. Subtract 1 from the index and multiply that by the tile size add that to the lowest edge. Put it all back into a vector and run the VectorToIndexInterface to get the index. Add it to a temp array and then return the temp array at the end.

It is a lot of basic math nods with connecting wires running everywhere I did my best to use Knots to keep the flow clean. If someone sees a better way to do this I would love to have a look at it. However I know this is something that I think will be very helpful so I am hoping others will find it useful as well.

 ![Macro1.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/3/1f3086e723c74a98542cf8f5c6ec3731005feedf.png)  
 ![Macro2.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/1/0719a0f45473ee272203fde8bd4ffaf3472e08f0.png)  
 ![Macro3.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/2/95213d5010561649cf6735db0988c5d0d367f53f.png)

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [October 31, 2015, 6:49pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/620 "2015-10-31T18:49:21Z")

</div>

@: Ok, great that you figured it out! Is it working now or do you still need assistance?

@Anzak: That’s really awesome! I’ll try to implement it myself when I have the time and give feedback 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ee584636](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ee584636](https://forums.unrealengine.com/u/anonymous_user_ee584636)\
**Post date:** [November 4, 2015, 6:28am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/621 "2015-11-04T06:28:15Z")

</div>

Hi I was following Tracey White’s UI Tutorial and ran into some problems at the five minute mark.  
I am using a melee Pawn that I renamed Player\_2 instead of Tracy’s BallPawn. The timer works on the side but does not display on the widget.  
Is there something I’m missing?

 ![1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/9/d97b74924bf233c0ea6323faed9a2a05e435aaf3.jpeg)  
 ![29d338d30d0f7c503e930980db792227b950ce8b.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/d/29d338d30d0f7c503e930980db792227b950ce8b.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ee584636](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ee584636](https://forums.unrealengine.com/u/anonymous_user_ee584636)\
**Post date:** [November 4, 2015, 6:30am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/622 "2015-11-04T06:30:39Z")

</div>

Right now I’m also trying to create a level select mechanic. Is there a good way to do it with the Advanced Turn Based Tile Toolkit?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5fba14f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5fba14f1](https://forums.unrealengine.com/u/anonymous_user_5fba14f1)\
**Post date:** [November 4, 2015, 8:08am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/623 "2015-11-04T08:08:21Z")

</div>

Hi  
I purchased the toolkit for my class project, and to be honest, this is the most awesome thing I’ve ever bought in the marketplace. Your tutorials are descriptive too. I have some questions regarding to my project using the toolkit. I want the character to have 4 attacking moves (active/passive moves, like in Pokemon) instead of just one move (punching/shooting), will that be possible to implement? And also, can I change the game to player vs player (probably on 1 computer) instead of player vs AI?  
Thank you

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c2655a011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c2655a011](https://forums.unrealengine.com/u/anonymous_user_c2655a011)\
**Post date:** [November 4, 2015, 9:39am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/624 "2015-11-04T09:39:46Z")

</div>

Hi all,

Suddenly, Unit Parent doesn’t not compile anymore.  
When I try to compile the blueprint, I suffer an engine crash. This is what I see in the error log:

\<ErrorMessage\>Assertion failed: ((UObject\*)ContainerPtr)-\>IsA((UClass\*)GetOuter()) [File:D:\BuildFarm\buildmachine\_++depot+UE4-Releases+4.9\Engine\Source\Runtime\CoreUObject\Public\UObject\UnrealType.h] [Line: 308]  
‘Pawn\_Anim\_BP\_Ranged\_C\_156’ is of class ‘Pawn\_Anim\_BP\_Ranged\_C’ however property ‘StructProperty\_1890’ belongs to class ‘TRASHCLASS\_Pawn\_Anim\_BP\_Parent\_179’  
\</ErrorMessage\>

Is somebody there already found and solved above error?  
My project is stuck because of this ☹

PS. it happens both with 4.8 and 4.9 UE version. I have added some new pawns but I can’t understand why it happen. I guess if the Pawn\_Anim\_BP\_Parent is somehow corrupted.

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [November 5, 2015, 3:44am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/625 "2015-11-05T03:44:28Z")

</div>

I decided to try a different tactic and I am an not understanding the edge array I think. When I initialize a platform I set an array of all the tile indexes of the platform. That works perfectly with my macro. Then I deactivate all of the platforms by hiding them and setting all all of the side of the edge area for each tile under it to 0. Then When I active a tile I set all of the edges of the tiles under the platform to 1. This does not seem to have the desired effect. In fact the entire grid is able to be walked on like this. Suggestions on what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [November 5, 2015, 8:15am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/626 "2015-11-05T08:15:08Z")

</div>

Just a quick message. Sorry for taking a while to get back to you guys. I’ve had some really busy days. I’ll get to answering all of you tonight after work.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2c1a6164](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2c1a6164](https://forums.unrealengine.com/u/anonymous_user_2c1a6164)\
**Post date:** [November 5, 2015, 9:09am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/627 "2015-11-05T09:09:31Z")

</div>

I’m wondering one thing about the AI. I want the enemy AI to be able to ignore player-units during the path-finding/decision-making process but I can’t seem to find a way to implement that properly. Let’s say that all units have a boolean called ignoreDuringPathfinding, and if it is true the AI should pretend like the unit doesn’t exist.

---

<div class="post-metadata">

**Author:** ![Bankworthy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bankworthy](https://forums.unrealengine.com/u/Bankworthy)\
**Post date:** [November 5, 2015, 3:07pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/628 "2015-11-05T15:07:21Z")

</div>

I’ve been trying to get an AI controlled Unit to search and attack Units with faction = Enemy  
Like a friendly NPC, but even with find tiles in ranges with target faction = Enemy, it still finds units with faction = player  
Is there something in the AI Bps that disallows AI attacking Enemy factions?

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [November 5, 2015, 11:32pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/629 "2015-11-05T23:32:00Z")

</div>

Ok, I finally have some time to answer. Lets do this 🙂

> [@deflip007;413662](#):
>
> Hi I was following Tracey White’s UI Tutorial and ran into some problems at the five minute mark.  
> I am using a melee Pawn that I renamed Player\_2 instead of Tracy’s BallPawn. The timer works on the side but does not display on the widget.  
> Is there something I’m missing?

The main problem here is that your melee unit is not actually the player pawn. I believe Get Player Pawn refers to whatever pawn is possessed by a particular player at a particular time. For ATBTT this will get the grid camera and not the current pawn, as the current pawn is not actually possessed. Instead of getting the current player pawn get a reference to ATBTT\_Game\_Mode and get the current pawn from there. Hopefully that should solve your problem.

> [@deflip007;413664](#):
>
> Right now I’m also trying to create a level select mechanic. Is there a good way to do it with the Advanced Turn Based Tile Toolkit?

I haven’t really looked into switching levels, though I know several people have done so with the toolkit already. This is one of those places where I reveal my ignorance of much of UE4. My knowlede is fairly specialized. I can see no reason why switching between maps would be different in ATBTT than in any other UE4 project, though, so any general tutorials you can find on the subject should do the trick. I apologize for not being able to help beyond this.

> [@anhquan0412;413699](#):
>
> Hi  
> I purchased the toolkit for my class project, and to be honest, this is the most awesome thing I’ve ever bought in the marketplace. Your tutorials are descriptive too. I have some questions regarding to my project using the toolkit. I want the character to have 4 attacking moves (active/passive moves, like in Pokemon) instead of just one move (punching/shooting), will that be possible to implement? And also, can I change the game to player vs player (probably on 1 computer) instead of player vs AI?  
> Thank you

Very glad to hear that! Various different attacks is absolutely possible to add, and a few users have done so already. It depends a bit on what you’re after, though. Generally attacks are resolved through the bluprints in Unit\_Parent; mainly in the Attack Victim and Receive Damage parts of the event graph. There are many different ways to add attacks. In pokemon you would choose different attacks through a menu. If you have such a menu you can modify a variable in the current pawn when you select an attack (maybe an enum that holds various attack names). Then when you run the attack victim code you would add a switch that would resolve the attack differently based on the value of this variable. If you only want basic stuff like elemental damage with resistances this can be baked into receive damage.

> [@Wisdom-;413742](#):
>
> Hi all,
> 
> Suddenly, Unit Parent doesn’t not compile anymore.  
> When I try to compile the blueprint, I suffer an engine crash. This is what I see in the error log:
> 
> \<ErrorMessage\>Assertion failed: ((UObject\*)ContainerPtr)-\>IsA((UClass\*)GetOuter()) [File:D:\BuildFarm\buildmachine\_++depot+UE4-Releases+4.9\Engine\Source\Runtime\CoreUObject\Public\UObject\UnrealType.h] [Line: 308]  
> ‘Pawn\_Anim\_BP\_Ranged\_C\_156’ is of class ‘Pawn\_Anim\_BP\_Ranged\_C’ however property ‘StructProperty\_1890’ belongs to class ‘TRASHCLASS\_Pawn\_Anim\_BP\_Parent\_179’  
> \</ErrorMessage\>
> 
> Is somebody there already found and solved above error?  
> My project is stuck because of this ☹
> 
> PS. it happens both with 4.8 and 4.9 UE version. I have added some new pawns but I can’t understand why it happen. I guess if the Pawn\_Anim\_BP\_Parent is somehow corrupted.

\*\*\*\*, I thought I had solved this bug ☹ The last time this happened it was due to a problem with the animation blueprints. It seems it is still like this from the error message. When you say 4.9 UE do you also mean the very latest version of my toolkit or just UE4? I need to try and narrow this stuff down… I’m not able to replicate it at the moment. Are you using a vanilla version? Terribly sorry for the inconvenience.

> [@Anzak;414378](#):
>
> I decided to try a different tactic and I am an not understanding the edge array I think. When I initialize a platform I set an array of all the tile indexes of the platform. That works perfectly with my macro. Then I deactivate all of the platforms by hiding them and setting all all of the side of the edge area for each tile under it to 0. Then When I active a tile I set all of the edges of the tiles under the platform to 1. This does not seem to have the desired effect. In fact the entire grid is able to be walked on like this. Suggestions on what I am doing wrong?

I’m not sure I understand completely what you mean. Let me try to rephrase and see if I understand. You get all the indexes under a platform as per your custom function. That means that you find the bounds of a platform, find what locations it is overlapping and convert those to indexes, right? Then when you hide the platform you make the edges of all those indexes 0. This should render them unwalkable. Then you show the platform and make all the edges 1 again making them walkable? I must not be understanding you correctly. Perhaps you can show me what you mean? Here is an excel mockup of my current understanding. Here is a small grid of 28 tiles with the indexes of the tiles in the middle of each tile and their edge costs in the edge array surrounding these indexes.

 ![su1SXdP.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/b/7bbf2978d1cd32024ee7b3ed5e9a76c2e2835dad.png)

If you want to understand how the edge costs are used in pathfinding I’ll give you a quick description. Say if you are a unit on tile 8 that wants to get to tile 8 in the second grid pictured above. To find out if it is possible to move between these the pathfinding first checks the eastern edge of tile 7. If this is 0 it gives up. If it is greater than 0 it checks the western edge of tile 8. If this is 0 again it gives up. If it is 1 it declares it as walkable. If it is greater than 1 it checks if the remaining movement points of the unit are greater than this cost. If so it is considered walkable. In other words the pathfinding checks both the edge of the tile it is leaving and the edge of the tile it is entering to see if they are impassable. It only checks the edge it is entering for difficult terrain.

I hope I have not just made you more confused. Please elaborate on what you are trying to achieve and I will help as best I can.

> [@AxelRantila;414495](#):
>
> I’m wondering one thing about the AI. I want the enemy AI to be able to ignore player-units during the path-finding/decision-making process but I can’t seem to find a way to implement that properly. Let’s say that all units have a boolean called ignoreDuringPathfinding, and if it is true the AI should pretend like the unit doesn’t exist.

I need to know what you mean by ignore. Do you want the pathfinding to treat the tiles as empty so that the AI can pass right through them or do you want the AI not to be able to move through these tiles, but simply not be aware of (not attack) the player units on them? For the first you would need to change the pathfinding. For the second you will simply need to modify the AI controller. I could give you some more specific suggestions, but I would like to be sure of what you mean first so I can answer your question correctly.

> [@Bankworthy;414719](#):
>
> I’ve been trying to get an AI controlled Unit to search and attack Units with faction = Enemy  
> Like a friendly NPC, but even with find tiles in ranges with target faction = Enemy, it still finds units with faction = player  
> Is there something in the AI Bps that disallows AI attacking Enemy factions?

Yeah, the problem here is that while Find Tiles In Range can be set to search for a specific faction, pathfinding always searches for player units. I have changed this in the coming update so that both functions finds all units of all factions and afterwards chooses what to do with this information. If you change this part of the Search and Add Tile function:

 ![tE8J3yA.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/b/7b85bb6593c6a72228632e96a86effdf98e6d1a3.png)

To this:

 ![fCCrcxN.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/7/1780d0a5737cf8b81dbdc5ec2471050881942258.png)

The AI should start killing one another. The next step would be to have them select the potential targets from the Reachable Pawns Array (from pathfinding) and Pawns in Sight Array (from Find Tiles in Range) based on some other metric than whichever unit has the lowest health.

Here is the modified Make Choice Array function in ATBTT\_AI\_Controller of the WIP update. It is modified so that it throws out all potential targets that are not player units. Modifications to this function could be made to allow for enemy units that target their own for healing, go berserk and attack each other etc.

 ![mFwbdD2.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/2/724a9f2f15640504f62d74bbeb67b916ba2d678d.png)

I hope that is enough to get you started. What is your desired end result, by the way?

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [November 6, 2015, 12:30am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/630 "2015-11-06T00:30:05Z")

</div>

Ok if I am understanding this correctly then it needs to be 0 on both tiles of an edge to make it unwalkable. What I am doing is making all of the highlighted tiles edges 1. Everything around it should be 0. But if it needs to be 0 on both sides that explains since the outer edge is 1 on the area that I have made walkable.

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [November 6, 2015, 2:30am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/631 "2015-11-06T02:30:47Z")

</div>

I thought I was understanding what you said but it looks like I am wrong.

 ![Edge1.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/8/d8dedf805640d4c94dd6da3e545ec8088ef48266.png)  
 ![Edge2.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/f/5f51b5d0fe87e6194e8919373287292b4152ea07.png)  
 ![Edge3.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/9/69eeb02a17af73f3475b17fafd67d6a2e48279ac.png)

Tile area array is all of the tiles under the platform. There is an array for each edge top, bottom, right, and left. When a platform is initialized I do nothing though when it is spawned I have a process check what it should be and hides all but the starting one. When it hides them it goes through the Tile area array and sets the edges for all tiles all edges to 0. When I unhide which I do for the first platform at the start of the game I set all edges for all tiles in the Tile area array to 1. Then I loop through each of the 4 edges and set the 3 edges for that side to 0 for each tile on the edge. Each platform is 4x4 tiles.

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [November 6, 2015, 2:34am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/632 "2015-11-06T02:34:10Z")

</div>

As a thought for a debugging feature would be a way to turn on a decal that shows the edge values like the image you put up. Just a thought as I try to noodle through this.

---

<div class="post-metadata">

**Author:** ![Anzak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anzak](https://forums.unrealengine.com/u/Anzak)\
**Post date:** [November 6, 2015, 3:21am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/633 "2015-11-06T03:21:19Z")

</div>

I am wondering if this is an artifact of using children of all the base classes. In this case you can see I am using Tile Game Mode which is a child of BP Grid Manager Game Mode. I am also using Tile Grid Manager which is a child of BP Grid Manager. However I am using the Ref to BP Grid Manager to get to the edge array. The part that is troubling to me is that it seems ok with using the grid size x and grid size y from the same ref and that works correctly so it should not be a case where I have not accessed the correct variable. I did try setting all of the tile edges to 0 for all tiles on begin play in the Tile Grid Manager and that does work but activating a tile does not change it’s values back to 1. Anyway eyes are crossing I am calling it a night will try some more things tomorrow.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c2655a011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c2655a011](https://forums.unrealengine.com/u/anonymous_user_c2655a011)\
**Post date:** [November 6, 2015, 9:14am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/634 "2015-11-06T09:14:46Z")

</div>

> [@;414991](#):
>
> \*\*\*\*, I thought I had solved this bug ☹ The last time this happened it was due to a problem with the animation blueprints. It seems it is still like this from the error message. When you say 4.9 UE do you also mean the very latest version of my toolkit or just UE4? I need to try and narrow this stuff down… I’m not able to replicate it at the moment. Are you using a vanilla version? Terribly sorry for the inconvenience.

Nope, I don’t use your latest version. I only get what I need from your updates because I have greatly changed the toolkit for our game purpose.  
I use the 1.4 version.

Should I download your latest version and copy/paste only the Animation Blueprints to solve my problem?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2c1a6164](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2c1a6164](https://forums.unrealengine.com/u/anonymous_user_2c1a6164)\
**Post date:** [November 6, 2015, 9:28am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/635 "2015-11-06T09:28:59Z")

</div>

> [@;414991](#):
>
> I need to know what you mean by ignore. Do you want the pathfinding to treat the tiles as empty so that the AI can pass right through them or do you want the AI not to be able to move through these tiles, but simply not be aware of (not attack) the player units on them? For the first you would need to change the pathfinding. For the second you will simply need to modify the AI controller. I could give you some more specific suggestions, but I would like to be sure of what you mean first so I can answer your question correctly.

The later is what I want to accomplish in my game. If a condition is true (in my case the return value of a function in Unit parent (that seriously needs to be renamed to something better)) for player units, the AI should not to attack the player unit in question. I tried to change it myself but I couldn’t figure how to do it in the AI controller.

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [November 6, 2015, 12:41pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/636 "2015-11-06T12:41:52Z")

</div>

> [@Anzak;415021](#):
>
> Ok if I am understanding this correctly then it needs to be 0 on both tiles of an edge to make it unwalkable. What I am doing is making all of the highlighted tiles edges 1. Everything around it should be 0. But if it needs to be 0 on both sides that explains since the outer edge is 1 on the area that I have made walkable.

You misunderstood me. If either edge is 0 it should be unwalkable. Note that this is going to change in the next update when only the edge of the tile you are leaving is ever checked.

> [@Anzak;415074](#):
>
> I thought I was understanding what you said but it looks like I am wrong.  
> Tile area array is all of the tiles under the platform. There is an array for each edge top, bottom, right, and left. When a platform is initialized I do nothing though when it is spawned I have a process check what it should be and hides all but the starting one. When it hides them it goes through the Tile area array and sets the edges for all tiles all edges to 0. When I unhide which I do for the first platform at the start of the game I set all edges for all tiles in the Tile area array to 1. Then I loop through each of the 4 edges and set the 3 edges for that side to 0 for each tile on the edge. Each platform is 4x4 tiles.

If what you want is a platform that is walkable with no other tiles in the game walkable it should be enough to make every edge under the platform 1 and every edge not under the platform 0. This should work for what is currently on the marketplace.

> [@Anzak;415077](#):
>
> As a thought for a debugging feature would be a way to turn on a decal that shows the edge values like the image you put up. Just a thought as I try to noodle through this.

That is a very good idea, and I’ve thought about it before. It is on my list of things to do. For now you can do what I have done. In BP\_GridManager when pressing a key of your choice, run the Get Hit Tile and Location and Index function and use the outputted index to get that index from the edge array. Then print all of these edges so you can check them during runtime. Note that which edge is east/north/west/south might not make sense to you. I don’t think there is one direction that is more obviously “west” in the viewport so it was chosen fairly arbitrarily when I first made the toolkit.

> [@Anzak;415095](#):
>
> I am wondering if this is an artifact of using children of all the base classes. In this case you can see I am using Tile Game Mode which is a child of BP Grid Manager Game Mode. I am also using Tile Grid Manager which is a child of BP Grid Manager. However I am using the Ref to BP Grid Manager to get to the edge array. The part that is troubling to me is that it seems ok with using the grid size x and grid size y from the same ref and that works correctly so it should not be a case where I have not accessed the correct variable. I did try setting all of the tile edges to 0 for all tiles on begin play in the Tile Grid Manager and that does work but activating a tile does not change it’s values back to 1. Anyway eyes are crossing I am calling it a night will try some more things tomorrow.

Hmm, I don’t really think it should matter. I’ve used child blueprints of both of these myself when making my example game without any issues. The reference to BP\_Grid\_Manager is set in ATBTT\_GameMode by getting all actors of type BP\_GridManager (which should include any children) and setting the reference to the first BP\_GridManager found (since there should always be only one). I can’t be absolutely sure though.

Like I said I would first check that all tiles under the platform have edges of 1 and all outside have edges of 0. Note that you will need to run pathfinding again any time you modify the edge array. Pathfinding only takes into consideration the values of the edges at the moment pathfinding is run.

> [@Wisdom-;415178](#):
>
> Nope, I don’t use your latest version. I only get what I need from your updates because I have greatly changed the toolkit for our game purpose.  
> I use the 1.4 version.
> 
> Should I download your latest version and copy/paste only the Animation Blueprints to solve my problem?

Ok, good to know it is probably because of the old bug. No, it shouldn’t be necessary to do that. Simply copy the part of the event graph of Anim\_BP\_Parent that has to do with updating idle/walking/running into the event graphs of the child animation blueprints (I can’t check right now since I’m at work, but it should be the top part of the event graph). After you have copied it make sure you get a new reference to the actual event driving these animations and replace the one that reads “copy”. I hope that makes sense. If you are still confused I’ll send you a screen grab of the event graph when I’m home.

> [@AxelRantila;415194](#):
>
> The later is what I want to accomplish in my game. If a condition is true (in my case the return value of a function in Unit parent (that seriously needs to be renamed to something better)) for player units, the AI should not to attack the player unit in question. I tried to change it myself but I couldn’t figure how to do it in the AI controller.

You should be able to accomplish what you want by modifying the Make Choice Array function in a similar way to what I have done in the last screenshot of my previous post. Instead of not adding a unit index to the choice array if it is not of the player faction it should refrain from adding it if your custom variable is a certain value. Sorry for the naming conventions, by the way. I was uncertain what would be a sensible naming convention when I first made the toolkit and went with what made sense in the moment. I will prefer keeping the names as they are in the future unless I have a very good reason not to, though, as to not confuse users upgrading the toolkit or following my tutorials.

[Previous page](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930.md?page=29)

[Next page](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930.md?page=31)
