All I want is one unit...
Posted: Tue Jun 15, 2010 4:51 pm
Hi,
for testing some stuff I tried to make a bot that just creates one unit and does nothing else. I feel like a noob for not being able to do that. Here's what I got:
Why does this thing create two units?
for testing some stuff I tried to make a bot that just creates one unit and does nothing else. I feel like a noob for not being able to do that. Here's what I got:
Code: Select all
public class doNothing {
public int orderType = 2;
private boolean notBuilt=true;
public Object think(double dx, double dy, double x, double y, boolean moving, int terrain,
int ourID, int ourType, double hp, double maxHP, double range, double time,
double[] objX, double[] objY, int[] objID, int[] objFaction, int[] objType, int[][] incomingRadio) {
return this;
}
public int build(double dx, double dy, double x, double y, int terrain, int id, int buildItem,
double hp, double maxHP, double time,
double[] objX, double[] objY, int[] objID, int[] objFaction, int[] objType, int[][] incomingRadio) {
if(notBuilt) {
notBuilt = false;
return 1;
}
return 0;
}
}