Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignBaseTaskSupportEntity.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 [EntityEditorProps(category: "GameScripted/Tasks", description: "Campaign base task support entity.", color: "0 0 255 255")]
4 {
5 };
6 
7 //------------------------------------------------------------------------------------------------
9 {
10  //------------------------------------------------------------------------------------------------
11  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
12  void RPC_SetTargetBase(int taskID, int baseID)
13  {
14  if (!GetTaskManager())
15  return;
16 
18  if (!task)
19  return;
20 
21  SCR_CampaignMilitaryBaseComponent base = SCR_GameModeCampaign.GetInstance().GetBaseManager().FindBaseByCallsign(baseID);
22  if (!base)
23  return;
24 
25  task.SetTargetBase(base);
26  }
27 
28  //------------------------------------------------------------------------------------------------
29  void OnTaskUpdate(SCR_BaseTask task)
30  {
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  void SetTargetBase(notnull SCR_CampaignBaseTask task, notnull SCR_CampaignMilitaryBaseComponent base)
35  {
36  if (!GetTaskManager())
37  return;
38 
39  int taskID, baseID;
40 
41  taskID = task.GetTaskID();
42  baseID = base.GetCallsign();
43 
44  Rpc(RPC_SetTargetBase, taskID, baseID);
45  RPC_SetTargetBase(taskID, baseID);
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  override void EOnInit(IEntity owner)
50  {
51  super.EOnInit(owner);
52 
53  if (!SCR_BaseTaskManager.s_OnTaskUpdate)
54  return;
55 
56  SCR_BaseTaskManager.s_OnTaskUpdate.Insert(OnTaskUpdate);
57  }
58 }
SCR_CampaignBaseTask
Definition: SCR_CampaignBaseTask.c:9
SCR_CampaignBaseTaskSupportEntityClass
Definition: SCR_CampaignBaseTaskSupportEntity.c:3
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SCR_BaseTaskSupportEntityClass
Definition: SCR_BaseTaskSupportEntity.c:3
SCR_CampaignBaseTaskSupportEntity
Definition: SCR_CampaignBaseTaskSupportEntity.c:8
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
GetTask
SCR_ScenarioFrameworkTask GetTask()
Definition: SCR_ScenarioFrameworkLayerTask.c:65
SCR_BaseTask
A base class for tasks.
Definition: SCR_BaseTask.c:8
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition: SCR_GameModeCampaign.c:1927
GetTaskManager
SCR_BaseTaskManager GetTaskManager()
Definition: SCR_BaseTaskManager.c:7
SCR_BaseTaskManager
Definition: SCR_BaseTaskManager.c:25
SCR_BaseTaskSupportEntity
Definition: SCR_BaseTaskSupportEntity.c:8
SCR_CampaignMilitaryBaseComponent
Definition: SCR_CampaignMilitaryBaseComponent.c:38
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180