Difference between revisions of "LeveledItem Script"

2,295 bytes added ,  10:49, 31 March 2015
added Notes about how various SKSE functions interact and behave between session and saves/reloads
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>Taleden
(added Notes about how various SKSE functions interact and behave between session and saves/reloads)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Script for the manipulation of leveled item base objects.
Script for the manipulation of leveled item base objects.


== Definition ==
== Definition ==
Line 11: Line 8:
ScriptName LeveledItem extends Form
ScriptName LeveledItem extends Form
</source>
</source>


== Properties ==
== Properties ==
None
None


== Global Functions ==
== Global Functions ==
None
None


== Member Functions ==
== Member Functions ==
*Function [[AddForm - LeveledItem|AddForm]](Form apForm, int auiLevel, int auiCount)
 
**Adds the given count of given form to the leveled list under the given level.
:'''[[AddForm - LeveledItem|AddForm]](Form ''apForm'', Int ''auiLevel'', Int ''auiCount'')'''
*Function [[Revert - LeveledItem|Revert]]()
:*Adds the given count of given form to the leveled list under the given level.
**Removes all script added forms from the leveled list.
 
:'''[[Revert - LeveledItem|Revert]]()'''
:*Removes all script added forms from the leveled list.
 
 
== SKSE Member Functions ==
 
:'''Int [[GetChanceNone - LeveledItem|GetChanceNone]]()'''
:*Returns the Chance of Getting None for the Leveled List.
 
:'''[[SetChanceNone - LeveledItem|SetChanceNone]](Int ''chance'')'''
:*Sets the Chance of Getting None for the Leveled List.
 
:'''GlobalVariable [[GetChanceGlobal - LeveledItem|GetChanceGlobal]]()'''
:*Returns the GlobalVariable(If used) used for calculating Chance None for the leveled list.
 
:'''[[SetChanceGlobal - LeveledItem|SetChanceGlobal]](GlobalVariable ''glob'')'''
:*Sets the GlobalVariable used for calculating Chance None for the leveled list.
 
:'''Int [[GetNumForms - LeveledItem|GetNumForms]]()'''
:*Returns the number of Forms within the leveled list.
 
:'''Form [[GetNthForm - LeveledItem|GetNthForm]](Int ''n'')'''
:*Returns the form at the specified index.
 
:'''Int [[GetNthLevel - LeveledItem|GetNthLevel]](Int ''n'')'''
:*Returns the List Level for the Form at the specified index
 
:'''[[SetNthLevel - LeveledItem|SetNthLevel]](Int ''n'', Int ''level'')'''
:*Sets the list Level for the Form at the specified index to the specified amount.
 
:'''Int [[GetNthCount - LeveledItem|GetNthCount]](Int ''n'')'''
:*Returns the count for the Form at the specified index.
 
:'''Int [[SetNthCount - LeveledItem|SetNthCount]](Int ''n'', Int ''count'')'''
:*Sets the count for the Form at the specified index
 


== Events ==
== Events ==
None
None
== Notes ==
# List entries added via AddForm() do persist through a save and reload, and do not leak to other saves during the same play session.
# Conversely, SetChanceNone() and SetChanceGlobal() '''do not''' persist through a save and reload (so they must be manually restored on each reload), and they '''do''' leak to other saves during the same play session (the same way i.e. SetGoldValue() does).
# If a LeveledItem has a global variable defined for chance none (whether it's via SetChanceGlobal() or in the CK), the numeric chance none is ignored and only the global variable is considered.
# SetChanceNone() does not automatically clear SetChanceGlobal(), so you may have to explicitly call SetChanceGlobal(None) to ensure that a new numeric chance none takes effect.
# Revert() does remove all entries added via AddForm(), but (as of SKSE 1.7.1) '''does not''' revert the chance none (numeric or global)!
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
Anonymous user