Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scriptname AddItemsToLList extends ReferenceAlias
- {
- Script to be attached to an alias referencing the player.
- The quest holding the alias should be an empty one with both "Run Once" and "Start Game Enabled" checked.
- Will add the content of the "Items" property to the leveledlist property.
- There are two examples :
- - one using a generic formlist (anything can be added to the LList)
- - one using a specific array (armors in the example). The actual list of items have to be set as property in the CK, limited to 128
- '-> this one is commented out.
- It's possible to use an array of form (Form[]) instead of the LList. It's faster then relying on LList but limited to 128 forms.
- And also fucking boring to set by hand when you can just drag n drop everything into a formlist via CK.
- Refresh() is the actual distribution function.
- It is always called whenever the game load :
- - Because scripted modifications to LList are reverted on game load.
- - This also allow for easy updates to add/remove items from LList.
- }
- ;Armor[] Property Items Auto
- FormList Property Items Auto
- LeveledItem Property theLLIst Auto
- ;Called once the first time the mod is loaded in game.
- Event OnInit()
- Refresh()
- EndEvent
- ;Called every time the player load the game with the mod already installed (so not when OnInit is called)
- Event OnPlayerLoadGame()
- Refresh()
- EndEvent
- ;
- ;To be used when adding objects from an array.
- ;Function Refresh()
- ; int nbScarves = Items.length
- ; int i = 0
- ;
- ; while i < nbScarves
- ; theLLIst.AddForm(Items[i], 0, 1)
- ; i += 1
- ; endwhile
- ;
- ;EndFunction
- ;To be used when adding objects from a formlist.
- Function Refresh()
- int nbScarves = Items.GetSize()
- int i = 0
- while i < nbScarves
- theLLIst.AddForm(Items.GetAt(i), 0, 1)
- i += 1
- endwhile
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement