ivory, I have no problem looking at an example if you have one but I have no time to meddle with an ai file. Too much time needed to test gameplay.
yeah, harvesters are definitely doable in spring with lua, I am not sure how efficient it would be though. My concern would be their detection of what ore field they should go and mine.
Economy via LUA!
Moderator: Moderators
not so much..
unit sees a return depot, player clicks to drive to harvest area, unit begins harvesting... loads up... looks for harvest plant.... drives to proximity of harvest plant... lua takes resources, unit paths back to harvest spot. If the harvest spot is now empty it waits for new orders. Lua can issue move commands iirc.
unit sees a return depot, player clicks to drive to harvest area, unit begins harvesting... loads up... looks for harvest plant.... drives to proximity of harvest plant... lua takes resources, unit paths back to harvest spot. If the harvest spot is now empty it waits for new orders. Lua can issue move commands iirc.
You could define a maximum search distance, that would fix most problems. I'm pretty sure that's how the craft and CnC series games do it - define a radius around the location of the last reclaim order. If there are resources in that radius, go get them, if none are left, wait at the base for a new order.