Martole
(Martole)
May 11, 2017, 9:51am
1
hi guys,
My question is :
I set up 2 teams by added tags (red,blue)
So how can I get the overlapping players number of the Red team (for example) ?
(aka how many red team guys on the trigger box)
I use “on actor begin overlap trigger box” and arrays in the level blueprint:
Any help would be appreciate it !
redbox
(redbox)
May 11, 2017, 10:34am
2
Add ForEachLoop from array, get tags from every object during loop, add branch and if tag == red,increment variable RedPlayersNumber, if tag == blue - BluePlayersNumber.
Martole
(Martole)
May 11, 2017, 9:59pm
3
hm thanky,but do mean like this?
cause its not working…
redbox
(redbox)
May 12, 2017, 4:05am
4
Something like this
But do you understand that even if 1 player from any team will be inside primitive, he will win? Because 1>0.
It looks like you need some additional conditions here.
Martole
(Martole)
May 12, 2017, 8:49am
5
i tried what you suggested , but sadly it cant recognize my tags! Im glad youre helping me!
Did i make a mistake somewhere?
Here is my player tag setup as well:
redbox
(redbox)
May 12, 2017, 8:55am
6
On last screenshot I can see that you clear tags array and then try to get something from it. Why is it so?
redbox
(redbox)
May 12, 2017, 10:02am
7
This setup looks correct.
Are you sure that tags really set? That “print string” outputs anything?
redbox
(redbox)
May 12, 2017, 10:09am
8
No, I mean when you set tags, with server event, there is “print screen” that should output tags. Is it prints something?
Martole
(Martole)
May 12, 2017, 9:28am
9
just I followed a team select tutorial with widget and there he used it :
Rest of them are fine ? only “setplayers tags 2.png ” is “strange”?
youtube link for that video
redbox
(redbox)
May 12, 2017, 9:53am
10
Oh, sorry, its fine. My mistake.
Martole
(Martole)
May 12, 2017, 10:01am
11
it recognizes the tags only this way: but like that cannot be “egal” the characters count differently why is that?
Martole
(Martole)
May 12, 2017, 10:18am
12
yes ,it prints the team name what you selected
Martole
(Martole)
May 12, 2017, 10:22am
13
the main issue is it cannot even go through the “Foreachloopwithbreak ”
as you can see,doesnt matter did i choosed team or not,
on this pic i choosed red team
Martole
(Martole)
May 12, 2017, 10:44am
14
so do you have a working similar system ? Idk how/where do i must process them all. wouldnt u show those blueprint ,it would be more clearly ! thanky
redbox
(redbox)
May 12, 2017, 10:35am
15
In my setup I set Character class for overlapping function. Maybe you use Pawn or your own class?
I get array of overlapping actors and process them to get and compare tags.
You get all players and process only first one, which is in (0) index. Do you understand? You need to process them all.
Martole
(Martole)
May 15, 2017, 2:23pm
16
hm i tried some options,so it only recognizes (but the server and clients counst differently) tags if im getting “out array” from “AllActorsOfClass”, if i try get array from “overlappingActors” it cant recognizes
any thoughts?