Sharing Targets

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Sharing Targets

Post by Broadus »

I've got a problem where all of the AI in single player (both teams) will share targets with eachother. As in, all Americans will aim at one target, while all Germans will aim at another. Distance doesn't seem to matter (as far as I can tell), because they'll share targets from all the way across the map.

As in, there are two guys on the same team, divided by a wall. Neither of them have targets (enemies). One of them will suddenly get a target on one side of the wall. The other guy (still no target) will suddenly decide that, because there's nobody for him to aim at, he will aim at what his buddy is aiming at, even though he can't see his buddy's target, because they're divided by the wall.
Despite the whole wall division, the guy behind the wall will stand completely still and aim at this unseen target. He won't move, even if told to by a script (runto, walkto, etc.), until the target he's aiming at dies.
If the guy behind the wall suddenly has a target that he actually can see, then he will decide to fight that target, instead.
Theoretically, allies sharing targets makes perfect sense, because when you see your teammate fighting someone, you'll think, "I'd better help him by fighting whoever he's fighting!" But this will make everyone on the team stand still and not move, making them too useless to help, anyway.

To put it simply, how do I prevent AI of the same team from sharing targets?

This is a huge problem for me. I've tried removing things such as aim animations, but they'll still look at where their targets are, even if they can't see them (and don't have aim animations).
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

properties

Post by tltrude »

With key "I" you can change how far they can hear and see.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Set their enemysharerange to 1 (0 means default). They'll still share enemies between teamm8s in line of sight, though :(
Image
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

Sorry, tltrude, but I'm working with scripts, and lowering the sight and hearing sadly doesn't do anything, anyway. Thanks for the help, though!
That helped a lot, JV! It does kind of stink how they'll still share with eachother if they can see eachother, but you can't win 'em all. It's way better than having them share across the map, anyway. That would have ruined me.
Is there some kind of "global"-type variable I can modify where the default enemysharerange for all AI will be 1 (if they don't already have anything specified in Radiant or whatever)?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Broadus wrote:Sorry, tltrude, but I'm working with scripts, and lowering the sight and hearing sadly doesn't do anything, anyway. Thanks for the help, though!
That helped a lot, JV! It does kind of stink how they'll still share with eachother if they can see eachother, but you can't win 'em all. It's way better than having them share across the map, anyway. That would have ruined me.
Is there some kind of "global"-type variable I can modify where the default enemysharerange for all AI will be 1 (if they don't already have anything specified in Radiant or whatever)?
Nope, it'll have to be set per AI.
Image
Post Reply