# Set Unit Behavior Spawn Count
Flags —
Native
|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
— Unitstring
<gamelink::Behavior> — Behaviorint
— Count
Returns — void
native void UnitBehaviorSpawn(
unit inUnit,
string inBehavior,
int inCount,
);
# Related
Category: Behavior / Basic
- Remove Behaviors By Category —
void
— UnitBehaviorRemoveCategory - Remove Behavior (Player) —
void
— UnitBehaviorRemovePlayer - Remove Behavior —
void
— UnitBehaviorRemove - Add Behavior (Player) —
void
— UnitBehaviorAddPlayer - Add Behavior —
void
— UnitBehaviorAdd - Set Behavior Count —
void
— libNtve_gf_SetBehaviorCount - Number Of Behaviors On Unit —
int
— UnitBehaviorCountAll - Unit Behavior —
string
<gamelink::Behavior> — UnitBehaviorGet - Unit Has Behavior —
bool
— UnitHasBehavior2 - Unit Has Behavior (Enabled) —
bool
— UnitHasBehavior - Unit Behavior Enabled —
bool
— UnitBehaviorEnabled - Stack Count Of Behavior On Unit —
int
— UnitBehaviorCount - Behavior Has Flag —
bool
— UnitBehaviorHasFlag - Transfer Behavior —
void
— UnitBehaviorTransfer - Set Unit Behavior Duration —
void
— UnitBehaviorSetDuration - Set Unit Behavior Duration Remaining —
void
— UnitBehaviorSetDurationRemaining - Duration Remaining Of Behavior On Unit —
fixed
— UnitBehaviorDuration - Duration Of Behavior On Unit —
fixed
— UnitBehaviorDurationTotal - Set Unit Behavior Spawn Count —
void
— UnitBehaviorSpawn - Unit Behavior Effect Player —
int
— UnitBehaviorEffectPlayer - Unit Behavior Effect Unit —
unit
— UnitBehaviorEffectUnit - Set Unit Behavior User Data —
void
— UnitBehaviorEffectTreeSetUserData - User Data Of Behavior On Unit —
fixed
— UnitBehaviorEffectTreeUserData - User Data Of Behavior On Unit Exists —
bool
— UnitBehaviorEffectTreeUserDataExists - Unit Behavior Changes —
void
— TriggerAddEventUnitBehaviorChange - Unit Behavior Changes From Category —
void
— TriggerAddEventUnitBehaviorChangeFromCategory - Triggering Behavior —
string
<gamelink::Behavior> — EventUnitBehavior - Triggering Behavior Change —
int
<preset::BehaviorChange> — EventUnitBehaviorChange - Unit Behavior Damage Modify Remaining —
fixed
— UnitBehaviorDamageModifyRemaining - Unit Behavior Damage Modify Limit —
fixed
— UnitBehaviorDamageModifyLimit - For Each Behavior On Unit — macro
# Examples
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:4037
// Automatic Variable Declarations
// Implementation
UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:3600
// Automatic Variable Declarations
// Implementation
UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCMI.galaxy:3727
void libNCMI_gf_SpawnLarvaForHatchery (unit lp_hatchery, int lp_larvaCount) {
// Implementation
UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:11560
// Automatic Variable Declarations
// Implementation
UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}
mods/voidprologue.sc2mod — base.sc2data/LibA3DDD02B.galaxy:2817
// Automatic Variable Declarations
// Implementation
UnitBehaviorSpawn(lp_hatchery, "SpawnLarva", lp_larvaCount);
}