For example i want to start aiming only on player that is closest to me AND have variable ,A" true, and if someone without variable ,A" is the closest one to me i want to target another closest player with variable ,A"
Is it even possible?
For example i want to start aiming only on player that is closest to me AND have variable ,A" true, and if someone without variable ,A" is the closest one to me i want to target another closest player with variable ,A"
Is it even possible?
Yes. I need to know: What happens if no player has A = true?
It just ignores him even if he is the closest one, and aims at next closest player with varaiable A
In no players in the game have variable A = true then Stop aiming
Something like that?
rule(“Aiming closest alive player with variable A set to True”)
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is True For Any(All Living Players(All Teams), And(Compare(Event Player, !=, Current Array Element), Compare(Player Variable(
Current Array Element, A), ==, True))) == True;
}
actions
{
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Sorted Array(Filtered Array(
All Living Players(All Teams), And(Compare(Event Player, !=, Current Array Element), Compare(Player Variable(
Current Array Element, A), ==, True))), Distance Between(Event Player, Current Array Element)))), 100, To World,
Direction and Turn Rate);
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
}
}
More info about me and my game mods you can find here.
It’s exactly what i was looking for but in wondering, is there a possibility to target alive players, with variable A = true and in line of sight?
Sure, just add it into condition and action.
Can you do it?
Emm, nevermind.
variables
{
player:
0: CurrentTarget
1: CheckingFlagA
2: NewTarget
}
rule("Aiming closest alive player with variable A set to True")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is True For Any(All Living Players(All Teams), And(Compare(Event Player, !=, Current Array Element), And(Compare(Player Variable(
Current Array Element, CheckingFlagA), ==, True), Compare(Is In Line of Sight(Event Player, Current Array Element,
Barriers Do Not Block LOS), ==, True)))) == True;
}
actions
{
Set Player Variable(Event Player, NewTarget, Sorted Array(Filtered Array(All Living Players(All Teams), And(Compare(Event Player,
!=, Current Array Element), And(Compare(Player Variable(Event Player, CheckingFlagA), ==, True), Compare(Is In Line of Sight(
Event Player, Current Array Element, Barriers Do Not Block LOS), ==, True)))), Distance Between(Event Player,
Current Array Element)));
Skip If(Compare(Player Variable(Event Player, CurrentTarget), ==, Player Variable(Event Player, NewTarget)), 2);
Set Player Variable(Event Player, CurrentTarget, Player Variable(Event Player, NewTarget));
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Player Variable(Event Player,
CurrentTarget))), 100, To World, Direction and Turn Rate);
Wait(0.500, Ignore Condition);
Loop If Condition Is True;
Stop Facing(Event Player);
}
}
Cannot test it for real working but it is how I see a solution.
More info about me and my game mods you can find here.