Download

friend or foe - distinguish - put npcs, buildings and players in teams

Hi!

I could only find so much in the tutorial things and most videos etc are made off 1v1 or 1vALL scenarios.

So whats the best way to distinguish between 2 teams if I have multiple players, npcs and actors fighting eachother (creating a moba style game)

(so i can exclude minionaggro for allied minions and that stuff)

I thought about a few ways but id like to get that right from the start so i wont have to redo a **** ton of work later.

First way I thought about was giving all the minions, players and buildings a int variable is the way to go.
With that (seemingly simple solution) I still have some questions -
Upon creation (the minions are spawned by an actor blueprint per “spawn actor” node) Can I take the return value of the node cast to it and then change the variable of the minion based on the spawnpoints teamside?

On the (minions) npcs “enemy detection” task, Im using get all actors of class, how would I go about filtering and getting only enemies?

Maybe make the good and bad guys have different collision objects/class. So good guys be pawns and bad guys be vehicles or something like that. Then have enemy character run a trace for pawns and vice versa. I was wondering myself if you can make more collision objects. There should be an AI class or custom ones. Im running my AI with this method, it seems to work fine. I have made my AI fight each other this way for fun.lol

a few seconds ago i sucessfully tested the option a redditor suggested, i used tags now.

u can filter arrays for tags and stuff, really great.

to point into a direction: like this: https://answers.unrealengine.com/questions/24582/how-to-tag-playerenemybullet.html