Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

Cecell

Uploaded by

Cecell

Virus scan

Safe to use

About this mod

With community collaboration I'd like to provide a cathedral oriented non-SKSE Papyrus library for everyone.
NOTE: This is a functional library of global functions. It does nothing on its own and doesn't load unless a mod specifically calls a function (no esp, esl, esm)

Requirements
Permissions and credits
Changelogs
cLib

Discord server open for feedback and support!
**Discord Server Invite**
Requirements: None

Now in an FOMOD!

Is this superior to any other library in any way?  Yes, and here's how: All other libraries that I'm aware of are SKSE based.  This means that you must take the entire library even if you only need one function.  This library is written in 100% cut-and-paste-able Papyrus and its code can be used for literally any application you have.  SKSE libraries, rightfully so, are designed to provide genuinely powerful functions that allow us to accomplish things that just aren't possible whatsoever in vanilla Papyrus.  For God's sakes, powerofthree's Papyrus Extender has one function that retrieves every single enchantment in the game, including from mods...from just that example alone, that's the sort of thing those devs are incredible for.  What a disservice to the community it would be for them to be bogged down with small things that can be done quite efficiently by Papyrus alone; that's where this library steps in! 
Another benefit is being able to modify this code directly in Papyrus and adapt it for whatever your specific need is.  This library has implemented a number of seemingly small additions that have served me well.  Example: a modified Find() (and RFind()) function for arrays...yes, there already is a .Find() function however this function includes an invert argument that defaults to TRUE since you have the regular Find function for normal needs.  This makes the function find the first argument that does not equal the provided value.  Maybe that just saved you some time.  Did you know there's no function anywhere (as of 21-11-16) that finds and replaces a value in an array?  There is now!  Reverse the order of an array, sort it, remove all empty/None/0 indices, remove duplicates, splice, slice, merge, compact, copy, resize (w/o SKSE) and more.  I've tried to separate the functions into categories.

SKSE
It's nice when a function can be made so that SKSE is not explicitly required but in some cases that just isn't possible.  Little by little functions are being added that require SKSE.  They're in the SKSE Required section of the script towards the end so take a look there as well.  One recently added was searching the names of every form in an array for a particular string (.GetName() requires SKSE)

Permissions
Use of any of this code is completely free and granted in perpetuity (as long as the mod itself doesn't run afoul of some law somewhere or cause harm to others or violate the TOS of the Nexus, etc, etc).  So, download it, open it up, look for what you want and just copy and paste!  As time goes by I'm finding ways to separate modules and thus make the process of only being limited even easier.

It began as a proof of concept project but as more and more capabilities were discovered it has turned into a full-fledged library of functions.  98% of the functions do not have hard SKSE requirements yet are written in such a way that if SKSE is installed it can be taken advantage of.  From a dev standpoint this means that scripts that operate without SKSE on one platform can transition seamlessly to an SKSE environment using the same function calls.  Integrations are controlled by a single file cLibUse.  The FOMOD has options for three different flavors of integration levels from No integrations (pure vanilla) to the full shebang (described below).  This means that the different posted versions simply have the default argument values for useSKSE, usePapUtil and/or usePO3 (powerofthree papyrus extender) set to TRUE or False respectively.

The fact that integrations are available for SKSE that can be switched on library will actually enable a dev to easily write scripts for both environments with and without SKSE support.

Credit for much of what is provided here is able to be offered because of open collaboration.
The FOMOD has 3 options:
  • All SKSE+ functionality is disabled.  All root functions (base functions that are called by other functions) that have SKSE or mainly SKSE:Soft dependencies have Bool arguments that allow for said functionality to be disabled.  Those arguments are set to False (e.g. Bool useSKSE = False).
  • SKSE base functionality is enabled. All functions including array creation functions that have SKSE:Soft dependencies have their SKSE functionality enabled.  This allows the library to take advantage of SKSE code for faster execution.
  • All SKSE+ functionality is enabled. SKSE+ == SKSE, PapyrusUtil, powerofthree's Papyrus Extender and ConsoleUtil. 

    PapyrusUtil provides a wealth of functionality that goes above and beyond SKSE base functionality. Examples being, removing duplicate values from an array, creation of ObjectReference and Actor arrays and more all in native functions.

    powerofthree's Papyrus Extender provides a variety of functions such as retrieving an array of the contents of containers and generating random numbers for example.

    ConsoleUtil has been implemented as an optional destination for trace output in the SKSE+ version so that all of this library's Trace output is routed to the console for faster debugging (this is one of my favorite features).

All functions have built in basic argument validation as well as Papyrus log friendly checks that provide structured Trace feedback that includes the source function's name and the specific logic test that was failed.

All functions have a doc style {Requirements ...} entry directly under the function header.  The requirements are stated as follows: {Requirements: None} this function has no 3rd party integration within its body.  No function that has a requirement of None relies on any other function that has a hard SKSE dependency; {Requirements None, SKSE:Soft} is the second most common. This means that it can benefit from the presence of SKSE but has no hard requirement for it.  The argument "useSKSE" is present in all functions that have the ability to directly call on SKSE functions.  These arguments all default to False of course for the non-SKSE version. {Requirements: SKSE} the final section contains about 10 or so functions that MUST have SKSE or rely on something that has a hard SKSE dependency.  An example (at this time) being getting a list of forms that are currently equipped by an actor.  That may be something that could be made non-SKSE capable at some time (you wouldn't believe what is possible with the ingenuity of our community).

Generic descriptions of functions included... 
  • A full suite of conditional functions including ternary alternatives, simple (very short) return functions, pseudo-switches and the like.  These can shave many many lines of code from a script by helping to avoid large if/then blocks.
  • A SKSE-less A module of dynamic array creation functions (1-128 indices) for the 8 base array types is included: Actor, Alias, Bool, Float, Form, Int, ObjectReference and String.
    The FOMOD includes an option to install the necessary scripts for dynamic creation of the following types (This is the result of a proof of concept and may not be useful in your application):  Actor, ActorBase, Alias, Armor, Bool, Cell, ConstructibleObject, Container, Enchantment, Faction, Float, Flora, Form, Formlist, GlobalVariable, Ingredient, Int, Keyword, LeveledActor, LeveledItem, LeveledSpell, Location, MagicEffect, Message, MiscObject, ObjectReference, Outfit, Package, Perk, Potion, Quest, Race, ReferenceAlias, Scroll, Shout, SoulGem, Spell, Static, String, TextureSet, Topic, TopicInfo, Weapon, Weather, WordOfPowerThe functions are pretty simple and follow this pattern: cArrayCreateActor(Int Size, Actor filler), etc. Depending on the response a system for 256+ index arrays will be implemented (already in progress).
  • With a lot of ingenuity on the part of our amazing community a surprising number of things that have been SKSE exclusive are now able to be accomplished: The abilities of the StringUtil script have been implemented in a way I would never have thought of (thanks to cadpnq for that one). StringLeft, StringRight, StringFind, StringLength, StringGetNthChar, StringSetNthChar, StringReplace, StringRemove, StringTrim: left, right and both, SubString, ArrayJoinString, StringToArray (split individual chars to an array) and more. 
  • Logic functions posted online by Milagros Osorio for AND, NOT, OR and XOR are included and are ready for testing
  • Bit shifting (yeah I thought it was more than *2 or / 2 and drop the remainder) 
  • Dylbill published a great function (included here) for Decimal to Hex conversion that also covers light plugins (no SKSE) 
  • Now that string parsing is possible hex to decimal conversion without SKSE can be done!
  • Also some things have been implemented that for the life of me I couldn't locate anywhere else: The FOMOD includes an option to install the cGetCell script which allows for getting the Form object of a cell using a set of either CK x,y coords or x,y map coords or by supplying an actual ObjectReference. 
  • A set of position functions that use array returns/arguments for all GetAngle and GetPosition functions and even combines the two into a .GetPlacement() function whose return array can be directly submitted to cArrayTranslateTo().
  • Random number generation for any size number float or int limited only by the VM itself.  Optional integration with PO3's extender has been implemented.
  • Full integration of all functions in the PapyrusUtil.psc file have been implemented.
  • A set of formlist to array and back functions
  • A set of formlist and array search by name functions (.GetName() of any kind requires SKSE) These functions use .GetName() on each index and search for the supplied string.
  • And more, you'll just have to see.


QUESTIONS
Join the Discord!


CLEANING
Huh?  There isn't an esp...



DISCLAIMER
       This mod is not made, guaranteed, or supported by ZenimaxBethesda Game Studios, or any of their affiliates. Except as expressly stated to the contrary this mod is not guaranteed, or supported by any other mod developer or uploader.  Providing a patch does not imply an endorsement, approval or guarantee of compatibility for the patch’s master files.
Credit for mods or other resources contained herein may be incomplete. For further detail visit the mod’s Description page.  Please remember to endorse mods you enjoy! 
THE RESOURCES HEREIN ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND EITHER EXPRESSED OR IMPLIED, TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW. AUTHOR/UPLOADER DOES NOT WARRANT THAT THE RESOURCES PROVIDED BY THE AUTHOR/UPLOADER WILL BE ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT THIS SITE OR THE SERVER THAT MAKES IT AVAILABLE ARE FREE OF INCLUDING BUT NOT LIMITED TO VIRUSES OR OTHER HARMFUL COMPONENTS. AUTHOR/UPLOADER DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF OR THE RESULT OF THE USE OF THE RESOURCES PROVIDED HEREIN IN TERMS OF THEIR CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. YOU (AND NOT AUTHOR/UPLOADER) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. THE ABOVE EXCLUSION MAY NOT APPLY TO YOU, TO THE EXTENT THAT APPLICABLE LAW MAY NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES.


Credits
Skyler,
Dylbill,
Milagros Osorio,
cadpnq,
Nem 
Bethesda Game Studios
 for the game and Creation Kit
Nexusmods for Vortex
ElminsterAU and the xEdit team for SSEEdit (xEdit)
Arthmoor for his disclaimer statement and his seemingly unending contributions to the community just wow.
Don Ho for Notepad++
Igor Pavlov for 7zip
The GIMP Team for GIMP
Google for Sheets and Chrome
The community here at NEXUSMODS for just being awesome
yggdrasil75 for answering a crap ton of questions and not getting irritated (well not too bad anyway)
elwaps for offering sympathy and support in my time of newbieness
mator for a crap ton of stuff out there
and just a LOT of love for all the people in the Nexusmods discord channel.
My personally chosen higher power for our existence
My wife for everything
Starbucks for their coffee
Our baby girl for being awesome.  After 12 years of failed infertility treatments we found the perfect baby to adopt!!! DON'T GIVE UP :D
More thanks to:
JK, Vaelka, Teabag86, ????????, ra2phoenix, sheson, CaptMcSplody, Xahtax, Skyler (SkylerModder), Minhbi and more others that I can't think of at the moment but that I should be ashamed of myself for not remembering.
I started from nothing and a fair number of people in the community have helped me and taught me and suffered through the process. I can't thank them all enough.