defines.command.compound
structure_type :: defines.compound_command: How the commands should be chained together.
commands :: array of Command: The sub-commands.
Not too sure what is the structure_type is:
{ defines.command.compound, defines.compound_command.logical_and, ... , ...}
or
{defines.command.compound, defines.compound_command.logical_and, { {...} , {...} } }
ie move to multiple rally points then build a base without being distracted as an example
set_multi_command{command=…, unit_count=…, force=…, unit_search_distance=…} → uint
Code: Select all
surface.set_multi_command{ {defines.command.compound,
defines.compound_command.return_last ,
{defines.command.go_to_location, {x = 50, y = 20}, defines.distraction.none} ,
{defines.command.go_to_location, {x = 60, y = 20}, defines.distraction.none} ,
{defines.command.go_to_location, {x = 70, y = 20}, defines.distraction.none} ,
{defines.command.go_to_location, {x = 80, y = 20}, defines.distraction.none} ,
{defines.command.build_base, {x = 80, y = 20}, defines.distraction.none} },
10,
"enemy",
32}
Code: Select all
surface.set_multi_command{ defines.command.compound,
defines.compound_command.return_last ,
{ {defines.command.go_to_location, {x = 50, y = 20}, defines.distraction.none} ,
{defines.command.go_to_location, {x = 60, y = 20}, defines.distraction.none} ,
{defines.command.go_to_location, {x = 70, y = 20}, defines.distraction.none} ,
{defines.command.go_to_location, {x = 80, y = 20}, defines.distraction.none} ,
{defines.command.build_base, {x = 80, y = 20}, defines.distraction.none} },
10,
"enemy",
32}
Or something else, just not too sure on structure. Notice the extra brackets on the 2nd example.