ianpatt / skse64

Skyrim SE Script Extender
https://skse.silverlock.org
Other
286 stars 40 forks source link

Extends the SE component with various Papyrus additions. #42

Open sky-void0 opened 7 months ago

sky-void0 commented 7 months ago

Synopsis

bool AddItemsBulk(Form[] items, int[] count, bool remove = false) Adds to -or removes from- the container, count instances of the passed forms in a single operation. Mass addition/removal of items can also be achieved by the native AddItems if given a formlist as argument, but this will quickly send OnItemAdded notifications to all listeners, which can overwhelm the VM resulting in stack dumps and massive slowdowns. This function avoids that undesired side effect, and offers the added benefits of not requiring formlists and allowing fine tuning of the added/removed amounts.

int container.GetItemCountCached(Form item, bool refresh = false) Upon the first call, the contents of the container are cached and subsequent calls simply retrieve the cached value without looking up the container. Much faster than the native GetItemCount. Intended for use when successive calls are required and the container's contents are known not to change.

int[] GetItemsCount(Form[] items] Due to the frametime sync call overhead, GetItemCountCached is unsuitable for processing large arrays of items. This wrapper uses GetItemCountCached internally to processes an entire array in a single call and -usually- frame.

float RestoreItemCharge(Weapon wepn, bool all = false) _While there are other charge functions, this one works directly on forms inside containers. It restores and returns the missing charge of the first pertinent entry in the extradata list. Or all of them if all is true._

float GetDisplayValue(form item) native There's already a function that returns a form's base value, however the final value can vary widely from this amount depending on enchantments, temper status and other factors. This function returns the real display value, as shown on the UI.

int GetSkillRequirement(string actorvalue) Returns the skill level needed to acquire this perk.