# Set Target Escort For Attack Waves, No Leashing

Grammar — Set the target for player player attack waves to be escorting unit group escortGroup|UnitGroup with replace behavior replaceType. This version is without leashing.
FlagsNative | Action

Sets the target of a player’s attack waves to escort a unit group. The escorts will not break combat and return to their charge should they become seperated.

# Arguments

  • int — Attacker
  • unitgroup — EscortGroup
  • int<preset::ReplaceType> — ReplaceType

Returns — void

native void AIAttackWaveSetTargetEscortNL(
	int player,
	unitgroup g,
	int replaceType,
);

Category: AI / AttackWaves / Actions

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:329

    autoD1A8BB6F_val = gv_protossThreatLevel;
    if (autoD1A8BB6F_val == 1) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:332

        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(1, 1, 2, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:343

    }
    else if (autoD1A8BB6F_val == 2) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:346

        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:357

    }
    else if (autoD1A8BB6F_val == 3) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(0, 0, 1, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:360

        AIAttackWaveAddUnits4(0, 0, 1, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:378

    }
    else if (autoD1A8BB6F_val == 4) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:381

        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:400

    }
    else if (autoD1A8BB6F_val == 5) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(2, 2, 3, 3, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttosh02.sc2map/MapScript.galaxy:403

        AIAttackWaveAddUnits4(2, 2, 3, 3, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 4);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:329

    autoD1A8BB6F_val = gv_protossThreatLevel;
    if (autoD1A8BB6F_val == 1) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:332

        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(1, 1, 2, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:343

    }
    else if (autoD1A8BB6F_val == 2) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:346

        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:357

    }
    else if (autoD1A8BB6F_val == 3) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(0, 0, 1, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:360

        AIAttackWaveAddUnits4(0, 0, 1, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:378

    }
    else if (autoD1A8BB6F_val == 4) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:381

        AIAttackWaveAddUnits4(1, 1, 2, 2, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 3);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:400

    }
    else if (autoD1A8BB6F_val == 5) {
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        AIAttackWaveAddUnits4(2, 2, 3, 3, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh02.sc2mapMapScript.galaxy:403

        AIAttackWaveAddUnits4(2, 2, 3, 3, "Stalker");
        AIAttackWaveSend(gv_p4_PROTOSS_WEST_ESCORTS, 0, false);
        AIAttackWaveSetTargetEscortNL(gv_p4_PROTOSS_WEST_ESCORTS, libNtve_gf_ConvertUnitToUnitGroup(lv_harvestingProbe), 0);
        lv_escortCount = libNtve_gf_DifficultyValueInt(2, 2, 3, 4);
        lv_offsetAngle = gf_CalculateOffset(IntToFixed(lv_escortCount));

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/ptaldarim02.sc2map/MapScript.galaxy:3000

    }

    AIAttackWaveSetTargetEscortNL(gv_pLAYER_02_TALDARIM, libNtve_gf_ConvertUnitToUnitGroup(gv_tugOfWarEscortTargetUnit), 0);
    AIAttackWaveSetGatherPoint(gv_pLAYER_02_TALDARIM, RegionGetCenter(gf_GetWarpInRegion()));
    if ((gv_waveGroupIndex < gv_waveGroupUBound)) {

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/ptaldarim02.sc2map/MapScript.galaxy:3139

    }

    AIAttackWaveSetTargetEscortNL(gv_pLAYER_05_TALDARIM, libNtve_gf_ConvertUnitToUnitGroup(gv_tugOfWarEscortTargetUnit), 0);
    AIAttackWaveSetGatherPoint(gv_pLAYER_05_TALDARIM, RegionGetCenter(RegionFromId(23)));
    if ((gv_specialWaveGroupIndex < gv_specialWaveGroupUBound)) {

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ptaldarim02.sc2mapMapScript.galaxy:3000

    }

    AIAttackWaveSetTargetEscortNL(gv_pLAYER_02_TALDARIM, libNtve_gf_ConvertUnitToUnitGroup(gv_tugOfWarEscortTargetUnit), 0);
    AIAttackWaveSetGatherPoint(gv_pLAYER_02_TALDARIM, RegionGetCenter(gf_GetWarpInRegion()));
    if ((gv_waveGroupIndex < gv_waveGroupUBound)) {

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ptaldarim02.sc2mapMapScript.galaxy:3139

    }

    AIAttackWaveSetTargetEscortNL(gv_pLAYER_05_TALDARIM, libNtve_gf_ConvertUnitToUnitGroup(gv_tugOfWarEscortTargetUnit), 0);
    AIAttackWaveSetGatherPoint(gv_pLAYER_05_TALDARIM, RegionGetCenter(RegionFromId(23)));
    if ((gv_specialWaveGroupIndex < gv_specialWaveGroupUBound)) {