Page 1 of 1

All I want is one unit...

Posted: Tue Jun 15, 2010 4:51 pm
by psycore
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:

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;
	}
}
Why does this thing create two units?

Posted: Sat Sep 18, 2010 11:32 pm
by Meelo
I think it gives you a free grunt at the start of the game, regardless of if you built it or not.