# Set Starting Units For Player

Grammar — Create race melee starting units for player player at position
FlagsNative | Action

Creates the starting units and structures for the specified player and race.

# Arguments

  • int — Player
  • string<gamelink::Race> — Race
  • point — Position

Returns — void

native void MeleeInitUnitsForPlayer(
	int player,
	string race,
	point position,
);

Category: Melee / Player Settings

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:7601

    }

    MeleeInitUnitsForPlayer(lp_player, libCOOC_gf_CC_CommanderSpawnRace(libCOOC_gf_ActiveCommanderForPlayer(lp_player)), PlayerStartLocation(lp_player));
    if ((lv_larvaCount > 0)) {
        auto15C64F69_g = UnitGroup(lv_townHallType, lp_player, RegionCircle(PlayerStartLocation(lp_player), 5.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:2153

        lv_startingPlayer = PlayerGroupNextPlayer(autoD5159E03_g, lv_startingPlayer);
        if (lv_startingPlayer < 0) { break; }
        MeleeInitUnitsForPlayer(lv_startingPlayer, UserDataGetGameLink("PlayableLegends", libWCdr_gf_GetLegendInstanceForPlayer(lv_startingPlayer), "RaceStartingUnits", 1), PlayerStartLocation(lv_startingPlayer));
    }
}