Trying to get the "known unit count" function to work. Editor description says that it returns the number of units of type X the player has scouted.
I created a brand new map from scratch. Nothing on it except starting locations and no triggers except one which runs this function. It only ever returns zero. Even if I'm looking directly at a unit of the specified type.
is there a way to know what units have been scouted? If not, what would be the best way to do it? Periodically check a radius around every unit? Create a behavior in data which puts a dummy effect on all the nearby units and check how many units have the dummy effect?
This may only work for AI. This means that the player control must be "computer" and that the player must have a started AI (campaign recommended).
In melee the AI is programmed to send worker units (Probe, SCV or Drone) to look at starting locations to locate the enemy (like humans have to). This is a scout. Buildings it sees become "known" as they are still visible through the fog of war until the area is scouted again (in which case they are either still there or gone). The idea of the function is to process scouted information.
For example, if your AI scouted that the opponent has 7 barracks you can make an estimate that he will be going an infantry heavy army composition and can replace casualties almost instantly.
It might also return units that were once seen but are now hidden out of line of sight. For example if you see 20 marines and 10 marauders it might return those even if the enemy has doubled or even tripled the number since then. I am not sure of this.
This only applies to fair AI. Cheating AI has no line of site so has no need to scout and knows the exact amount of everything on the map always (so functions the same as global count mechanics).
The main difference between this function and simply counting all units from the group of all visible units of a certain type for a player is that this native will count units out of current line of site (not visible) but were once visible (were in line of site, even for a moment).
thanks heaps. Yeah, things like units seen and visibility flags only work for AI players. I should have thought of that but that is why it can be so useful to have a second set of eyes on a problem.
There's just so many things which are broken I just assumed this one was in the same pile.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Trying to get the "known unit count" function to work. Editor description says that it returns the number of units of type X the player has scouted.
I created a brand new map from scratch. Nothing on it except starting locations and no triggers except one which runs this function. It only ever returns zero. Even if I'm looking directly at a unit of the specified type.
is there a way to know what units have been scouted? If not, what would be the best way to do it? Periodically check a radius around every unit? Create a behavior in data which puts a dummy effect on all the nearby units and check how many units have the dummy effect?
Thanks for any help you can give.
This may only work for AI. This means that the player control must be "computer" and that the player must have a started AI (campaign recommended).
In melee the AI is programmed to send worker units (Probe, SCV or Drone) to look at starting locations to locate the enemy (like humans have to). This is a scout. Buildings it sees become "known" as they are still visible through the fog of war until the area is scouted again (in which case they are either still there or gone). The idea of the function is to process scouted information.
For example, if your AI scouted that the opponent has 7 barracks you can make an estimate that he will be going an infantry heavy army composition and can replace casualties almost instantly.
It might also return units that were once seen but are now hidden out of line of sight. For example if you see 20 marines and 10 marauders it might return those even if the enemy has doubled or even tripled the number since then. I am not sure of this.
This only applies to fair AI. Cheating AI has no line of site so has no need to scout and knows the exact amount of everything on the map always (so functions the same as global count mechanics).
The main difference between this function and simply counting all units from the group of all visible units of a certain type for a player is that this native will count units out of current line of site (not visible) but were once visible (were in line of site, even for a moment).
OF COURSE!
thanks heaps. Yeah, things like units seen and visibility flags only work for AI players. I should have thought of that but that is why it can be so useful to have a second set of eyes on a problem.
There's just so many things which are broken I just assumed this one was in the same pile.