7 [
Attribute(
desc:
"UI info overwrite to overwrite entity name. Will use EditableEntityUI if non is set")]
13 [
Attribute(defvalue:
"1",
params:
"1 inf",
desc:
"Prefab entity count. To be used with prefabs like groups, where spawned logic create additional entities")]
14 protected int m_iEntityCount;
16 [
Attribute(
desc:
"Variants prefab data of entity. These are a diffrent variant of the default")]
17 protected ref array<ref SCR_SpawnerVariantData> m_aVariantData;
19 protected ResourceName m_sDefaultPrefab;
23 protected int m_iSupplyCost;
31 void SetEnabled(
bool enable)
39 return m_iEntityCount;
53 return m_UiInfo.GetName();
64 return SCR_Enum.HasFlag(GetValidSlotSizes(), slotSize);
89 return rank >= GetMinimumRequiredRank();
99 return m_eMinimumRequiredRank;
117 ResourceName GetRandomDefaultOrVariantPrefab()
119 array<ResourceName> prefabs = {};
121 prefabs.Insert(m_sDefaultPrefab);
128 prefabs.Insert(data.GetVariantPrefabData());
131 return prefabs.GetRandomElement();
140 int GetVariantDataList(notnull out array<SCR_SpawnerVariantData> variantData)
146 variantData.Insert(data);
149 return variantData.Count();
158 int GetVariantPrefabList(notnull out array<ResourceName> variantPrefabs)
160 variantPrefabs.Clear();
164 variantPrefabs.Insert(data.GetVariantPrefabData());
167 return variantPrefabs.Count();
180 if (data.GetVariantType() == variantType)
200 return variantData.GetVariantPrefabData();
205 super.InitData(entry);
207 m_sDefaultPrefab = entry.GetPrefab();
213 array<ref SCR_EntityBudgetValue> budgets = {};
214 uiInfo.GetEntityAndChildrenBudgetCost(budgets);
216 m_eMinimumRequiredRank = -1;
220 switch (budget.GetBudgetType())
233 if (m_eMinimumRequiredRank == -1)
236 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
242 if (m_eMinimumRequiredRank == -1)
245 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
251 if (m_eMinimumRequiredRank == -1)
254 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
260 if (m_eMinimumRequiredRank == -1)
263 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
269 if (m_eMinimumRequiredRank == -1)
272 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
278 if (m_eMinimumRequiredRank == -1)
281 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
287 if (m_eMinimumRequiredRank == -1)
290 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
296 if (m_eMinimumRequiredRank == -1)
299 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
305 if (m_eMinimumRequiredRank == -1)
308 Print(
"'SCR_EntityCatalogSpawnerData' entry " + uiInfo.GetName() +
" has rank " +
typename.EnumToString(
EEditableEntityBudget, m_eMinimumRequiredRank) +
" assigned but multiple ranks in the editable UI info which is not supported!");
316 if (m_eMinimumRequiredRank == -1)
329 protected ResourceName m_sVariantPrefab;
331 [
Attribute(
"0",
desc:
"Type of variant. Type needs to be unique in the list", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
ESpawnerVariantType))]
338 ResourceName GetVariantPrefabData()
340 return m_sVariantPrefab;
349 return m_eVehicleVariantType;