All I want is one unit...

Post Reply
psycore
Posts: 8
Joined: Wed Feb 18, 2009 5:40 am

All I want is one unit...

Post 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?
Meelo
Posts: 9
Joined: Sat Apr 25, 2009 11:10 pm

Post by Meelo »

I think it gives you a free grunt at the start of the game, regardless of if you built it or not.
Post Reply