-
Notifications
You must be signed in to change notification settings - Fork 104
Move to Coord
This command sends free units of a specific type near to the position x, y, on the map. The units will try to reach the cell given by the coordinates, if this cell doesn’t have other units on it, otherwise, they will try to reach any adjacent cell.
MovetoCoord is a simple command used to send a specific unit, defined by the parameter <type>
, to coordinates (<x-coordinate>
,<y-coordinate>
) defined previously. MovetoCoord can be interpreted (composed) as:
In commands like that, when you need to define coordinates, keep in mind how the coordinates are defined in the MicroRTS. The picture below shows an example in a map of size 8x8.
Used in a Loop (For)
MovetoCoord can be used inside of the for structure by adding a <unit>
parameter into the parameter list. It changes the command like the example below:
When moveToCoord receives a <unit>
as a parameter, the command will try to use the specified unit and the command will try to move this unit to the (<x-coordinate>
,<y-coordinate>
).
CommandDSL ast_example = new CommandDSL("moveToCoord(Worker,1,1)");
ast_example.translate()
--> print in Java console--> moveToCoord(Worker,1,1)
ast_example.friendly_translate()
--> print in Java console--> moveToCoord(Worker,1,1)
BuilderDSLTreeSingleton.formatedStructuredDSLTreePreOrderPrint((iNodeDSLTree) ast_example);
--> print in Java console--> c->moveToCoord(Worker,1,1)