I am giving a try in Slic writting. My first slic was to add the rush improvements using Entrench order for a new kind of Special Unit: The Worker.
I want to know if its correct and bug free.
My biggest problemcomes when i wanted to make the AI to knows how to use it. But the best i could do was make the unit finish improvent as it goes over tiles for the AI.
There is some function to trigger the code if the tile has an unfinished imp? Can someone help me with this issue?
I want to make the AI always entrench if this units pass by an tile with unfinished imp.
I want to know if its correct and bug free.
Code:
HandleEvent(EntrenchOrder) 'FinishImprovementsOrder' pre { unit_t tmpUnit; GetUnitFromArmy(army[0], i, tmpUnit); unit[0] = tmpUnit; if ((unit[0].type == UnitDB(UNIT_WORKER))) { FinishImprovements(unit[0].location); } }
There is some function to trigger the code if the tile has an unfinished imp? Can someone help me with this issue?
I want to make the AI always entrench if this units pass by an tile with unfinished imp.
Code:
HandleEvent(MoveToOrder) 'AIUsingFinishImprovement' post { unit_t tmpUnit; if(!=IsHumanPlayer(player[0])){ GetUnitFromArmy(army[0], i, tmpUnit); unit[0] = tmpUnit; if ((unit[0].type == UnitDB(UNIT_WORKER))) { FinishImprovements(unit[0].location); } } }
Comment