Difference between revisions of "SetNthEntryValue - Perk"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Doulos
imported>Egocarib
 
Line 6: Line 6:
{{SKSEFunction|1.06.07}}
{{SKSEFunction|1.06.07}}


Used to set a Perk's Entry Point ''Value'' field(s).


== Syntax ==
== Syntax ==
Line 11: Line 13:
bool Function SetNthEntryValue(int n, int i, float value) native
bool Function SetNthEntryValue(int n, int i, float value) native
</source>
</source>
== Parameters ==
n: the index of the Entry Point in the '''Perk Entries''' list (0 indicates the first entry)
i: the index of the value to be set (0 to set the first value, 1 to set the second value if there is one)
value: the new value to be set.


== Return Value ==
== Return Value ==


== Examples ==
== Examples ==
Edit the Enchanting Perk "Extra Effect" so that it allows placing three enchantments on a single item:
<source lang="papyrus">
Perk Property ExtraEffect auto
;...
ExtraEffect.SetNthEntryValue(0, 0, 3.00)
</source>


== Notes ==
== Notes ==
 
* Changes made with this function will persist across separate save loads but not across full game restarts.
The n value is the index of the entry in the perk, starting from 0. So if there are three entries for perk MyPerk, then MyPerk.SetNthEntryValue(0, 1, 100) would set the value of the first entry (indexed to 0) to 100. MyPerk.SetEntryValue(2, 1, 100) would set the value of the third entry to 100 and so on.
* This function allows setting Entry Point values more precisely than in the CK - which rounds decimal values to the nearest hundreth.


== See Also ==
== See Also ==
[[GetNthEntryValue - Perk]]

Latest revision as of 22:44, 22 November 2013

SKSE Member of: Perk Script

Minimum required SKSE Version: 1.06.07


Used to set a Perk's Entry Point Value field(s).

Syntax[edit | edit source]

bool Function SetNthEntryValue(int n, int i, float value) native

Parameters[edit | edit source]

n: the index of the Entry Point in the Perk Entries list (0 indicates the first entry)

i: the index of the value to be set (0 to set the first value, 1 to set the second value if there is one)

value: the new value to be set.

Return Value[edit | edit source]

Examples[edit | edit source]

Edit the Enchanting Perk "Extra Effect" so that it allows placing three enchantments on a single item:

Perk Property ExtraEffect auto
;...
ExtraEffect.SetNthEntryValue(0, 0, 3.00)

Notes[edit | edit source]

  • Changes made with this function will persist across separate save loads but not across full game restarts.
  • This function allows setting Entry Point values more precisely than in the CK - which rounds decimal values to the nearest hundreth.

See Also[edit | edit source]

GetNthEntryValue - Perk