Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ScenarioFrameworkTaskSupportEntity.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 [EntityEditorProps(category: "GameScripted/Tasks", description: "Transport task support entity.", color: "0 0 255 255")]
4 {
5 };
6 
7 //------------------------------------------------------------------------------------------------
9 {
10  protected IEntity m_Entity;
11 
12  //------------------------------------------------------------------------------------------------
13  override void FinishTask(notnull SCR_BaseTask task)
14  {
15  super.FinishTask(task);
16  }
17 
18 
19  //------------------------------------------------------------------------------------------------
20  IEntity GetTaskEntity()
21  {
22  return m_Entity;
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  void SetTaskEntity(IEntity entity)
27  {
28  m_Entity = entity;
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  SCR_BaseTask CreateTask(SCR_ScenarioFrameworkLayerTask layer)
33  {
34  m_Entity = layer.GetSpawnedEntity();
35  return super.CreateTask();
36  }
37 
38  //------------------------------------------------------------------------------------------------
39  void SetTaskPrefab(ResourceName sTaskPrefab)
40  {
41  m_sTaskPrefab = sTaskPrefab;
42  }
43 
44  //------------------------------------------------------------------------------------------------
45  protected SCR_Faction GetCharacterFaction(IEntity unit)
46  {
47  SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(unit);
48  if (!character)
49  return null;
50 
51  return SCR_Faction.Cast(character.GetFaction());
52  }
53 
54  //------------------------------------------------------------------------------------------------
55  //This should only be called on the server!
56  void SetSpawnedEntityName(notnull SCR_ScenarioFrameworkTask task, string name)
57  {
58  int taskID = task.GetTaskID();
59  RPC_SpawnedEntityName(taskID, name);
60  Rpc(RPC_SpawnedEntityName, taskID, name);
61  }
62 
63  //------------------------------------------------------------------------------------------------
64  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
65  void RPC_SpawnedEntityName(int taskID, string name)
66  {
67  if (!GetTaskManager())
68  return;
69 
71  if (!task)
72  return;
73 
74  task.SetSpawnedEntityName(name);
75  }
76 
77  //------------------------------------------------------------------------------------------------
78  //This should only be called on the server!
79  void SetTaskExecutionBriefing(notnull SCR_ScenarioFrameworkTask task, string description)
80  {
81  int taskID = task.GetTaskID();
82  RPC_TaskExecutionBriefing(taskID, description);
83  Rpc(RPC_TaskExecutionBriefing, taskID, description);
84  }
85 
86  //------------------------------------------------------------------------------------------------
87  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
88  void RPC_TaskExecutionBriefing(int taskID, string description)
89  {
90  if (!GetTaskManager())
91  return;
92 
94  if (!task)
95  return;
96 
97  task.SetTaskExecutionBriefing(description);
98  }
99 }
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
m_Entity
enum EAITargetInfoCategory m_Entity
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
GetTaskManager
SCR_BaseTaskManager GetTaskManager()
Definition: SCR_BaseTaskManager.c:7
SCR_ScenarioFrameworkTaskSupportEntity
Definition: SCR_ScenarioFrameworkTaskSupportEntity.c:8
SCR_BaseTaskSupportEntity
Definition: SCR_BaseTaskSupportEntity.c:8
SCR_ScenarioFrameworkTask
Definition: SCR_ScenarioFrameworkTask.c:7
SCR_ScenarioFrameworkTaskSupportEntityClass
Definition: SCR_ScenarioFrameworkTaskSupportEntity.c:3
SCR_Faction
Definition: SCR_Faction.c:6
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180