# Transport Of Unit

Grammar — Transport that unit is in
FlagsNative | Function

Returns the transport a unit is in.

# Arguments

  • unit — Unit

Returns — unit

native unit UnitTransport(unit inUnit);

Category: Unit / Cargo

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pkorhal02.sc2map/MapScript.galaxy:1879

            if (auto1D1ECC95_var == null) { break; }
            if ((libNtve_gf_UnitIsInsideTransport(auto1D1ECC95_var) == true)) {
                lv_homePosition = PointWithOffsetPolar(UnitGetPosition(UnitTransport(auto1D1ECC95_var)), 1.0, (UnitCargoValue(auto1D1ECC95_var, c_unitCargoPosition) * (360 / UnitCargoValue(UnitTransport(auto1D1ECC95_var), c_unitCargoUnitCount))));
            }
            else {

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pkorhal02.sc2map/MapScript.galaxy:1879

            if (auto1D1ECC95_var == null) { break; }
            if ((libNtve_gf_UnitIsInsideTransport(auto1D1ECC95_var) == true)) {
                lv_homePosition = PointWithOffsetPolar(UnitGetPosition(UnitTransport(auto1D1ECC95_var)), 1.0, (UnitCargoValue(auto1D1ECC95_var, c_unitCargoPosition) * (360 / UnitCargoValue(UnitTransport(auto1D1ECC95_var), c_unitCargoUnitCount))));
            }
            else {

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pkorhal02.sc2mapMapScript.galaxy:1879

            if (auto1D1ECC95_var == null) { break; }
            if ((libNtve_gf_UnitIsInsideTransport(auto1D1ECC95_var) == true)) {
                lv_homePosition = PointWithOffsetPolar(UnitGetPosition(UnitTransport(auto1D1ECC95_var)), 1.0, (UnitCargoValue(auto1D1ECC95_var, c_unitCargoPosition) * (360 / UnitCargoValue(UnitTransport(auto1D1ECC95_var), c_unitCargoUnitCount))));
            }
            else {

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pkorhal02.sc2mapMapScript.galaxy:1879

            if (auto1D1ECC95_var == null) { break; }
            if ((libNtve_gf_UnitIsInsideTransport(auto1D1ECC95_var) == true)) {
                lv_homePosition = PointWithOffsetPolar(UnitGetPosition(UnitTransport(auto1D1ECC95_var)), 1.0, (UnitCargoValue(auto1D1ECC95_var, c_unitCargoPosition) * (360 / UnitCargoValue(UnitTransport(auto1D1ECC95_var), c_unitCargoUnitCount))));
            }
            else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:16118


    if ((libNtve_gf_UnitIsInsideTransport(libGame_gv_players[lv_cargoPlayer].lv_heroUnit) == true)) {
        libGame_gv_players[lv_cargoPlayer].lv_cameraPlayerUnitGroupToFocusOn = libNtve_gf_ConvertUnitToUnitGroup(UnitTransport(libGame_gv_players[lv_cargoPlayer].lv_heroUnit));
        libGame_gf_CameraUpdateCameraForPlayer(lv_cargoPlayer);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:16175

    lv_unit = EventUnit();
    lv_player = UnitGetOwner(lv_unit);
    lv_ownerOfTransport = UnitGetOwner(UnitTransport(lv_unit));
    lv_triggeringBehavior = EventUnitBehavior();

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:16201


            if ((libNtve_gf_UnitIsInsideTransport(lv_heroUnit) == true)) {
                lv_heroUnit = UnitTransport(libGame_gv_players[lv_player].lv_heroUnit);
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:21199


    if ((libNtve_gf_UnitIsInsideTransport(libGame_gv_players[lv_player].lv_heroUnit) == true)) {
        libUIUI_gf_UIHeroConsoleSetUpForPlayer(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
        libUIUI_gf_HeroConsoleUnitStatusBarsSetUnitForBars(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:21200

    if ((libNtve_gf_UnitIsInsideTransport(libGame_gv_players[lv_player].lv_heroUnit) == true)) {
        libUIUI_gf_UIHeroConsoleSetUpForPlayer(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
        libUIUI_gf_HeroConsoleUnitStatusBarsSetUnitForBars(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
    }
    else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:21256


            if ((libNtve_gf_UnitIsInsideTransport(libGame_gv_players[lv_player].lv_heroUnit) == true)) {
                libUIUI_gf_UIHeroConsoleSetUpForPlayer(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
                libUIUI_gf_HeroConsoleUnitStatusBarsSetUnitForBars(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:21257

            if ((libNtve_gf_UnitIsInsideTransport(libGame_gv_players[lv_player].lv_heroUnit) == true)) {
                libUIUI_gf_UIHeroConsoleSetUpForPlayer(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
                libUIUI_gf_HeroConsoleUnitStatusBarsSetUnitForBars(UnitTransport(libGame_gv_players[lv_player].lv_heroUnit), lv_player);
            }
            else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:7111


    if ((libNtve_gf_UnitIsInsideTransport(lv_targetUnit) == true)) {
        lv_transportUnit = UnitTransport(lv_targetUnit);
        while ((UnitIsValid(UnitTransport(lv_transportUnit)) == true)) {
            lv_transportUnit = UnitTransport(lv_transportUnit);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:7112

    if ((libNtve_gf_UnitIsInsideTransport(lv_targetUnit) == true)) {
        lv_transportUnit = UnitTransport(lv_targetUnit);
        while ((UnitIsValid(UnitTransport(lv_transportUnit)) == true)) {
            lv_transportUnit = UnitTransport(lv_transportUnit);
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:7113

        lv_transportUnit = UnitTransport(lv_targetUnit);
        while ((UnitIsValid(UnitTransport(lv_transportUnit)) == true)) {
            lv_transportUnit = UnitTransport(lv_transportUnit);
        }
        if ((libNtve_gf_UnitIsVisibleToPlayer(lv_transportUnit, lp_pingingPlayer) == true)) {

mods/heromods/chogall.stormmodbase.stormdata/LibHCHO.galaxy:2554

    lv_choGallPairsTeam = libGame_gf_TeamNumberOfPlayer(libGame_gf_HeroEnteredTransportPlayerEntering());
    UnitBehaviorAdd(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "ChogallGallSilence", libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, 1);
    libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallFollowUnit = UnitTransport(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_choUnit);
    return true;
}

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:425

    }
    else {
        libNtve_gf_SetDialogItemUnit(lv_playerPartyFrameDialog, UnitTransport(libGame_gv_players[lp_dVaPlayer].lv_heroUnit), PlayerGroupActive());
        libNtve_gf_SetDialogItemUnit(libUIUI_gv_uIPartyFrame.lv_heroPartyButton[libUIUI_gf_UIPartyFrameUIIndexofHeroUnit(libGame_gv_players[lp_dVaPlayer].lv_heroUnit, lp_dVaPlayer)], UnitTransport(libGame_gv_players[lp_dVaPlayer].lv_heroUnit), PlayerGroupAll());
        libUIUI_gf_UIPartyFrameSetDVaFrame(lp_dVaPlayer, true);

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:426

    else {
        libNtve_gf_SetDialogItemUnit(lv_playerPartyFrameDialog, UnitTransport(libGame_gv_players[lp_dVaPlayer].lv_heroUnit), PlayerGroupActive());
        libNtve_gf_SetDialogItemUnit(libUIUI_gv_uIPartyFrame.lv_heroPartyButton[libUIUI_gf_UIPartyFrameUIIndexofHeroUnit(libGame_gv_players[lp_dVaPlayer].lv_heroUnit, lp_dVaPlayer)], UnitTransport(libGame_gv_players[lp_dVaPlayer].lv_heroUnit), PlayerGroupAll());
        libUIUI_gf_UIPartyFrameSetDVaFrame(lp_dVaPlayer, true);
    }

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:446

        }
        else {
            lv_mechUnit = UnitTransport(lv_pilotUnit);
            if ((UnitGetType(lv_mechUnit) == "HeroDVaMech")) {
                return lv_mechUnit;

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:1259

    lv_dVaPlayer = EventPlayer();
    lv_dVaPilotUnit = libGame_gv_players[lv_dVaPlayer].lv_heroUnit;
    lv_dVaMechUnit = UnitTransport(lv_dVaPilotUnit);

    // Actions

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:1707

    }

    UnitBehaviorAdd(UnitTransport(lv_dVaPilot), EventUnitBehavior(), lv_dVaPilot, 1);
    return true;
}

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

    // Variable Initialization
    lv_siegetank = EventPlayerEffectUsedUnit(c_effectUnitCaster);
    lv_medivac = UnitTransport(lv_siegetank);
    lv_statusframe = c_invalidDialogControlId;