|
static bool | LoadData () |
|
static bool | IsInitialized () |
|
static PlayerSpawnPreset | GetRandomCharacterPreset () |
|
static bool | ProcessEquipmentData (PlayerBase player, PlayerSpawnPreset data) |
| equips character with the chosen preset
|
|
static void | ProcessSlotsEquipment (PlayerBase player, PlayerSpawnPreset data) |
| iterates over each object and spawns alternatives
|
|
static bool | SelectAndSpawnSlotEquipment (PlayerBase player, PlayerSpawnPresetSlotData slotData) |
| selects weighted slot equipment variant
|
|
static void | ProcessCargoEquipment (PlayerBase player, PlayerSpawnPreset data) |
| chooses one object from the array
|
|
static bool | SelectAndSpawnCargoSet (PlayerBase player, PlayerSpawnPreset data) |
|
static bool | SpawnDiscreteCargoItemSet (PlayerBase player, PlayerSpawnPresetDiscreteCargoSetData csd) |
|
static bool | SpawnDiscreteSlotItemSet (PlayerBase player, PlayerSpawnPresetDiscreteItemSetSlotData dis, int slotID) |
|
static bool | SpawnComplexChildrenItems (EntityAI parent, notnull PlayerSpawnPresetItemSetBase data) |
| could spawn other items recursively. Parent item is guaranteed here.
|
|
static bool | SpawnSimpleChildrenItems (EntityAI parent, PlayerSpawnPresetItemSetBase data) |
|
static void | HandleNewItem (notnull ItemBase item, PlayerSpawnPresetItemSetBase data) |
|
static EntityAI | CreateChildItem (EntityAI parent, string type) |
|
static void | ApplyAttributes (ItemBase item, PlayerSpawnAttributesData attributes) |
|
static bool | IsWeaponAndMagazineType (EntityAI parent, string type) |
| Used for exceptions in the system.
|
|
◆ ApplyAttributes()
306 {
307 if (!attributes)
308 return;
309
312
314 if (
item.IsMagazine())
315 {
317
318
319
320
321
322
323
324
325
326
327 {
330 }
331 }
332 else
333 {
339 }
340 }
static proto float Round(float f)
Returns mathematical round of value.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
Перекрестные ссылки Math::Lerp(), Math::RandomFloatInclusive() и Math::Round().
Используется в HandleNewItem() и SpawnSimpleChildrenItems().
◆ CreateChildItem()
272 {
276 {
279
280 Debug.
Log(
"FAILED spawning item: " + type +
", it fits in no cargo or attachment on any worn item",
"n/a",
"n/a",
"CreateChildItem");
282 }
283
284
286 {
289 {
293 {
296 }
297 }
298
300 }
301
302 return parent.GetInventory().CreateInInventory(type);
303 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136
Definition InventoryItem.c:731
Definition PlayerBaseClient.c:2
shorthand
Definition BoltActionRifle_Base.c:6
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Перекрестные ссылки Class::CastTo(), CFG_MAGAZINESPATH, GetGame() и Debug::Log().
Используется в SpawnComplexChildrenItems() и SpawnSimpleChildrenItems().
◆ GetRandomCharacterPreset()
41 {
46 {
49 {
50 for (
int j = 0;
j <
p.spawnWeight;
j++)
51 {
53 }
54 }
55 }
56
58 }
static ref PlayerSpawnJsonData m_Data
Definition CfgPlayerSpawnHandler.c:4
Definition CfgPlayerSpawnDataJson.c:17
Перекрестные ссылки m_Data.
Используется в MissionBase::OnClientNewEvent().
◆ HandleNewItem()
◆ IsInitialized()
◆ IsWeaponAndMagazineType()
◆ LoadData()
7 {
9 if (!spawnGearPresetFiles || (spawnGearPresetFiles && spawnGearPresetFiles.Count() == 0))
10 return false;
11
13
15 {
18
21 {
23 return false;
24 }
25
28 }
29
31
32 return true;
33 }
string path
Definition OptionSelectorMultistate.c:142
Definition CfgGameplayHandler.c:2
static TStringArray GetPlayerSpawnGearPresetFiles()
Definition CfgGameplayHandler.c:438
Перекрестные ссылки ErrorEx, CfgGameplayHandler::GetPlayerSpawnGearPresetFiles(), m_Data, m_Initialized и path.
Используется в MissionBase::OnInit().
◆ ProcessCargoEquipment()
chooses one object from the array
121 {
122 if (!
data.HasDiscreteUnsortedItemSetsDefined())
123 {
124 Debug.
Log(
"No non-empty 'discreteUnsortedItemSets' array found. Skipping cargo spawns",
"n/a",
"n/a",
"ProcessCargoEquipment");
125 return;
126 }
127
129 }
static bool SelectAndSpawnCargoSet(PlayerBase player, PlayerSpawnPreset data)
Definition CfgPlayerSpawnHandler.c:131
Перекрестные ссылки Debug::Log() и SelectAndSpawnCargoSet().
Используется в ProcessEquipmentData().
◆ ProcessEquipmentData()
equips character with the chosen preset
62 {
64 {
67 }
68
69 return true;
70 }
static void ProcessCargoEquipment(PlayerBase player, PlayerSpawnPreset data)
chooses one object from the array
Definition CfgPlayerSpawnHandler.c:120
static void ProcessSlotsEquipment(PlayerBase player, PlayerSpawnPreset data)
iterates over each object and spawns alternatives
Definition CfgPlayerSpawnHandler.c:73
Перекрестные ссылки ProcessCargoEquipment() и ProcessSlotsEquipment().
Используется в MissionBase::OnClientNewEvent().
◆ ProcessSlotsEquipment()
iterates over each object and spawns alternatives
74 {
75 if (!
data.HasAttachmentSlotSetsDefined())
76 {
77 Debug.
Log(
"No non-empty 'attachmentSlotItemSets' array found. Skipping slot spawns",
"n/a",
"n/a",
"ProcessSlotsEquipment");
78 return;
79 }
80
82 {
84 }
85 }
static bool SelectAndSpawnSlotEquipment(PlayerBase player, PlayerSpawnPresetSlotData slotData)
selects weighted slot equipment variant
Definition CfgPlayerSpawnHandler.c:88
Перекрестные ссылки Debug::Log() и SelectAndSpawnSlotEquipment().
Используется в ProcessEquipmentData().
◆ SelectAndSpawnCargoSet()
132 {
134 int count =
data.discreteUnsortedItemSets.Count();
137 {
138 csd =
data.discreteUnsortedItemSets[
i];
139
141 {
142 for (
int j = 0;
j <
csd.spawnWeight;
j++)
143 {
145 }
146 }
147 }
148
153 }
static bool SpawnDiscreteCargoItemSet(PlayerBase player, PlayerSpawnPresetDiscreteCargoSetData csd)
Definition CfgPlayerSpawnHandler.c:155
Перекрестные ссылки SpawnDiscreteCargoItemSet().
Используется в ProcessCargoEquipment().
◆ SelectAndSpawnSlotEquipment()
selects weighted slot equipment variant
89 {
92 return false;
93
95 return false;
96
101 {
103
105 {
106 for (
int j = 0;
j <
dis.spawnWeight;
j++)
107 {
109 }
110 }
111 }
112
117 }
static bool SpawnDiscreteSlotItemSet(PlayerBase player, PlayerSpawnPresetDiscreteItemSetSlotData dis, int slotID)
Definition CfgPlayerSpawnHandler.c:162
one item set for slot
Definition CfgPlayerSpawnDataJson.c:150
Перекрестные ссылки SpawnDiscreteSlotItemSet().
Используется в ProcessSlotsEquipment().
◆ SpawnComplexChildrenItems()
could spawn other items recursively. Parent item is guaranteed here.
191 {
192 if (!
data.complexChildrenTypes ||
data.complexChildrenTypes.Count() < 1)
193 {
194 return false;
195 }
196
198 {
199 if (
cct.itemType ==
string.Empty)
200 {
201 Debug.
Log(
"Empty item type found in 'complexChildrenTypes' of parent : " + parent,
"n/a",
"n/a",
"SpawnSimpleChildrenItems");
202 continue;
203 }
204
207
209 {
211 }
212 else
213 {
216 Debug.
Log(
"FAILED spawning item: " +
cct.itemType +
" of parent: " + parent,
"n/a",
"n/a",
"SpawnComplexChildrenItems");
217 }
218 }
219
220 return true;
221 }
static EntityAI CreateChildItem(EntityAI parent, string type)
Definition CfgPlayerSpawnHandler.c:271
static void HandleNewItem(notnull ItemBase item, PlayerSpawnPresetItemSetBase data)
Definition CfgPlayerSpawnHandler.c:259
static bool IsWeaponAndMagazineType(EntityAI parent, string type)
Used for exceptions in the system.
Definition CfgPlayerSpawnHandler.c:343
used for specific hierarchical child spawning
Definition CfgPlayerSpawnDataJson.c:186
Перекрестные ссылки Class::CastTo(), CreateChildItem(), HandleNewItem(), IsWeaponAndMagazineType() и Debug::Log().
Используется в HandleNewItem() и SpawnDiscreteCargoItemSet().
◆ SpawnDiscreteCargoItemSet()
◆ SpawnDiscreteSlotItemSet()
◆ SpawnSimpleChildrenItems()
224 {
225 if (!
data || !
data.simpleChildrenTypes ||
data.simpleChildrenTypes.Count() < 1)
226 {
227 return false;
228 }
229
230 int count =
data.simpleChildrenTypes.Count();
231 string itemType;
233 {
234 itemType =
data.simpleChildrenTypes[
i];
235 if (itemType ==
string.
Empty)
236 {
237 Debug.
Log(
"Empty item type found at idx: " +
i.ToString() +
" of 'simpleChildrenTypes' array. Skipping",
"n/a",
"n/a",
"SpawnSimpleChildrenItems");
238 continue;
239 }
240
243
245 {
246 if (!
data.simpleChildrenUseDefaultAttributes)
248 }
249 else
250 {
253 Debug.
Log(
"FAILED spawning item type: " + itemType +
" to parent: " + parent,
"n/a",
"n/a",
"SpawnSimpleChildrenItems");
254 }
255 }
256 return true;
257 }
Empty
Definition Hand_States.c:14
Перекрестные ссылки ApplyAttributes(), Class::CastTo(), CreateChildItem(), Empty, IsWeaponAndMagazineType() и Debug::Log().
Используется в HandleNewItem() и SpawnDiscreteCargoItemSet().
◆ m_Data
◆ m_Initialized
Объявления и описания членов класса находятся в файле: