Author Topic: Built-in Ai?!  (Read 1657 times)

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3237
Built-in Ai?!
« on: May 22, 2009, 01:25:05 PM »
If you transfer a combat vehicle to an AI player, some sort of primitive AI kicks in and sends that vehicle off to attack enemies.

Sample code:
Code: [Select]
Player[1].GoAI();

Unit Unit1;

TethysGame::CreateUnit(Unit1, mapCommandCenter, LOCATION(60, 30), 0, mapNone, 0);

TethysGame::CreateUnit(Unit1, mapLynx, LOCATION(40, 5), 6, mapRPG, 0);
Unit1.DoSetLights(1);
Unit1.DoTransfer(1);

It doesn't matter where you create the units, of course, though you should try to keep some distance between the AI unit and the target so you can see what I mean.

If you transfer a non-combat vehicle (well, to be fair, I only tried Cargo Trucks) it just kinda moves off to a (seemingly) random place on the map (though it was always around the same area).  Transferring structures seemed to have no effect.

Could this be anything significant?  A hint of an actual AI that Dynamix may have been working on?  Probably not, I just thought it was interesting and worth mentioning.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials