24 string GetRandomCharacterType()
26 if (characterTypes && characterTypes.Count() > 0)
27 return characterTypes.GetRandomElement();
29 Debug.Log(
"No characterTypes defined. Falling back to 'default' character type, or random, if undefined",
"n/a",
"n/a",
"PlayerSpawnPreset");
40 Debug.Log(
"Invalid spawn weight, skipping preset: " + name,
"n/a",
"Validation",
"PlayerSpawnPreset");
48 bool HasAttachmentSlotSetsDefined()
50 return attachmentSlotItemSets && attachmentSlotItemSets.Count() > 0;
54 bool HasDiscreteUnsortedItemSetsDefined()
56 return discreteUnsortedItemSets && discreteUnsortedItemSets.Count() > 0;
81 Debug.Log(
"Wrong slot name used: " +
slotName,
"n/a",
"Validation",
"PlayerSpawnPresetSlotData");
86 Debug.Log(
"No parent entity found when trying to populate slot: " +
slotName,
"n/a",
"Validation",
"PlayerSpawnPresetSlotData");
89 if (!parent.GetInventory().HasAttachmentSlot(slotID))
91 Debug.Log(
"Slot: " +
slotName +
" undefined on entity: " + parent.GetType(),
"n/a",
"Validation",
"PlayerSpawnPresetSlotData");
101 if (!super.IsValid())
106 Debug.Log(
"discreteItemSets for slot: " +
slotName +
" undefined",
"n/a",
"Validation",
"PlayerSpawnPresetSlotData");
117 bool simpleChildrenUseDefaultAttributes;
118 ref PlayerSpawnAttributesData attributes;
136 if (!super.IsValid())
141 Debug.Log(
"Invalid spawnWeight set for a discrete item set!",
"n/a",
"Validation",
"PlayerSpawnPresetDiscreteItemSetBase");
156 if (!super.IsValid())
163 Debug.Log(
"No attributes defined for a discrete item set!",
"n/a",
"Validation",
"PlayerSpawnPresetDiscreteItemSetSlotData");
172 override int GetQuickbarIdx()
179class PlayerSpawnPresetDiscreteCargoSetData : PlayerSpawnPresetDiscreteItemSetBase
192 if (!super.IsValid())
195 return itemType !=
string.Empty;
198 override int GetQuickbarIdx()
ref array< ref PlayerSpawnPresetDiscreteItemSetSlotData > discreteItemSets
PlayerSpawnJsonDataBase presets
bool TranslateAndValidateSlot(EntityAI parent, inout int slotID)
Translates slot name to match something from both 'CfgSlots' and 'attachments[]' in entity's config.
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
PlayerSpawnPresetItemSetBase spawnWeight
PlayerSpawnPresetComplexChildrenType healthMin
provides access to slot configuration
used for specific hierarchical child spawning
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override bool IsValid()
slot name validity checked separately