sman1975
Emperor
Hello,
I'm working on a scenario and I need to write a very "hands on" function to control an AI team to get them to place their units at certain parts of the map as the scenario progresses.
The code in use is something like this:
Where targets X & Y represent the objective - and these values change during the course of the scenario.
About half the time, it works beautifully, and the units move like the AI has some, uh, I....
The other half of the time, about half of the units behave well, and the other half go on some kind of odd scavenger hunt on the other/wrong side of the map.
I've read a lot about "operations" the AI uses to template things it would like to do; then it "assigns" units to those templates, then moves them accordingly.
From my observations, on the "bad" games, the AI uses 2 templates, one of which follows my pushmissions, the other template is based on something it felt was important to do....
Question - is there any LUA method, etc., that can be used to directly "kill" these templates at game start, or somehow remove units from them?
Or somehow make the pushmission more persuasive 100% of the time.
Thanks!
sman
I'm working on a scenario and I need to write a very "hands on" function to control an AI team to get them to place their units at certain parts of the map as the scenario progresses.
The code in use is something like this:
Code:
for pUnit in player:Units() do -- Cycle through all player's units
pUnit:PopMission() -- Clear previous mission (sometimes....)
pUnit:PushMission(MissionTypes.MISSION_MOVE_TO, targetX, targetY, 8, 0, 1) -- Move to target X & Y - Flage = 8 (ignore danger)
end
Where targets X & Y represent the objective - and these values change during the course of the scenario.
About half the time, it works beautifully, and the units move like the AI has some, uh, I....
The other half of the time, about half of the units behave well, and the other half go on some kind of odd scavenger hunt on the other/wrong side of the map.

I've read a lot about "operations" the AI uses to template things it would like to do; then it "assigns" units to those templates, then moves them accordingly.
From my observations, on the "bad" games, the AI uses 2 templates, one of which follows my pushmissions, the other template is based on something it felt was important to do....
Question - is there any LUA method, etc., that can be used to directly "kill" these templates at game start, or somehow remove units from them?
Or somehow make the pushmission more persuasive 100% of the time.
Thanks!
sman