# Set Unit Behavior Spawn Count

FlagsNative | Action

Modifies the number of spawned units controlled by a behavior. If a behavior is not specified, it will affect all spawned behaviors.

# Arguments

  • unit — Unit
  • string<gamelink::Behavior> — Behavior
  • int — Count

Returns — void

native void UnitBehaviorSpawn(
	unit inUnit,
	string inBehavior,
	int inCount,
);

Category: Behavior / Basic

# Examples

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:4037

    // Automatic Variable Declarations
    // Implementation
    UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3600

    // Automatic Variable Declarations
    // Implementation
    UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:3727

void libNCMI_gf_SpawnLarvaForHatchery (unit lp_hatchery, int lp_larvaCount) {
    // Implementation
    UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}

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

    // Automatic Variable Declarations
    // Implementation
    UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:2817

    // Automatic Variable Declarations
    // Implementation
    UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}