1[
EntityEditorProps(
category:
"GameScripted/FastTravel", description:
"Handles client > server communication for Fast travel in Conflict. Should be attached to PlayerController.")]
7 [
Attribute(
"100",
desc:
"Tolerance when player identifies their location in the map (meters)",
params:
"0 inf 1")]
10 [
Attribute(
"200",
desc:
"If there are enemies closer that this distance to the player, the request will fail",
params:
"0 inf 1")]
35class SCR_CampaignFastTravelComponent : SCR_FastTravelComponent
51 if (!super.ServerSanityCheck(target))
54 SCR_ChimeraCharacter player = SCR_ChimeraCharacter.Cast(
m_PlayerController.GetControlledEntity());
106 entry.
SetName(
"#AR-MapMarker_DeployedRadio");
114 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
130 return SCR_ChimeraCharacter.Cast(ent) != null;
136 SCR_ChimeraCharacter
char = SCR_ChimeraCharacter.Cast(ent);
137 Faction entityFaction =
char.GetFaction();
178 SCR_HintManagerComponent.HideHint();
181 SCR_NotificationsComponent.SendLocal(
ENotification.FASTTRAVEL_PLAYER_LOCATION_CANCELLED);
201 SCR_CampaignFeedbackComponent feedbackComp = SCR_CampaignFeedbackComponent.GetInstance();
204 feedbackComp.ShowHint(
EHint.CONFLICT_TRANSPORT_PICKUP,
true,
true);
217 SCR_HintManagerComponent.HideHint();
239 if (player && mapEntity.
IsOpen())
255 SCR_NotificationsComponent.SendLocal(
ENotification.FASTTRAVEL_PLAYER_LOCATION_WRONG);
273 m_MainEntry.SetIconFromDeafaultImageSet(
"terrainIcon");
303 SCR_ChimeraCharacter player = SCR_ChimeraCharacter.Cast(
m_PlayerController.GetControlledEntity());
308 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
311 if (player.IsInVehicle())
327 EquipedLoadoutStorageComponent loadoutStorage = EquipedLoadoutStorageComponent.Cast(player.FindComponent(EquipedLoadoutStorageComponent));
333 if (backpack && BaseRadioComponent.Cast(backpack.
FindComponent(BaseRadioComponent)))
336 m_MainEntry.SetName(
"#AR-ArsenalItemType_RadioBackpack_Name");
341 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(player);
343 if (resourceComponent)
353 if (campaign && !campaign.GetBaseManager().IsEntityInFactionRadioSignal(player, player.GetFaction()))
379 if (!mapEntity || !mapEntity.
IsOpen())
382 vector spawnpointPos = spawnpoint.GetOrigin();
384 mapEntity.
WorldToScreen(spawnpointPos[0], spawnpointPos[2], x, y);
391 array<SCR_SpawnPoint> spawnpoints =
SCR_SpawnPoint.GetSpawnPoints();
405 newEntry.
SetName(
"#AR-DeployMenu_DisabledSpawnPointReason_OutOfRespawns");
419 if (!radioSpawnpoint)
476 SCR_MapCursorModule module = SCR_MapCursorModule.Cast(mapEntity.
GetMapModule(SCR_MapCursorModule));
481 module.ToggleFastTravelDestinationSelection(enable);
502 if (destination ==
vector.Zero)
511 super.EOnInit(owner);
ArmaReforgerScripted GetGame()
ref array< string > coords
SCR_CharacterControllerComponent GetCharacterController()
void ComposeDestinationList()
int GetCooldown()
Reads the cooldown value from player's rank.
bool FilterEntity(IEntity ent)
void SendPlayerCoords(vector coords)
void ToggleDestinationSelection(bool enable)
ref map< SCR_SelectionMenuEntry, SCR_DeployableSpawnPoint > m_mMenuEntries
void RefreshDestinationList()
bool IsDestinationReachable(RplId id)
void CenterMapOnDestination(SCR_SelectionMenuEntry entry, int id)
void RpcAsk_CheckSpawnpointAvailability(RplId spawnpointId)
void OnSpawnpointAdded(SCR_SpawnPoint spawnpoint)
SCR_CampaignFastTravelComponentClass m_bSelectionInProgress
void RpcDo_EnableDestination(RplId spawnpointId)
void RefreshShownCooldown()
void OnSpawnpointRemoved(SCR_SpawnPoint spawnpoint)
SCR_CampaignFaction m_PlayerFaction
SCR_SelectionMenuCategoryEntry m_MainEntry
bool ProcessEntity(IEntity ent)
void SetupMapRadialMenuEntries()
void OnMapFastTravelRequested(SCR_SelectionMenuEntry element, float[] worldPos)
bool ServerSanityCheck(notnull IEntity target)
void OnMapClose(MapConfiguration config)
void OnMapOpen(MapConfiguration config)
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_CharacterSoundComponentClass GetComponentData()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void SetDestination(RplId id, string name)
Destination must be a replicated item with valid RplId.
vector CalculateDestinationVector(notnull IEntity destination)
RplId FindDestinationId(IEntity entity)
SCR_FastTravelComponentClass m_PlayerController
IEntity GetEntityByDestinationId(RplId id)
WorldTimestamp m_fNextTravelAvailableAt
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
SCR_MapRadialUI m_MapContextualMenu
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
Replication item identifier.
static SCR_GadgetManagerComponent GetGadgetManager(IEntity entity)
void RemoveHeldGadget()
Remove gadget held in hand.
SCR_MapModuleBase GetMapModule(typename moduleType)
static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapClose()
Get on map close invoker.
static ScriptInvokerVector GetOnSelection()
Get on selection invoker.
void ScreenToWorld(int screenPosX, int screenPosY, out float worldX, out float worldY)
Use scaled screen coords to get canvas world coords, flips the y-axis.
void WorldToScreen(float worldX, float worldY, out int screenPosX, out int screenPosY, bool withPan=false)
Use canvas world coords to get DPIscaled screen coords, flips the y-axis.
void PanSmooth(float panX, float panY, float panTime=0.25)
bool IsOpen()
Check if the map is opened.
static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapOpen()
Get on map open invoker.
static SCR_MapEntity GetMapInstance()
Get map entity instance.
static SCR_MapRadialUI GetInstance()
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Basically SCR_SpawnPoint with the ability to limit respawn amount.
override bool IsSpawnPointVisibleForPlayer(int pid)
Spawn point entity defines positions on which players can possibly spawn.
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
proto external bool IsDead()
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.