google-deepmind / pysc2

StarCraft II Learning Environment
Apache License 2.0
8k stars 1.15k forks source link

How to get the unit_type of the self-designed unit? #335

Closed liushunyu closed 2 years ago

liushunyu commented 2 years ago

Hello, thanks for your excellent work.

I have created an empty map and design several new units but not create the units in the map, and I want to create the new units after loading the empty map in the code as follow:

controller.debug(sc_debug.DebugCommand(
          create_unit=sc_debug.DebugCreateUnit(
              unit_type=units.Terran.Marine,
              owner=1,
              pos=sc_common.Point2D(x=map_size.x // 2, y=map_size.y // 2),
              quantity=5)))

But I don't know the unit_type of my self-designed units, how can I get it?

I have searched the whole StarCraft II map editor and didn't find this unit_type.

The most similar is the "#" column in "editor->data editor->unit tab", but the ID in this column in "#" column cannot match the unit_type used in the environment.

Hope to receive your reply. Thank you!