Skip to content

EUD Tutorial: Creating uncreatable units

Ar3sgice edited this page Sep 16, 2020 · 3 revisions

Uncreatable units

Normally, some units are available in SCMDraft but cannot be created via triggers.

Example: Aldaris, Vespene Orb, Dark Swarm, Start Location.

How to solve the problem

Set the "StarEdit Availability Flags" for the unit. Set flag 0x02 "Unit Listing & Palette" to allow creation.

Masked MemoryAddr(6690500, Set To, 2, 2); // Start Location; set mask = value to only change that flag.
Create Unit("Player 1", "Start Location", 1, "Anywhere");

Note that some units still cannot be created after setting this, for example Scarabs and Interceptors.

Mineral Fields and Vespene Geyser are also special that they always become player 12 when created.

Creating buildings off terrain boundaries

Set its "Building Dimensions" to 31x31. For example, for Photon Cannon:

MemoryAddr(6695656, Set To, 2031647);
Create Unit("Player 1", "Protoss Photon Cannon", 1, "Anywhere");

This will create the Photon Cannon even if the terrain is unplaceable for buildings or if some units occupy the place.

Creating units with a different color

Create the unit for another player with the color, then edit its CUnit Player ID back to the correct player.

Create Unit("Player 3", "Protoss Probe", 1, "create");
Masked MemoryAddr(0x00622d94, Set To, 0, 0x000000ff); // Predicted CUnit offset = 0x622D48 #1634

This will create a teal (player 3 color) probe for player 1.

This is written in Pure EUD for simplicity. To predict the CUnit address for next created unit, you should use a variable with SetNextUnitPtr in EUD Editor 3.