0 of 0

File information

Last updated

Original upload

Created by

Denny Freuder

Uploaded by

Dodoshian

Virus scan

Safe to use

About this mod

Adds new native Papyrus script functions. More will be added in the future.

Version 2.0 and up no longer use CommonLib as that was causing some issues with certain functions. For now, these functions are only supported by SE.

Requirements
Permissions and credits
List of functions included:

  • GetTemplateWeapon: Returns the template of a weapon, if it exists.
  • GetTemplateArmor: Returns the template of an armor, if it exists.
  • GetWeaponTemperingRecipe: Returns the tempering recipe of the weapon. 
    It will return the tempering recipe even if it is a weapon that uses another as a template.
  • GetArmorTemperingRecipe: Same as above but for armor items.
  • GetCraftingRecipe: returns the first-located recipe of ANY TYPE (tempering, forging, etc.) for an item. Can optionally take a string argument to specify workbench keyword (ex: "CraftingSmithingForge" or new keywords added by mods) to limit recipes to that workbench type.
  • GetCraftingRecipeArray: Same as above but returns an array of ALL recipes that meet the conditions.
  • AddKeywordToAllArmorsWithKeywords: Adds a keyword to all armors that contain all keywords in an array.

New functions in 2.0:
  • GetActorExpectedDamage: Returns the damage an actor would do with a weapon. A rough simulation that takes into account perks that increase damage. Doesn't take into account critical hits or the tempered state of the weapon.
  • SetAmmoPlayable: Sets an ammunition as Playable or Unplayable. Unplayable ammunition cannot be seen or interacted with, but can be equipped through a script.
  • SetWeaponImpactDataSet: Sets the ImpactDataSet of a weapon.
  • GetWeaponImpactDataSet: Gets the ImpactDataSet of a weapon.
  • SetExplosionDamage: Sets the damage an explosion deals.
  • GetExplosionDamage: Gets the damage an explosion deals.
  • SetExplosionImpactDataSet: Sets the ImpactDataSet of an explosion.
  • GetExplosionImpactDataSet: Gets the ImpactDataSet of an explosion.
  • SetExplosionRadius: Sets the radius of an explosion in units.
  • GetExplosionRadius: Gets the radius of an explosion in units.
  • SetPerkDescription: Sets the description of a perk to the description of another.
  • SetPerkConditions: Sets the Conditions of one perk to another's.
  • SetProjectileExplosion: Sets the explosion of a projectile.
  • SetWeaponDetectionLevel: Sets the detection level (sound level) of a weapon.
  • GetWeaponDetectionLevel: Gets the detection level of a weapon.
  • SetExplosionEnchantment: Sets the Enchantment of an explosion.
  • GetExplosionEnchantment: Gets the Enchantment of an explosion.

New functions in  2.11
  • SetProjectileSound: Sets the sound of a projectile while it's travelling.
  • GetContainerRespawn: Returns if a container is set to respawn.
  • SetContainerRespawn: Can set a container to respawn or not respawn.
  • SetLightNegative: Sets a light to be negative or positive (Negative lights subtract light level and colors from existing lights)




Good luck and have fun. Some possible use-cases of the above:
  • Get the weapon or armor template of a Bethesda premade enchanted item. Then use SKSE enchantment functions to make a "copy" of that enchantment that can be used to implement an enchantment degradation system whereby enchantments lose potency over time.
  • Dynamically add tempering recipes to ANY vanilla or mod weapon or armor that lacks a recipe during runtime. Check to see if it has a tempering recipe already, and if not, get its material keyword or some other info and make a new recipe for it (Dylbill's Papyrus Functions has a function to create new Constructible Objects during runtime btw). Even without DBF you could still have a dummy tempering recipe and use SKSE to change its ingredients list. Just a few dummy recipes would be enough to swap dynamically if you were adding something like an armor/weapon repair system that gives a tool that you can use to temper only equipped gear.
  • Add a system where the more you use a weapon, you become more familiar and it requires less materials to make at a forge.
  • Add a system or a perk that allows you to disenchant a weapon or armor without destroying it.
  • Use SetWeaponImpactDataSet to create different elemental effects for ammunitions without utilizing explosions.
  • Have the damage and range of explosives scale with a player stat or globalvariable.
  • Use SetPerkDescription to reveal the description of a perk only after unlocking it.
  • Make interesting lighting effects without adding light to surroundings.
  • Check if a container is safe storage when adding an item, and returning it if it isn't safe storage.


To Install: Install as you would any other mod with MO2 or Vortex.

For mod authors to use these functions in their scripts: Just put import DennysPapyrusFunctions at the top of your script.

Source code for CommonLib version available here.

Source code for version 2.0 and up available here.

CREDITS
Mrowr Purr for the template files and extremely useful tutorial videos
Ryan McKenzie, PO3,  and CharmedBaryon for CommonLib
Ashen for never-ending assistance on the SkyrimMods Discord
Fenix31415 for a template and lots of help setting up a new development environment. 
And many many more people in the Skyrim and Melee modding community for their help with C++.