Difference between revisions of "AddForm - LeveledItem"
Jump to navigation
Jump to search
no edit summary
imported>Jlundin |
imported>JustinOther |
||
Line 24: | Line 24: | ||
</source> | </source> | ||
== Return Value == | |||
*Note: 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 code, allowing a jury rigged GetGameLoaded(). | |||
<source lang="papyrus">Bool Function GetGameLoaded(LeveledItem akLeveledItem = None, Form apItem = None, ObjectReference akContainer = None) | |||
akContainer.AddItem(akLeveledItem, 1, True) | |||
If akContainer.GetItemCount(apItem) | |||
akContainer.RemoveItem(apItem, akContainer.GetItemCount(apItem), True) | |||
Return False | |||
Else ; Will only return 'True' once per save load | |||
akLeveledItem.AddForm(apItem, 1, 1) | |||
Return True | |||
EndIf | |||
EndFunction</source> | |||
== See Also == | == See Also == | ||
*[[LeveledItem Script]] | *[[LeveledItem Script]] | ||
*[[Revert - LeveledItem]] | *[[Revert - LeveledItem]] |