# Transport Of Unit
Grammar — Transport that unit is in
Flags —Native
|Function
Returns the transport a unit is in.
# Arguments
unit
— Unit
Returns — unit
native unit UnitTransport(unit inUnit);
# Related
Category: Unit / Cargo
- Put Unit InTransport —
void
— UnitPutInTransport - Create Cargo Units —
void
— UnitCargoCreate - Last Created Cargo Unit —
unit
— UnitCargoLastCreated - Last Created Cargo Units —
unitgroup
— UnitCargoLastCreatedGroup - Unit Is Cargo —
bool
— libNtve_gf_UnitIsInsideTransport - Unit Is Inside Unit Transport —
bool
— libNtve_gf_UnitIsInsideUnitTransport - Unit Is Inside Player Transport —
bool
— libNtve_gf_UnitIsInsidePlayerTransport - Cargo Unit In Transport —
unit
— UnitCargo - Cargo Units In Transport —
unitgroup
— UnitCargoGroup - Transport Property Of Unit —
int
— UnitCargoValue - Transport Of Unit —
unit
— UnitTransport - Unit Loads/Unloads Cargo —
void
— TriggerAddEventUnitCargo - Triggering Cargo Unit —
unit
— EventUnitCargo
# Examples
campaigns/void.sc2campaign — base.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.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.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.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 {
mods/heroesdata.stormmod — base.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.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:16175
lv_unit = EventUnit();
lv_player = UnitGetOwner(lv_unit);
lv_ownerOfTransport = UnitGetOwner(UnitTransport(lv_unit));
lv_triggeringBehavior = EventUnitBehavior();
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:16201
if ((libNtve_gf_UnitIsInsideTransport(lv_heroUnit) == true)) {
lv_heroUnit = UnitTransport(libGame_gv_players[lv_player].lv_heroUnit);
}
mods/heroesdata.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.stormdata/LibHDVA.galaxy:446
}
else {
lv_mechUnit = UnitTransport(lv_pilotUnit);
if ((UnitGetType(lv_mechUnit) == "HeroDVaMech")) {
return lv_mechUnit;
mods/heromods/dva.stormmod — base.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.stormmod — base.stormdata/LibHDVA.galaxy:1707
}
UnitBehaviorAdd(UnitTransport(lv_dVaPilot), EventUnitBehavior(), lv_dVaPilot, 1);
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:22249
// Variable Initialization
lv_siegetank = EventPlayerEffectUsedUnit(c_effectUnitCaster);
lv_medivac = UnitTransport(lv_siegetank);
lv_statusframe = c_invalidDialogControlId;