# Pawn ai - decide between friendly and enemy and different priorities of enemies (actor arrays?)

**URL:** <https://forums.unrealengine.com/t/pawn-ai-decide-between-friendly-and-enemy-and-different-priorities-of-enemies-actor-arrays/310038>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 8, 2015, 10:32pm UTC](https://forums.unrealengine.com/t/pawn-ai-decide-between-friendly-and-enemy-and-different-priorities-of-enemies-actor-arrays/310038 "2015-03-08T22:32:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![t0b4cc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@t0b4cc0](https://forums.unrealengine.com/u/t0b4cc0)\
**Post date:** [March 8, 2015, 10:32pm UTC](https://forums.unrealengine.com/t/pawn-ai-decide-between-friendly-and-enemy-and-different-priorities-of-enemies-actor-arrays/310038/1 "2015-03-08T22:32:30Z")

</div>

Hi!

So i made myself a turret.

it shoots a projectile “on overlap”. currently, for testing purposes i filtered for the “overlap” actor to see if his name is mycharacter\_c (esle it would trigger on the projectiles too)

Anyways I see that doesnt get the results id like to etc with more than 1 problem

So I figured I go about it in a logical way (always the best approach) - with an event tick.  
So the tick should keep track of every actor that is overlapping in its trigger box. With thah I have 2 problems, first i dont know exactly how to work with actor arrays. It seems hard to store and load and filter infos from it, and the other problem is I dont know at what point I should give an indicator of a unit being team blue or team red.

Id like to name actors like: “MINION\_TEAMBLUE\_PRIORITYLOW” and “PLAYER\_TEAMRED\_PRIORITYHIGH” for example. Do i just have to do it as a variable in the actor when its generated? It seems actorarray “getters” seem to store classes or sth…

So the turret should get the actor array list, I copy everything into a “target list” - remove everything that has “TEAMBLUE” (for the red turret) then check if theres a “HIGH” priority target. I found filters but couldnt feed it the actorarray.

Hope anyone could give some ideas how to go about this. I also want to mention that this will be for a multiplayer game (as nearly all solutions i could find on turrets are for singleplayer, and only deal with the same 1 actor.)  
Maybe it helps someone Im building a turret that kinda works like the ones from lol.

best regards

PS: documentation about arrays didnt help much, and the 2 top videos on turrets also dont help me in my case.

---

<div class="post-metadata">

**Author:** ![t0b4cc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@t0b4cc0](https://forums.unrealengine.com/u/t0b4cc0)\
**Post date:** [March 11, 2015, 8:19pm UTC](https://forums.unrealengine.com/t/pawn-ai-decide-between-friendly-and-enemy-and-different-priorities-of-enemies-actor-arrays/310038/2 "2015-03-11T20:19:30Z")

</div>

ive now found lots of info on the wiki and in the documentation:

this was the best for the basics:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

here under A theres lots of tutorials about AI,

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

his one helped me the most: (a bit advanced)

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...
