Now I still seem to have some odd problems with it.
1) Building structures [SOLVED]
At the start of the game, I have my commander create a number of buildings. Once he finishes building one structure, I give him a new build order. I only give him build orders, no movement or otherwise. However, it seems that with the new AI, after he has finished building, he returns back to where he was when the order was given, meaning he's always returning to his spawn location whenever he builds something, and then doubling back for a new build order.
Old code:
Code: Select all
builder.build(unitDef, position, facing, opts, timeout);
Code: Select all
builder.moveTo(position, opts, timeout);
builder.build(unitDef, position, facing, opts, timeout);
So I'm mostly curious what caused the change, and how can I have the old behavior (only build orders were necessary) back?
2) Building units [SOLVED]
It does not work. I have a vehplant which is supposed to be building jeffys, flashes and construction vehicles, but it seems to simply be ignoring the commands (and I have confirmed that the vehplant is finished and can build those unitdefs, it used to work fine before).
This is code that I have tried so far:
Code: Select all
builder.build(unitDef, new AIFloat3(), facing, opts, 15);
Code: Select all
builder.build(unitDef, new AIFloat3(0, 0, 0), facing, opts, 15);
Code: Select all
builder.build(unitDef, builder.getPos(), facing, opts, 15);
Code: Select all
builder.build(unitDef, null, facing, opts, 15); //crashes
Code: Select all
[f=0026298] Warning: Waiting packet limit was reached for gajop AI #1 [packets dropped]
3) Missing command-ID constants
Usually, I'd have units work with commands, and as soon as it finished something, and caused unitIdle to trigger, I'd look at what it's completed (by commandTypeId) and then based on that send it off to do other things. While it's still possible to do that, it seems the files that had commands with their type-ids, are gone, so one would have to write down type-ids himself (42 is moving, 35 is building and so on)
Code: Select all
if (35 == commandTopicId) {...
Code: Select all
if (BuildCommand.id == commandTopicId) {...
Sure, nothing is stopping me from creating those enums myself, but I would've hoped they existed in the generated Java interface/wrappers (maybe they do already?), instead of forcing me to have an open C/C++ .h file where those are written (took me some time to find, and I'm not new to spring).