Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ComputeSightedPawns()
- {
- local LegendsCitizenPawn PossibleTarget;
- local float DistanceToPossibleTarget, MaxAngle, CurrentEnemyAngle;
- local Rotator CurrentPlayerRotation, EnemyPositionAngle;
- local Vector normalisedVector;
- local CurrentTargetStructure TempTarget;
- local array< CurrentTargetStructure > Temp${1}< ${3} >
- local int j;
- CurrentPlayerRotation = Pawn.Rotation;
- MaxDist = 600;
- MaxAngle = 90;
- ForEach WorldInfo.AllActors(class'LegendsCitizenPawn', PossibleTarget)
- {
- DistanceToPossibleTarget = vsize(PossibleTarget.location - Pawn.location);
- normalisedVector = Normal(PossibleTarget.location - Pawn.location);
- EnemyPositionAngle = Rotator(normalisedVector);
- if(DistanceToPossibleTarget <= MaxDist)
- {
- CurrentEnemyAngle = RDiff(CurrentPlayerRotation, EnemyPositionAngle);
- if(CurrentEnemyAngle <= MaxAngle)
- {
- TempTarget.TargetedPawn = PossibleTarget;
- TempArray.AddItem(TempTarget);
- j = TempArray.Find('TargetedPawn', PossibleTarget);
- }
- }
- }
- CurrentTargets = Temp${1}< ${3} >
- TempArray.Length = 0;
- }
Add Comment
Please, Sign In to add comment