Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_EvacuateTaskSupportEntity.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
//[Obsolete(), EntityEditorProps(category: "GameScripted/Tasks", description: "Evacuate task support entity.", color: "0 0 255 255")]
3
//class SCR_EvacuateTaskSupportEntityClass: SCR_RequestedTaskSupportEntityClass
4
//{
5
//};
6
7
//------------------------------------------------------------------------------------------------
8
//[Obsolete()]
9
//class SCR_EvacuateTaskSupportEntity : SCR_RequestedTaskSupportEntity
10
//{
11
// [Attribute("#AR-CampaignTasks_RequestImpossiblePosition-UC")]
12
// protected string m_sNowhereToRun;
13
//
14
// [Attribute("#AR-CampaignTasks_RequestImpossibleSignal-UC")]
15
// protected string m_sNoSignal;
16
//
17
// [Attribute("1000", desc: "Minimum distance of a base from the place this task is requested from. (in m)")]
18
// protected float m_fMinDistanceFromStart;
19
//
20
// [Attribute("50", desc: "Maximum distance of the rescuer from the evacuated player, once a rescue base is reached. (in m)")]
21
// protected float m_fMaxDistanceFromRequester;
22
//
23
// //------------------------------------------------------------------------------------------------
24
// override bool CanRequest()
25
// {
26
// return (super.CanRequest() && HasValidBase());
27
// }
28
//
29
// //------------------------------------------------------------------------------------------------
30
// override void Request()
31
// {
32
// SCR_PlayerController playerController = SCR_PlayerController.Cast(GetGame().GetPlayerController());
33
// if (!playerController)
34
// return;
35
//
36
// SCR_MapRadialUI ctxMenu = SCR_MapRadialUI.GetInstance();
37
// if (!ctxMenu)
38
// return;
39
//
40
// vector position = ctxMenu.GetMenuWorldPosition();
41
//
42
// IEntity requesterEntity = playerController.GetMainEntity();
43
// if (!requesterEntity)
44
// return;
45
//
46
// FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(requesterEntity.FindComponent(FactionAffiliationComponent));
47
// if (!factionAffiliationComponent)
48
// return;
49
//
50
// Faction requesterFaction = factionAffiliationComponent.GetAffiliatedFaction();
51
// if (!requesterFaction)
52
// return;
53
//
54
// vector requesterOrigin = requesterEntity.GetOrigin();
55
// array<SCR_MilitaryBaseComponent> bases = {};
56
//
57
// SCR_MilitaryBaseSystem.GetInstance().GetBases(bases);
58
//
59
// bool foundValidBase = false;
60
// for (int i = bases.Count() - 1; i >= 0; i--)
61
// {
62
// if (requesterFaction != bases[i].GetFaction())
63
// continue;
64
//
65
// float baseToStartDistance = vector.Distance(bases[i].GetOwner().GetOrigin(), requesterOrigin);
66
//
67
// if (baseToStartDistance > SCR_EvacuateTask.GetMinDistanceFromStart())
68
// {
69
// foundValidBase = true;
70
// break;
71
// }
72
// }
73
//
74
// if (!foundValidBase)
75
// {
76
// SCR_PopUpNotification.GetInstance().PopupMsg(m_sNowhereToRun);
77
// return;
78
// }
79
//
80
// if (!SCR_UIRequestEvacTaskComponent.IsInRange(requesterFaction, requesterEntity))
81
// {
82
// SCR_PopUpNotification.GetInstance().PopupMsg(m_sNoSignal);
83
// return;
84
// }
85
//
86
// // Find task network component to send RPC to server
87
// SCR_CampaignTaskNetworkComponent taskNetworkComponent = SCR_CampaignTaskNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignTaskNetworkComponent));
88
// if (!taskNetworkComponent)
89
// return;
90
//
91
// taskNetworkComponent.RequestEvacuation(position);
92
// }
93
//
94
// //------------------------------------------------------------------------------------------------
95
// //This should only be called on the server!
96
// void RequestEvacuation(int requesterID, vector position)
97
// {
98
// SCR_EvacuateTask evacuateTask = SCR_EvacuateTask.Cast(CreateTask());
99
// if (!evacuateTask)
100
// return;
101
//
102
// evacuateTask.SetStartOrigin(position); // Should be enough to be set just on the server
103
//
104
// SCR_BaseTaskExecutor requester = SCR_BaseTaskExecutor.GetTaskExecutorByID(requesterID);
105
//
106
// SetRequester(evacuateTask, requester);
107
// }
108
//
109
// //------------------------------------------------------------------------------------------------
110
// float GetMinDistanceFromStart()
111
// {
112
// return m_fMinDistanceFromStart;
113
// }
114
//
115
// //------------------------------------------------------------------------------------------------
116
// float GetMaxDistanceFromRequester()
117
// {
118
// return m_fMaxDistanceFromRequester;
119
// }
120
//
121
// //------------------------------------------------------------------------------------------------
122
// bool HasValidBase()
123
// {
124
// IEntity requesterEntity = SCR_PlayerController.GetLocalControlledEntity();
125
// if (!requesterEntity)
126
// return false;
127
//
128
// FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(requesterEntity.FindComponent(FactionAffiliationComponent));
129
// if (!factionAffiliationComponent)
130
// return false;
131
//
132
// Faction requesterFaction = factionAffiliationComponent.GetAffiliatedFaction();
133
// if (!requesterFaction)
134
// return false;
135
//
136
// bool foundValidBase = false;
137
//
138
// vector requesterOrigin = requesterEntity.GetOrigin();
139
// array<SCR_MilitaryBaseComponent> bases = {};
140
//
141
// SCR_MilitaryBaseSystem.GetInstance().GetBases(bases);
142
//
143
// for (int i = bases.Count() - 1; i >= 0; i--)
144
// {
145
// if (requesterFaction != bases[i].GetFaction())
146
// continue;
147
//
148
// float baseToStartDistance = vector.Distance(bases[i].GetOwner().GetOrigin(), requesterOrigin);
149
//
150
// if (baseToStartDistance > SCR_EvacuateTask.GetMinDistanceFromStart())
151
// {
152
// foundValidBase = true;
153
// break;
154
// }
155
// }
156
//
157
// return foundValidBase;
158
// }
159
//};
scripts
Game
Tasks
SupportEntities
SCR_EvacuateTaskSupportEntity.c
Generated by
1.17.0