It appears you have not registered with our community. To register please click here ...
Username
Password
void CommandQueen(int player, int CTown, string StructHatch){order ord;point OTarg;unit Queen;unit nearbyHatch;region r; nearbyHatch = AIGrabUnit(player, StructHatch, c_prioScriptControlled, AIGetTownLocation (player, CTown)); Queen = AIGrabUnit(player, c_ZU_Queen, c_prioScriptControlled, AIGetTownLocation (player, CTown)); r = RegionCircle(UnitGetPosition(nearbyHatch), 4); //OTarg = UnitGetPosition(nearbyHatch); OTarg = AIRandomSpawnPoint (player, r, 50, 100, 3); ord = AICreateOrder(player, c_AB_Move, 0); OrderSetTargetPoint(ord, OTarg); if (UnitOrderIsValid(Queen, ord)) { AICast(Queen, ord, c_noMarker, c_castHold); } else {}}
if (loopTimer < 20 && loopTimer > 10 ) { //queen management prototype CommandOvie(player, c_townOne); CommandQueen(player, c_townOne, c_ZB_Lair); CommandQueen(player, c_townOne, c_ZB_Hatchery); } if (loopTimer < 10) { //queen management CommandOvie(player, c_townTwo); CommandQueen(player, c_townOne,c_ZB_Lair); } if (loopTimer < 1) { loopTimer = 20; }
Obviously, this can be developed further. And as you can see, even if c_townOne is used at both cases, the queen will still be ordered to move to c_townTwo.I have no idea what's going on with that.
OTarg = AIRandomSpawnPoint (player, r, 50, 100, 3);
void CommandQueen(int player, int CTown, string StructHatch){order ord;point OTarg;unit Queen;unit nearbyHatch;region r; nearbyHatch = AIGrabUnit(player, StructHatch, c_prioScriptControlled, AIGetTownLocation (player, CTown)); Queen = AIGrabUnit(player, c_ZU_Queen, c_prioScriptControlled, AIGetTownLocation (player, CTown)); r = RegionCircle(UnitGetPosition(nearbyHatch), IntToFixed(20)); //OTarg = UnitGetPosition(nearbyHatch); OTarg = AIGetTownLocation (player, CTown); //AIRandomSpawnPoint (player, r, 500, 1000, 3); ord = AICreateOrder(player, c_AB_Move, 0); OrderSetTargetPoint(ord, OTarg); if (UnitOrderIsValid(Queen, ord)) { AICast(Queen, ord, c_noMarker, c_castHold); } else {}}