The first level Greenfields introduced basic sensors and actions and showed how to control a single population. With Clone War these sensors and actions will be extended. But we also have a new action, now it is possible to split a population.
Split does two things, first it splits the population into two equal sized populations and then moves the new created population to a field of your choice. Split looks the same as move_to it takes a field or position as parameter for the new population.
new_population = old_population.split(field) new_population = old_population.split(-1, 0) new_population = old_population.split(x: 1, y: 1)
As we may have multiple populations now, you need to specify the population you want to apply the action:
population_a.look_around population_b.move_to 1, 1 population_c.size population_c.resource
As you can see the new introduced action changes quite a lot. In the next blog post I will describe how some well-known actions have been extended.
For more details see the documentation.

Keine Kommentare:
Kommentar veröffentlichen