Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Multi-array Papyrus code by ThoraldGM 20171018. For Diamond City SWAT 2.0 Overhaul, a Fallout 4 mod.
- ; Player selects factions and outfits in MCM mod menu, then code updates with choices. Untested, uncompiled fragment.
- FormList Property pDCS_Flst_Outfits_GlobalsFactions Auto Mandatory ; Contains globals for player to select factions 0-22
- ; ************************************************************************************************************
- ; THESE ARE MULTI-ARRAYS CREATED IN CK: FORMLISTS CONTAIN FORMLISTS, WHICH CONTAIN [GLOBALS | OUTFITS | EMPTY]
- ; ************************************************************************************************************
- FormList Property pDCS_Flst_Outfits_GlobalsOutfits Auto Mandatory ; X: formlist of formlists, Y: formlist of globals
- FormList Property pDCS_Flst_Outfits Auto Mandatory Constant ; X: formlist of formlists, Y: formlist of outfits
- FormList Property pDCS_Flst_Outfits_Allowed ; Empty multi-array that will hold outfits selected by player
- ; ************************************************************************************************************
- ; STOCK THE EMPTY MULTI-ARRAY WITH PLAYER SELECTED OUTFITS
- ; ************************************************************************************************************
- FormList FactionList = pDCS_Flst_Outfits_GlobalsFactions ; Step 1: faction globals
- GlobalVariable FactionIndex
- FormList NestedList ; Step 2: outfit globals
- GlobalVariable NestedIndex
- FormList OutfitsList ; Step 3: actual outfits
- Outfit OutfitsIndex
- FormList ApprovedList ; Step 4: approved outfits
- Int x = 0 ; Outer loop range, set now
- Int FactionSize = FactionList.GetSize()
- Int FactionGlobalInt
- Int y ; Inner loop range, set later (soon)
- Int NestedSize
- Int NestedGlobalInt
- While x < FactionSize ; Start with the outer loop
- FactionIndex = FactionList.GetAt(x) as GlobalVariable
- FactionGlobalInt = FactionIndex.GetValue() as Int
- If FactionGlobalInt == 1 ; If player selected faction,
- NestedList = pDCS_Flst_Outfits_GlobalsOutfits.GetAt(x) as FormList ; grab the outfits globals list for this faction
- NestedSize = NestedList.GetSize() ; and determine how many items are on it
- y = 0
- While y < NestedSize ; Move to the inner loop
- NestedIndex = NestedList.GetAt(y) as GlobalVariable
- NestedGlobalInt = NestedIndex.GetValue() as Int
- If NestedGlobalInt == 1 ; If player approved outfit,
- OutfitsList = pDCS_Flst_Outfits.GetAt(x) as FormList
- OutfitsIndex = OutfitsList.GetAt(y) as Outfit
- ApprovedList = pDCS_Flst_Outfits_Allowed.GetAt(x) as FormList
- ApprovedList.AddForm(OutfitsIndex as Form) ; add outfit to the approved list
- EndIf
- y += 1 ; Move to the next inner loop index
- EndWhile
- EndIf
- x += 1 ; Move to the next outer loop index
- EndWhile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement