CNC-TD AI doesn't use Engineer correctly

Engineers brew

Information and discussion for custom maps and mods.
Post Reply
Bard
Posts: 1
Joined: Thu Feb 05, 2015 9:44 pm

CNC-TD AI doesn't use Engineer correctly

Post by Bard »

Hello all! I wanted to make a couple AI's that engineer rushed, but they don't seem to use them correctly. They squad up with infantry units, but they just sit outside buildings pretending they have a weapon. Does anyone know if there is a way to code in special behaviors for them? I can't find the AI behavior file, or is it Hardcoded?

Side note: Engineer and Commando aren't in any of the Default AI build ques

Engineer is "E6"
Commando is "RMBO"

If you add those and a % they will produce those units :D
Matt
Posts: 1164
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

BenjaminLSR
Posts: 43
Joined: Sun May 22, 2011 3:26 pm

Post by BenjaminLSR »

Well, I had this brutally working on my HackyAI. And that was dangerous as **** :)

Code: Select all

if (unit.Info.Name == "e6")
                {
                    var capture = world.FindUnitsInCircle(unit.CenterLocation, Game.CellSize * 6).Where(a1 => !a1.Destroyed && !a1.IsDead() && a1.HasTrait<ITargetable>() && a1.HasTrait<Capturable>() && unit.Owner.Stances[a1.Owner] == Stance.Enemy);

                    if (!capture.Any())
                        continue;

                    var t_capture = capture.ClosestTo(unit.CenterLocation);

                    if (t_capture == null)
                        continue;

                    world.IssueOrder(new Order("CaptureActor", unit, false) { TargetActor = t_capture });
                }
Post Reply