Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBuildingPlacingEditorComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Editor", description: "Main conflict editor component to handle building mode placing", icon: "WBData/ComponentEditorProps/componentEditor.png")]
4 [Attribute(params: "et", desc: "List of prefabs that are ignored for clipping check.")]
5 protected ref array<ResourceName> m_aClippingCheckIgnoredPrefabs;
6
8 {
9 if (m_aClippingCheckIgnoredPrefabs.Contains(res))
10 return true;
11
12 return false;
13 }
14}
15
16//------------------------------------------------------------------------------------------------
17class SCR_CampaignBuildingPlacingEditorComponent : SCR_PlacingEditorComponent
18{
19 [Attribute("{C7EE4C198B641E21}Sounds/Editor/BaseBuilding/Editor_BaseBuilding.acp", UIWidgets.ResourceNamePicker, "Sound project file to be used for building", "acp")]
20 protected ResourceName m_sSoundFile;
21
22 [Attribute("", UIWidgets.ResourcePickerThumbnail, "WP that is spawned as default for placed AI.", "et")]
24
25 protected bool m_bCanBeCreated = true;
26 protected SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent;
27 protected ScriptedGameTriggerEntity m_AreaTrigger;
31
32
33 //different because this cant be a global map, but one map per base, probably gotta put this somewhere else lol
35
36 //------------------------------------------------------------------------------------------------
38 {
40 return null;
41
42 SCR_FactionAffiliationComponent factionAffiliationComp = m_CampaignBuildingComponent.GetProviderFactionComponent();
43 if (!factionAffiliationComp)
44 return null;
45
46 Faction faction = factionAffiliationComp.GetAffiliatedFaction();
47 if (!faction)
48 return factionAffiliationComp.GetDefaultAffiliatedFaction();
49
50 return faction;
51 }
52
53 //------------------------------------------------------------------------------------------------
55 protected bool GetProviderBase(out SCR_MilitaryBaseComponent base)
56 {
57 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
58 if (!providerComponent)
59 return false;
60
61 base = SCR_MilitaryBaseComponent.Cast(m_Provider.FindComponent(SCR_MilitaryBaseComponent));
62 if (!base)
63 return false;
64
65 return true;
66 }
67
68 //------------------------------------------------------------------------------------------------
71 {
72 if (!previewEnt)
73 return;
74
75 SCR_CampaignBuildingPlacingObstructionEditorComponent obstructionComponent = SCR_CampaignBuildingPlacingObstructionEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingObstructionEditorComponent, true, true));
76 if (!obstructionComponent)
77 return;
78
79 obstructionComponent.OnPreviewCreated(previewEnt);
80 }
81
82 //------------------------------------------------------------------------------------------------
84 protected void SetInitialCanBeCreatedState(notnull SCR_EditablePreviewEntity previewEnt)
85 {
86 if (!previewEnt)
87 return;
88
89 float distance = vector.DistanceSq(m_AreaTrigger.GetOrigin(), previewEnt.GetOrigin());
90 if (distance < m_AreaTrigger.GetSphereRadius() * m_AreaTrigger.GetSphereRadius())
91 m_bCanBeCreated = true;
92
93 m_bCanBeCreated = false;
95 return;
96 }
97
98 //------------------------------------------------------------------------------------------------
100 {
101 // Get SCR_CampaignBuildingManagerComponent (on Game mode) here and set temporary owner.
102 BaseGameMode gameMode = GetGame().GetGameMode();
103
104 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
105 if (!buildingManagerComponent || !m_CampaignBuildingComponent)
106 return;
107
108 buildingManagerComponent.SetTemporaryProvider(m_CampaignBuildingComponent.GetProviderEntity());
109 }
110
111 //-----------------------------------------------------------------------------------------------
113 {
114 if(!entitySource)
115 return false;
116
117 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
118 if (!providerComponent)
119 return true;
120
122 array<ref SCR_EntityBudgetValue> budgetCosts = {};
123 map<EEditableEntityBudget, int> tempBudgetAggregation = m_accumulatedBudgetChanges;
124 SCR_EditableEntityCoreBudgetSetting budgetSettings;
125
126 m_BudgetManager.GetBudgetCostsDontDiscardCampaignBudget(entitySource, budgetCosts);
127
128 return providerComponent.IsThereEnoughBudgetToSpawn(budgetCosts);
129 }
130
131 //------------------------------------------------------------------------------------------------
132 override protected void OnEntityCreatedServer(array<SCR_EditableEntityComponent> entities)
133 {
135 return;
136
137 int cooldownTime, aiBudgetValue;
138 int count = entities.Count();
139 SCR_EditorLinkComponent linkComponent;
140 SCR_EditableGroupComponent editableGroupComponent;
141 SCR_CampaignBuildingCompositionComponent compositionComponent;
142 SCR_AIGroup aiGroup;
143
144 for (int i = 0; i < count; i++)
145 {
146 IEntity entityOwner = entities[i].GetOwnerScripted();
147 if (!entityOwner)
148 continue;
149
150 linkComponent = SCR_EditorLinkComponent.Cast(entityOwner.FindComponent(SCR_EditorLinkComponent));
151 if (!linkComponent)
152 SCR_EditorLinkComponent.IgnoreSpawning(false);
153
154 editableGroupComponent = SCR_EditableGroupComponent.Cast(entities[i]);
155 if (editableGroupComponent)
156 {
157 // Set Free Roam building Ai flag both group and characters in it to be able to process them on saving / loading as they use it's own struct.
158 SetAiFlag(editableGroupComponent);
159
160 aiGroup = editableGroupComponent.GetAIGroupComponent();
161 if (aiGroup)
162 {
163 aiGroup.GetOnInit().Insert(InitGroup);
164
166 params.TransformMode = ETransformMode.WORLD;
167 params.Transform[3] = aiGroup.GetOrigin();
168 SCR_AIWaypoint defendWP = SCR_AIWaypoint.Cast(GetGame().SpawnEntityPrefabLocal(Resource.Load(m_sDefaultAIWP), null, params));
169
170 aiGroup.AddWaypointAt(defendWP, 0);
171 }
172 }
173
174 compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(entityOwner.FindComponent(SCR_CampaignBuildingCompositionComponent));
175 if (compositionComponent)
176 SetProviderAndBuilder(compositionComponent);
177
178 if (!UseCooldown())
179 continue;
180
181 cooldownTime = GetEntityBudgetValue(entities[i], EEditableEntityBudget.COOLDOWN);
182 aiBudgetValue = GetEntityBudgetValue(entities[i], EEditableEntityBudget.AI);
183 }
184
185 SetCooldownTimer(cooldownTime);
186 SetAIBudget(aiBudgetValue);
187 }
188
189 //------------------------------------------------------------------------------------------------
191 protected void GetCooldownTimeClient(int prefabID, SCR_EditableEntityComponent entity)
192 {
194 }
195
196 //------------------------------------------------------------------------------------------------
197 protected void GetAIBudgetClient(int prefabID, SCR_EditableEntityComponent entity)
198 {
200 }
201
202 //------------------------------------------------------------------------------------------------
205 {
206 array<ref SCR_EntityBudgetValue> outBudgets = {};
207 entity.GetEntityChildrenBudgetCost(outBudgets);
208
209 if (outBudgets.IsEmpty())
210 entity.GetEntityBudgetCost(outBudgets);
211
212 foreach (SCR_EntityBudgetValue outBudget: outBudgets)
213 {
214 if (outBudget.GetBudgetType() == budget)
215 return outBudget.GetBudgetValue();
216 }
217
218 return 0;
219 }
220
221 //------------------------------------------------------------------------------------------------
223 protected void SetProviderAndBuilder(notnull SCR_CampaignBuildingCompositionComponent compositionComponent)
224 {
225 IEntity provider = m_CampaignBuildingComponent.GetProviderEntity();
226 if (!provider)
227 return;
228
229 SCR_EditorManagerEntity managerEnt = GetManager();
230 if (!managerEnt)
231 return;
232
233 int id = managerEnt.GetPlayerID();
234
235 compositionComponent.SetBuilderId(id);
236 compositionComponent.SetProviderEntity(provider);
237
238 // Don't set up this hook if the provider is a base. We don't want to change the ownership here
239 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
240 if (!providerComponent)
241 return;
242
243 SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
244 if (base)
245 return;
246
248 compositionComponent.SetClearProviderEvent(ent);
249 }
250
251 //------------------------------------------------------------------------------------------------
253 protected void InitGroup(SCR_AIGroup aiGroup)
254 {
255 if (!aiGroup)
256 return;
257
258 aiGroup.GetOnInit().Remove(InitGroup);
259
260 array<AIAgent> outAgents = {};
261 IEntity ent;
262 SCR_EditableEntityComponent editableEntityComponent;
263 SCR_CampaignBuildingProviderComponent providerComponent;
264
265 aiGroup.GetAgents(outAgents);
266
267 foreach (AIAgent agent: outAgents)
268 {
269 ent = agent.GetControlledEntity();
270 editableEntityComponent = SCR_EditableEntityComponent.Cast(ent.FindComponent(SCR_EditableEntityComponent));
271 if (editableEntityComponent)
272 SetAiFlag(editableEntityComponent);
273
274 providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
275 if (!providerComponent)
276 continue;
277
278 providerComponent.SetOnEntityKilled(agent.GetControlledEntity());
279 }
280 }
281
282 //------------------------------------------------------------------------------------------------
283 protected void SetAiFlag(SCR_EditableEntityComponent component)
284 {
285 component.SetEntityFlag(EEditableEntityFlag.FREE_ROAM_BUILDING_AI, true);
286 }
287
288 //------------------------------------------------------------------------------------------------
289 protected void OnPlaceEntityServer(int prefabID, SCR_EditableEntityComponent entity)
290 {
291 vector position = entity.GetOwner().GetOrigin();
292 Rpc(PlaySoundEvent, position, m_sSoundFile);
293 PlaySoundEvent(position, m_sSoundFile);
294 }
295
296 //------------------------------------------------------------------------------------------------
297 [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
298 protected void PlaySoundEvent(vector pos, string soundEvent)
299 {
300 vector transform[4];
301 Math3D.MatrixIdentity4(transform);
302 transform[3] = pos;
303
304 if (soundEvent && pos)
305 AudioSystem.PlayEvent(soundEvent, SCR_SoundEvent.SOUND_BUILD, transform, new array<string>, new array<float>);
306 }
307
308 //------------------------------------------------------------------------------------------------
309 [RplRpc(RplChannel.Reliable, RplRcver.Server)]
310 override protected void CreateEntityServer(SCR_EditorPreviewParams params, RplId prefabID, int playerID, int entityIndex, bool isQueue, array<RplId> recipientIds, bool canBePlayer, RplId holderId)
311 {
312 // Cancel spawning of the composition instantly and spawn a composition layout instead.
313 SCR_EditorLinkComponent.IgnoreSpawning(true);
314
315 // Cancel a services registration to base - register once the final structure is erected.
316 SCR_ServicePointComponent.SpawnAsOffline(true);
317
318 super.CreateEntityServer(params, prefabID, playerID, entityIndex, isQueue, recipientIds, canBePlayer, holderId);
319 }
320
321 //------------------------------------------------------------------------------------------------
324 {
325 BaseGameMode gameMode = GetGame().GetGameMode();
326 if (!gameMode)
327 return string.Empty;
328
329 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
330 if (!buildingManagerComponent)
331 return string.Empty;
332
333 SCR_CampaignBuildingCompositionOutlineManager outlineManager = buildingManagerComponent.GetOutlineManager();
334 if (!outlineManager)
335 return string.Empty;
336
337 return outlineManager.GetCompositionOutline(entity);
338 }
339
340 //------------------------------------------------------------------------------------------------
341 override bool CanCreateEntity(out ENotification outNotification = -1, inout SCR_EPreviewState previewStateToShow = SCR_EPreviewState.PLACEABLE, SCR_EditorPreviewParams params = null, int prefabID = -1)
342 {
343 SCR_CampaignBuildingPlacingObstructionEditorComponent obstructionComponent = SCR_CampaignBuildingPlacingObstructionEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingObstructionEditorComponent, true, true));
344 if (!obstructionComponent)
345 {
346 outNotification = ENotification.EDITOR_PLACING_BLOCKED;
347 return false;
348 }
349
350 if (obstructionComponent.IsPreviewOutOfRange(m_InstantPlacingParam, outNotification))
351 {
352 previewStateToShow = SCR_EPreviewState.BLOCKED;
353 return false;
354 }
355
356 SCR_CampaignBuildingPlacingHQBaseEditorComponent hqBaseEditorComponent = SCR_CampaignBuildingPlacingHQBaseEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingHQBaseEditorComponent, true, true));
357 if (hqBaseEditorComponent && hqBaseEditorComponent.IsNearAnyHQ(outNotification))
358 {
359 previewStateToShow = SCR_EPreviewState.BLOCKED;
360 return false;
361 }
362
363 return super.CanCreateEntity(outNotification, previewStateToShow, params, prefabID) && obstructionComponent.CanCreate(outNotification, previewStateToShow);
364 }
365
366 //------------------------------------------------------------------------------------------------
367 override protected bool CanPlaceEntityServer(IEntityComponentSource editableEntitySource, out EEditableEntityBudget blockingBudget, bool updatePreview, bool showNotification, int prefabID = -1, int playerID = -1, SCR_EditorPreviewParams params = null)
368 {
369 if (!super.CanPlaceEntityServer(editableEntitySource, blockingBudget, updatePreview, showNotification, prefabID, playerID, params))
370 return false;
371
372 if (!m_Provider)
373 return true;
374
375 if (playerID > -1)
376 {
377 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
378 if (providerComponent && providerComponent.IsBudgetToEvaluate(EEditableEntityBudget.COOLDOWN) && providerComponent.GetCooldownValue(playerID) > 0)
379 return false;
380 }
381
382 if (prefabID < 0 || params && params.m_PlacingFlags & EEditorPlacingFlags.PLACING_ACTION)
383 return true;
384
385 blockingBudget = -1; // we are not blocked by the budget
388 if (!prefabUIInfo)
389 return false;
390
391 array<EEditableEntityLabel> entityLabels = {};
392 prefabUIInfo.GetEntityLabels(entityLabels);
393 return AreLabelsMatching(entityLabels);
394 }
395
396 //------------------------------------------------------------------------------------------------
400 protected bool AreLabelsMatching(notnull array<EEditableEntityLabel> entityLabels)
401 {
402 if (!m_Provider)
403 return false;
404
405 FactionAffiliationComponent fac = FactionAffiliationComponent.Cast(m_Provider.FindComponent(FactionAffiliationComponent));
406 if (!fac)
407 {
408 // in case of construction trucks, the provider is the back of the truck,
409 // while faction affiliation component is only on the truck itself,
410 // which is a parent, thus we need to check that as well
411 IEntity parent = m_Provider.GetParent();
412 while (parent && fac == null)
413 {
414 fac = FactionAffiliationComponent.Cast(parent.FindComponent(FactionAffiliationComponent));
415 parent = parent.GetParent();
416 }
417
418 if (!fac)
419 return false;
420 }
421
422 SCR_Faction providerFaction = SCR_Faction.Cast(fac.GetAffiliatedFaction());
423 if (!providerFaction)
424 {
425 // in case of vehicles, they might be empty, and thus they are no affiliated with any faction,
426 // but they provide structures from their default faction
427 providerFaction = SCR_Faction.Cast(fac.GetDefaultAffiliatedFaction());
428 if (!providerFaction)
429 return false;
430 }
431
432 if (!entityLabels.Contains(providerFaction.GetFactionLabel())) // faction label must match
433 return false;
434
435 SCR_CampaignBuildingProviderComponent providerComp = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
436 if (!providerComp)
437 return false;
438
439 array<EEditableEntityLabel> providerLabels = providerComp.GetAvailableTraits();
440 if (providerLabels.Contains(EEditableEntityLabel.SERVICE_HQ) && !SCR_CampaignBuildingProviderComponent.CanBeUsedToEstablishBase(m_Provider, m_Manager.GetPlayerID()))
441 providerLabels.RemoveItem(EEditableEntityLabel.SERVICE_HQ);
442
443 bool matchingLabel;
444 foreach (EEditableEntityLabel providerLabel : providerLabels)
445 {
446 if (!entityLabels.Contains(providerLabel)) // at least one of these needs to match
447 continue;
448
449 matchingLabel = true;
450 break;
451 }
452
453 if (!matchingLabel)
454 return false;
455
457 if (!browserComp)
458 return false;
459
460 array<EEditableEntityLabel> validBlackListLabels = {};
461 browserComp.GetValidBlackListedLabels(validBlackListLabels);
462 foreach (EEditableEntityLabel blacklistedLabel : validBlackListLabels)
463 {
464 if (entityLabels.Contains(blacklistedLabel)) // none of these can match
465 return false;
466 }
467
468 return true;
469 }
470
471 //------------------------------------------------------------------------------------------------
472 override protected void EOnEditorActivate()
473 {
474 super.EOnEditorActivate();
475 InitVariables();
476 SetInitialEvent();
477 }
478
479 //------------------------------------------------------------------------------------------------
480 override protected void EOnEditorActivateServer()
481 {
482 InitVariables();
484 }
485
486 //------------------------------------------------------------------------------------------------
487 override protected void EOnEditorOpen()
488 {
489 super.EOnEditorOpen();
490 InitVariables();
492 }
493
494 //------------------------------------------------------------------------------------------------
495 override protected void EOnEditorClose()
496 {
497 super.EOnEditorClose();
499 }
500
501 //------------------------------------------------------------------------------------------------
502 override protected void EOnEditorOpenServer()
503 {
504 super.EOnEditorOpenServer();
505 InitVariables();
506 }
507
508 //------------------------------------------------------------------------------------------------
509 private void SetInitialEvent()
510 {
511 m_PreviewManager = SCR_PreviewEntityEditorComponent.Cast(FindEditorComponent(SCR_PreviewEntityEditorComponent, true, true));
512 if (!m_PreviewManager)
513 return;
514
516 }
517
518 //------------------------------------------------------------------------------------------------
519 private void InitVariables()
520 {
521 m_CampaignBuildingComponent = SCR_CampaignBuildingEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingEditorComponent, true, true));
523 return;
524
525 m_Provider = m_CampaignBuildingComponent.GetProviderEntity();
527 }
528
529 //------------------------------------------------------------------------------------------------
530 override protected void EOnEditorDeactivateServer()
531 {
533 }
534
535 //------------------------------------------------------------------------------------------------
537 protected bool UseCooldown()
538 {
539 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
540 if (!providerComponent)
541 return false;
542
543 return providerComponent.IsBudgetToEvaluate(EEditableEntityBudget.COOLDOWN);
544 }
545
546 //------------------------------------------------------------------------------------------------
547 protected void SetCooldownTimer(int cooldownTime)
548 {
549 SCR_EditorManagerEntity managerEnt = GetManager();
550 if (!managerEnt)
551 return;
552
553 int playerId = managerEnt.GetPlayerID();
554
555 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
556 if (!providerComponent)
557 return;
558
559 providerComponent.SetPlayerCooldown(playerId, cooldownTime);
560 }
561
562 //------------------------------------------------------------------------------------------------
563 protected void SetAIBudget(int value)
564 {
565 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(m_Provider.FindComponent(SCR_CampaignBuildingProviderComponent));
566 if (!providerComponent)
567 return;
568
569 providerComponent.AddAIValue(value);
570 }
571}
572
EEditableEntityBudget
EEditableEntityLabel
EEditorPlacingFlags
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent
ResourceName GetOutlineToSpawn(notnull SCR_EditableEntityComponent entity)
Search for the outline that is assigned to this composition to be spawned.
int GetEntityBudgetValue(notnull SCR_EditableEntityComponent entity, EEditableEntityBudget budget)
Get value of given budget for given entity.
ref map< EEditableEntityBudget, int > m_accumulatedCampaignBudgetChanges
bool GetProviderBase(out SCR_MilitaryBaseComponent base)
Return the base which belongs to a provider (if any).
void GetAIBudgetClient(int prefabID, SCR_EditableEntityComponent entity)
void SetAiFlag(SCR_EditableEntityComponent component)
bool AreLabelsMatching(notnull array< EEditableEntityLabel > entityLabels)
void SetCooldownTimer(int cooldownTime)
void OnPreviewCreated(SCR_EditablePreviewEntity previewEnt)
Method called when the preview of prefab to build is created.
void InitGroup(SCR_AIGroup aiGroup)
Init spawned AI group (set events and flags).
void OnPlaceEntityServer(int prefabID, SCR_EditableEntityComponent entity)
void GetCooldownTimeClient(int prefabID, SCR_EditableEntityComponent entity)
The placement is driven by a cooldown set on server. However for a client needs (to show him a remain...
bool UseCooldown()
Check if the cooldown is set with this provider.
@ BLOCKED
User has this asset blocked so it should not be possible to interact with it until unblocked.
void PlaySoundEvent(vector pos, string soundEvent)
ECantBuildNotificationType m_eBlockingReason
void SetInitialCanBeCreatedState(notnull SCR_EditablePreviewEntity previewEnt)
Set the initial state of the preview can / can't be created (based on the place where player place th...
void SetProviderAndBuilder(notnull SCR_CampaignBuildingCompositionComponent compositionComponent)
Set the provider and builder entity to composition. Provider is the entity to which a composition bel...
SCR_EditablePreviewEntity m_PreviewEnt
ScriptedGameTriggerEntity m_AreaTrigger
SCR_PreviewEntityEditorComponent m_PreviewManager
float distance
vector position
void SCR_EditableGroupComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
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)
proto external IEntity GetParent()
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
Replication item identifier.
Definition RplId.c:14
ScriptInvoker GetOnInit()
void EOnEditorOpen()
When the editor is opened.
EntityComponentPrefabData GetEditorComponentData()
void EOnEditorOpenServer()
When the editor is opened (called on server).
void EOnEditorClose()
When the editor is closed.
SCR_BaseEditorComponent FindEditorComponent(typename type, bool showError=false, bool modeFirst=false)
SCR_EditorManagerEntity GetManager()
ResourceName GetCompositionOutline(notnull SCR_EditableEntityComponent entity)
Search all SCR_CampaignBuildingCompositionLayoutManager entry and try to find a matching composition....
int GetValidBlackListedLabels(out notnull array< EEditableEntityLabel > validBlackListLabels)
void SetEntityFlag(EEditableEntityFlag flag, bool toSet)
int GetEntityLabels(out notnull array< EEditableEntityLabel > entityLabels)
static SCR_EditableEntityUIInfo ExtractEditableUIInfoFromPrefab(ResourceName prefab)
Network packet of variables for entity placing and transformation.
EEditableEntityLabel GetFactionLabel()
void SCR_PlacingEditorComponentClass(IEntityComponentSource componentSource, IEntitySource parentSource, IEntitySource prefabSource)
bool IsThereEnoughBudgetToSpawn(IEntityComponentSource entitySource)
void CreateEntityServer(SCR_EditorPreviewParams params, RplId prefabID, int playerID, int entityIndex, bool isQueue, array< RplId > recipientIds, bool canBePlayer, RplId holderId)
bool CanCreateEntity(out ENotification outNotification=-1, inout SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE, SCR_EditorPreviewParams params=null, int prefabID=-1)
bool CanPlaceEntityServer(IEntityComponentSource editableEntitySource, out EEditableEntityBudget blockingBudget, bool updatePreview, bool showNotification, int prefabID=-1, int playerID=-1, SCR_EditorPreviewParams params=null)
void OnEntityCreatedServer(array< SCR_EditableEntityComponent > entities)
void OnBeforeEntityCreatedServer(ResourceName prefab)
proto external GenericEntity GetOwner()
Get owner entity.
Definition Types.c:486
void EntitySpawnParams()
Definition gameLib.c:130
EEditableEntityFlag
Unique flags of the entity.
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition EnNetwork.c:95
RplRcver
Definition RplRcver.c:59
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition RplChannel.c:14