1 [
EntityEditorProps(
category:
"GameScripted/FastTravel", description:
"Handles client > server communication for Fast travel in Conflict. Should be attached to PlayerController.")]
5 protected int m_iSupplyCost;
7 [
Attribute(
"100",
desc:
"Tolerance when player identifies their location in the map (meters)",
params:
"0 inf 1")]
8 protected int m_iPickupRadius;
10 [
Attribute(
"200",
desc:
"If there are enemies closer that this distance to the player, the request will fail",
params:
"0 inf 1")]
11 protected int m_iNoEnemyRadius;
24 return m_iPickupRadius;
29 int GetNoEnemyRadius()
31 return m_iNoEnemyRadius;
35 class SCR_CampaignFastTravelComponent : SCR_FastTravelComponent
46 protected ref map<SCR_SelectionMenuEntry, SCR_DeployableSpawnPoint>
m_mMenuEntries =
new map<SCR_SelectionMenuEntry, SCR_DeployableSpawnPoint>();
51 if (!super.ServerSanityCheck(target))
54 SCR_ChimeraCharacter player = SCR_ChimeraCharacter.Cast(
m_PlayerController.GetControlledEntity());
68 GetGame().GetWorld().QueryEntitiesBySphere(player.GetOrigin(), componentData.GetNoEnemyRadius(),
ProcessEntity,
FilterEntity, EQueryEntitiesFlags.DYNAMIC | EQueryEntitiesFlags.WITH_OBJECT);
77 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
80 super.RpcAsk_FastTravel(destinationId);
96 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
104 if (spawnpoint.GetRespawnCount() >= spawnpoint.GetMaxRespawns())
111 [
RplRpc(RplChannel.Reliable, RplRcver.Owner)]
124 entry.SetName(
"#AR-MapMarker_DeployedRadio");
132 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
148 return SCR_ChimeraCharacter.Cast(ent) !=
null;
154 SCR_ChimeraCharacter
char = SCR_ChimeraCharacter.Cast(ent);
155 Faction entityFaction =
char.GetFaction();
196 SCR_HintManagerComponent.HideHint();
199 SCR_NotificationsComponent.SendLocal(
ENotification.FASTTRAVEL_PLAYER_LOCATION_CANCELLED);
219 SCR_CampaignFeedbackComponent feedbackComp = SCR_CampaignFeedbackComponent.GetInstance();
222 feedbackComp.ShowHint(
EHint.CONFLICT_TRANSPORT_PICKUP,
true,
true);
235 SCR_HintManagerComponent.HideHint();
257 if (player && mapEntity.IsOpen())
262 comp.RemoveHeldGadget();
266 mapEntity.ScreenToWorld(coords[0], coords[2], x, y);
270 if (vector.DistanceXZ(player.GetOrigin(), coords) > componentData.GetPickupRadius())
273 SCR_NotificationsComponent.SendLocal(
ENotification.FASTTRAVEL_PLAYER_LOCATION_WRONG);
291 m_MainEntry.SetIconFromDeafaultImageSet(
"terrainIcon");
314 WorldTimestamp timestamp = world.GetServerTimestamp();
321 SCR_ChimeraCharacter player = SCR_ChimeraCharacter.Cast(
m_PlayerController.GetControlledEntity());
326 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
329 if (player.IsInVehicle())
345 EquipedLoadoutStorageComponent loadoutStorage = EquipedLoadoutStorageComponent.Cast(player.FindComponent(EquipedLoadoutStorageComponent));
351 if (backpack && BaseRadioComponent.Cast(backpack.FindComponent(BaseRadioComponent)))
354 m_MainEntry.SetName(
"#AR-ArsenalItemType_RadioBackpack_Name");
359 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(player);
361 if (resourceComponent)
371 if (campaign && !campaign.GetBaseManager().IsEntityInFactionRadioSignal(player, player.GetFaction()))
397 if (!mapEntity || !mapEntity.IsOpen())
400 vector spawnpointPos = spawnpoint.GetOrigin();
402 mapEntity.WorldToScreen(spawnpointPos[0], spawnpointPos[2], x, y);
403 mapEntity.PanSmooth(x, y);
409 array<SCR_SpawnPoint> spawnpoints =
SCR_SpawnPoint.GetSpawnPoints();
417 if (!radioSpawnpoint || !radioSpawnpoint.IsSpawnPointVisibleForPlayer(playerId))
422 newEntry.SetIconFromDeafaultImageSet(
"VON_radio");
423 newEntry.SetName(
"#AR-DeployMenu_DisabledSpawnPointReason_OutOfRespawns");
424 newEntry.Enable(
false);
437 if (!radioSpawnpoint)
448 WorldTimestamp timestamp = world.GetServerTimestamp();
466 m_MainEntry.SetNameTo(TextWidget.Cast(radialRoot.FindAnyWidget(
"InfoName")));
499 module.ToggleFastTravelDestinationSelection(enable);
520 if (destination == vector.Zero)
529 super.EOnInit(owner);