Skip to content

General Information

Rubens de Oliveira Moraes Filho edited this page Apr 29, 2021 · 6 revisions

One important piece of information, about how the framework work, consists of script execution and how the script is executed. To explain the execution process, see this script:

harvest(1) train(Workers,100,EnemyDir) attack(Worker,closest)

This example describes a simple Worker Rush strategy. This textual presentation shown above uses the print method called translate (see Print AST for complementary information). Below, there is a code version to create the same structure using the AST scheme:

line 1. CommandDSL p1 = new CommandDSL("harvest(1)");
line 2. CommandDSL p2 = new CommandDSL("train(Worker,100,EnemyDir)");
line 3. CommandDSL p3 = new CommandDSL("attack(Worker,closest)");
line 4. CDSL C = new CDSL(p1, new CDSL(p2, new CDSL(p3)));
line 5. S1DSL root = new S1DSL(C);

The script composed in the picture above has 3 commands: Harvest, Train, and Attack. In normal conditions, these commands are executed as the scheme suggests in an 8x8 map:

Flow 1

Let's imagine a situation where the map doesn't have any resources to be harvested. The execution of the script will be as follow:

Flow 2

These two examples introduce how the scripts are executed by the framework.

Clone this wiki locally