Lastmango
Member
- Joined
- Nov 25, 2014
- Messages
- 173
I have some code that attempts to select local hostile targets during a "defend this dude" mission. The POI is fixed; so it's relatively easy to test.
My code to select hostiles within a radius of 15 is:
I know this is working because if I change the code to friendly I see the creatures needing defending. I can open this up and see the simple creatures around on the ground as well.
When I look in Wildbuddy's objects list I see the Creature, I see it's range (usually 2-4 pts), and I see that it is hostile.
However the selection above NEVER finds it.
If I expand the range it finds normal hostile mobs on the outskirts of the small mission area. So say if I expand the Radius out to 50 my routine will run around and kill the native mobs hanging out in the area.
So why are my targets missing from the GameManager.Actors ?? is it a synchronization issue with the mission? Like those values aren't updating as fast as the mission is spawning in new mobs?
Apoc; if you want the code and profile that shows this let me know. It's easy to get to since it's a soldier holdout mission at roughly level 5. It takes less than 10 minutes to bot up to that point.
-S
My code to select hostiles within a radius of 15 is:
Code:
var localActors =
GameManager.Actors.Values.Where(
b => b.Disposition == Disposition.Hostile && b.Position.Distance(new Vector3(X, Y, Z)) <= Radius)
.OrderBy(a => a.Distance)
.ToList();
I know this is working because if I change the code to friendly I see the creatures needing defending. I can open this up and see the simple creatures around on the ground as well.
When I look in Wildbuddy's objects list I see the Creature, I see it's range (usually 2-4 pts), and I see that it is hostile.
However the selection above NEVER finds it.
If I expand the range it finds normal hostile mobs on the outskirts of the small mission area. So say if I expand the Radius out to 50 my routine will run around and kill the native mobs hanging out in the area.
So why are my targets missing from the GameManager.Actors ?? is it a synchronization issue with the mission? Like those values aren't updating as fast as the mission is spawning in new mobs?
Apoc; if you want the code and profile that shows this let me know. It's easy to get to since it's a soldier holdout mission at roughly level 5. It takes less than 10 minutes to bot up to that point.
-S