1[
EntityEditorProps(
category:
"GameScripted/Building", description:
"Handles client > server communication in Building. Should be attached to PlayerController.")]
14 RplComponent comp = RplComponent.Cast(compositionOutline.FindComponent(RplComponent));
27 RplComponent comp = RplComponent.Cast(provider.
FindComponent(RplComponent));
43 RplComponent providerRplComp = RplComponent.Cast(provider.
FindComponent(RplComponent));
48 if (!owner || playerID != owner.GetPlayerId())
57 RplComponent comp = RplComponent.Cast(provider.
FindComponent(RplComponent));
69 RplComponent rplComp = RplComponent.Cast(
Replication.FindItem(compId));
73 IEntity provider = rplComp.GetEntity();
77 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.
FindComponent(SCR_CampaignBuildingProviderComponent));
78 if (providerComponent)
79 providerComponent.SetCooldownClientLock(lock);
90 if (!compositionOutline)
93 SCR_CampaignBuildingLayoutComponent layoutComponent = SCR_CampaignBuildingLayoutComponent.Cast(compositionOutline.
FindComponent(SCR_CampaignBuildingLayoutComponent));
97 layoutComponent.AddBuildingValue(buildingValue);
111 BaseGameMode gameMode =
GetGame().GetGameMode();
113 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
114 if (!buildingManagerComponent)
117 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.
FindComponent(SCR_CampaignBuildingProviderComponent));
118 if (!providerComponent)
121 bool isActiveUser = buildingManagerComponent.RemovePlayerIdFromProvider(playerID, providerComponent);
122 buildingManagerComponent.RemoveProvider(playerID, providerComponent, isActiveUser);
136 if (!owner || playerID != owner.GetPlayerId())
143 BaseGameMode gameMode =
GetGame().GetGameMode();
144 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
145 if (!buildingManagerComponent)
148 buildingManagerComponent.EnterEditorMode(playerID, provider, UserActionActivationOnly, UserActionUsed, useAllAvailableProviders);
166 PlayerController playerController = PlayerController.Cast(
GetOwner());
174 editorManager.Close();
178 SCR_CampaignBuildingEditorComponent buildingComp = SCR_CampaignBuildingEditorComponent.Cast(modeEntity.FindComponent(SCR_CampaignBuildingEditorComponent));
181 buildingComp.SendProviders_S();
185 editorManager.Close();
196 BaseGameMode gameMode =
GetGame().GetGameMode();
200 SCR_XPHandlerComponent compXP = SCR_XPHandlerComponent.Cast(gameMode.FindComponent(SCR_XPHandlerComponent));
204 compXP.AwardXP(playerId,
SCR_EXPRewards.FREE_ROAM_BUILDING_BUILT);
220 RplComponent rplComp = RplComponent.Cast(
Replication.FindItem(rplProviderId));
224 return rplComp.GetEntity();
ArmaReforgerScripted GetGame()
void AddBuildingValue(int value)
void RpcAsk_AddXPReward(int playerId)
void RpcAsk_RequestEnterBuildingMode(RplId rplProviderId, int playerID, bool UserActionActivationOnly, bool UserActionUsed, bool useAllAvailableProviders)
void RpcDo_SetClientLock(bool lock, RplId compId)
Set a cooldown lock on client.
void RpcAsk_RemoveEditorMode(int playerID, RplId compId)
void RpcAsk_RequestBuildModeProvider()
void RemoveEditorMode(int playerID, IEntity provider)
void RequestEnterBuildingMode(IEntity provider, int playerID, bool UserActionActivationOnly, bool UserActionUsed, bool useAllAvailableProviders=false)
IEntity GetProviderFormRplId(RplId rplProviderId)
void RequestBuildModeProvider()
Client method which asks the server for the information about providers used for by current build mod...
void RpcAsk_AddBuildingValue(int buildingValue, RplId compId)
void SetClientLock(bool lock, IEntity provider)
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
Replication item identifier.
Core component to manage SCR_EditorManagerEntity.
SCR_EditorManagerEntity GetEditorManager()
proto external GenericEntity GetOwner()
Get owner entity.
EEditorMode
Editor mode that defines overall functionality.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.