-
Notifications
You must be signed in to change notification settings - Fork 104
Move Once to Coord
This command sends a number of free units of a specific type to the position x, y, on the map. Once the units reach that position, the command is disabled from the script, that is, cannot be called anymore during the game.
MoveOncetoCoord works in the same method as Move to Coord, sending a specific <type>
of units to a coordinate (<x-coordinate>
,<y-coordinate>
). However, there are two new behaviors that differ this command from the other. MoveOncetoCoord sends a <quantity>
of pre-defined units to the coordinates, and when one of these units reached the coordinates, the command is disabled. It means the command will not execute any action after being disabled. MoveOncetoCoord 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)
MoveOncetoCoord 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 moveOnceToCoord receives a <unit>
as a parameter, the command will use this specific unit to set up an action for it.
CommandDSL ast_example = new CommandDSL("moveOnceToCoord(Worker,1,2,2)");
ast_example.translate()
--> print in Java console--> moveOnceToCoord(Worker,1,2,2)
ast_example.friendly_translate()
--> print in Java console--> moveOnceToCoord(Worker,1,2,2)
BuilderDSLTreeSingleton.formatedStructuredDSLTreePreOrderPrint((iNodeDSLTree) ast_example);
--> print in Java console--> c->moveOnceToCoord(Worker,1,2,2)