Difference between revisions of "AddForm - LeveledItem"

Jump to navigation Jump to search
No change in size ,  08:32, 7 April 2012
m
no edit summary
imported>JustinOther
imported>JustinOther
m
Line 26: Line 26:
== Notes ==
== Notes ==
*Currently (v1.5.26.0), forms added to leveled items in this manner will not persist in save games, unlike [[AddForm - FormList]]. This can be demonstrated or even exploited with the below, a jury rigged GetGameLoaded() function.
*Currently (v1.5.26.0), forms added to leveled items in this manner will not persist in save games, unlike [[AddForm - FormList]]. This can be demonstrated or even exploited with the below, a jury rigged GetGameLoaded() function.
<source lang="papyrus">Bool Function GetGameLoaded(LeveledItem akLeveledItem = None, Form apItem = None, ObjectReference akContainer = None)
<source lang="papyrus">Bool Function GetGameLoaded(LeveledItem akLeveledItem = None, Form apForm = None, ObjectReference akContainer = None)
         akContainer.AddItem(akLeveledItem, 1, True)
         akContainer.AddItem(akLeveledItem, 1, True)
         If akContainer.GetItemCount(apItem)
         If akContainer.GetItemCount(apForm)
                 akContainer.RemoveItem(apItem, akContainer.GetItemCount(apItem), True)
                 akContainer.RemoveItem(apForm, akContainer.GetItemCount(apForm), True)
                 Return False
                 Return False
         Else ; Will only return 'True' once per save load
         Else ; Will only return 'True' once per save load
                 akLeveledItem.AddForm(apItem, 1, 1)
                 akLeveledItem.AddForm(apForm, 1, 1)
                 Return True
                 Return True
         EndIf
         EndIf
Anonymous user

Navigation menu