Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

AndrealphusVIII

Uploaded by

AndrealphusVIII

Virus scan

Safe to use

About this mod

This resource is a collection of new native papyrus functions, achieved through the power of SKSE and CommonLibSSE NG.

Requirements
Permissions and credits
Changelogs
Donations
Description

As MrowrPurr started doing a YouTube tutorial series on SKSE DLL development, I decided to dip my toes into it.

This resource is a collection of new native papyrus functions, achieved through the power of SKSE and CommonLibSSE NG.
For users: it doesn't actually do anything on its own, but it may be required for some mods that use any of its functions.

The functions

If you wish to use any of the following functions in a script, you'll need to use the line:

Import ANDR_PapyrusFunctions

GetAndrealphusExtenderVersion()

Spoiler:  
Show

Int Function GetAndrealphusExtenderVersion()
  • Return value: an integer string that's the version number of this mod. (without the dots, so for instance 1.4.1 -> 141).



CastEnchantment()

Spoiler:  
Show

Function CastEnchantment(Actor akSource, Enchantment akEnchantment, Actor akTarget)
  • akSource: The Actor from which to cast the Enchantment.
  • akEnchantment: Enchantment to cast.
  • akTarget: Actor at which to aim the Enchantment.

Example: CastEnchantment(Game.GetPlayer(), FireDamageEnch01, NazeemRef) -> Have the player "cast" the Fire Damage enchantment on Nazeem.


CastPotion()

Spoiler:  
Show

Function CastPotion(Actor akSource, Potion akPotion, Actor akTarget)
  • akSource: The Actor from which to cast the Potion.
  • akPotion: Potion to cast.
  • akTarget: Actor at which to aim the Potion.


Example: CastPotion(Game.GetPlayer(), RestoreHealth01, LydiaRef) -> Have the player "cast" the effects of a restore health potion on Lydia.


CastIngredient()

Spoiler:  
Show

Function CastIngredient(Actor akSource, Ingredient akIngedient, Actor akTarget)
  • akSource: The Actor from which to cast the Ingredient.
  • akIngedient: Ingredient to cast.
  • akTarget: Actor at which to aim the Ingredient.


Example: CastIngredient(Game.GetPlayer(), TundraCotton, YsoldaRef) -> Have the player "cast" the effects of Tundra Cotton on Ysolda.


GetEffectiveEnchantmentCost()

Spoiler:  
Show

Float Function GetEffectiveEnchantmentCost(Actor akSource, Enchantment akEnchantment)
  • Return value: the total effective cost of all the enchantment's effects.
  • akSource: the user of the enchantment.
  • akEnchantment: the enchantment.


Example: GetEffectiveEnchantmentCost(Game.GetPlayer(), EnchFireDamage01) -> Get the effect cost of the EnchFireDamage01 enchantment.


GetEffectivePotionCost()

Spoiler:  
Show

Float Function GetEffectivePotionCost(Actor akSource, Potion akPotion)
  • Return value: the total effective cost of all the potion's effects.
  • akSource: the user of the potion.
  • akPotion: the potion.


Example: GetEffectivePotionCost(Game.GetPlayer(), RestoreHealth01) -> Get the effect cost of the RestoreHealth01 potion.


GetEffectiveIngredientCost()

Spoiler:  
Show

Float Function GetEffectiveIngredientCost(Actor akSource, Ingredient akIngredient)
  • Return value: the total effective cost of all the ingredient's effects.
  • akSource: the user of the ingredient.
  • akIngredient: the ingredient.


Example: GetEffectiveIngredientCost(Game.GetPlayer(), TundraCotton) -> Get the effect cost of the Tundra Cotton ingredient.


GetEffectiveScrollCost()

Spoiler:  
Show

Float Function GetEffectiveScrollCost(Actor akSource, Scroll akScroll)
  • Return value: the total effective cost of all the scroll's effects.
  • akSource: the user of the scroll.
  • akScroll: the scroll.


Example: GetEffectiveScrollCost(Game.GetPlayer(), FireBoltScroll) -> Get the effect cost of a Scroll of Firebolt.


SetRefAsNoAIAcquire()

Spoiler:  
Show

Function SetRefAsNoAIAcquire(ObjectReference akObject, Bool SetNoAIAquire)
  • akObject: the objectreference
  • SetNoAIAquire: to disable or enable SetNoAIAquire field.


Example: SetRefAsNoAIAcquire(SwordRef, true) -> Set SwordRef to no AI aqcuire, so NPCs AI won't pick it up.


GetActiveMagicEffectFromActor()

Spoiler:  
Show

ActiveMagicEffect Function GetActiveMagicEffectFromActor(Actor akActor, MagicEffect akMagicEffect)
  • akActor: the actor to check.
  • akMagicEffect: the base magic to look for.
  • Returns: the instance (ActiveMagicEffect) of akMagicEffect on the akActor.


Example: GetActiveMagicEffectFromActor(JzargoRef, OakfleshEffect)
-> Get the instance of the Oakflesh effect on J'zargo.


CastSpellFromRef()

Spoiler:  
Show

Function CastSpellFromRef(Actor akSource, Spell akSpell, ObjectReference akTarget, ObjectReference akOriginRef)
  • akSource: The caster of the spell.
  • akSpell: Spell to cast.
  • akTarget: An ObjectReference at which to aim the spell.
  • akOriginRef: The ObjectReference where to cast the spell from.


Example: CastSpellFromRef(Game.GetPlayer(), Firebolt, NazeemRef, PedestalRef) -> Have the player cast a Firebolt from a pedestal.


CastSpellFromPointToPoint()

Spoiler:  
Show

Function CastSpellFromPointToPoint(Actor akSource, Spell akSpell, Float StartPoint_X, Float StartPoint_Y, Float StartPoint_Z, Float EndPoint_X, Float EndPoint_Y, Float EndPoint_Z)

  • akSource: The caster.
  • akSpell: The spell to cast.
  • StartPoint_X: The X position of the starting point.
  • StartPoint_Y: The Y position of the starting point.
  • StartPoint_Z: The Z position of the starting point.
  • EndPoint_X: The X position of the ending point.
  • EndPoint_Y: The Y position of the ending point.
  • EndPoint_Z: The Z position of the ending point.


Example: CastSpellFromPointToPoint(FeraldaRef, IceSpike, 150.0, 50.0, 70.0, 300.0, 85.0, 988.0)
-> Have Feralda cast a spell from point A (with coordinates: 150.0, 50.0, 70.0) to point B (with coordinates: 300.0, 85.0, 988.0).


CastSpellFromHand()

Spoiler:  
Show

Function CastSpellFromHand(Actor akSource, Spell akSpell, Bool IsLeftHand, Float DistanceVar = 2000.0, Float HeightVar = 100.0, Bool UseCustomObject = False, Form akObjectBase = None, Float Offset_NoSneak_Left_X = 30.0, Float Offset_NoSneak_Left_Y = -30.0, Float Offset_NoSneak_Left_Z = 110.0, Float Offset_NoSneak_Right_X = 30.0, Float Offset_NoSneak_Right_Y = 30.0, Float Offset_NoSneak_Right_Z = 110.0, Float Offset_Sneak_Left_X = 30.0, Float Offset_Sneak_Left_Y = -30.0, Float Offset_Sneak_Left_Z = 70.0, Float Offset_Sneak_Right_X = 30.0, Float Offset_Sneak_Right_Y = 30.0, Float Offset_Sneak_Right_Z = 70.0)

  • akSource: The caster.
  • akSpell: The spell to cast.
  • IsLeftHand: True if cast from the left hand, false if cast from the right hand.
  • DistanceVar: Optional, the distance from the caster, where the destination marker is spawned. Default is 2000 units.
  • HeightVar: Optional, the height difference at which destination marker is spawned. Default is 100 units.
  • UseCustomObject: Optional, set to true if you want to assign akObjectBase to a custom object. Default is false.
  • akObjectBase: Optional, base object of the markers to spawn. Default is set to an xmarker.
  • Offset_NoSneak_Left_X: Optional, X Offset for left hand when the actor is not sneaking. Default value is 30.0.
  • Offset_NoSneak_Left_Y: Optional, Y Offset for left hand when the actor is not sneaking. Default value is 30.0.
  • Offset_NoSneak_Left_Z: Optional, Z Offset for left hand when the actor is not sneaking. Default value is 110.0.
  • Offset_NoSneak_Right_X: Optional, X Offset for right hand when the actor is not sneaking. Default value is 30.0.
  • Offset_NoSneak_Right_Y: Optional, Y Offset for right hand when the actor is not sneaking. Default value is -30.0.
  • Offset_NoSneak_Right_Z: Optional, Z Offset for right hand when the actor is not sneaking. Default value is 110.0.
  • Offset_Sneak_Left_X: Optional, X Offset for left hand when the actor is sneaking. Default value is 30.0.
  • Offset_Sneak_Left_Y: Optional, Y Offset for left hand when the actor is sneaking. Default value is 30.0.
  • Offset_Sneak_Left_Z: Optional, Z Offset for left hand when the actor is sneaking. Default value is 70.0.
  • Offset_Sneak_Right_X: Optional, X Offset for right hand when the actor is sneaking. Default value is 30.0.
  • Offset_Sneak_Right_Y: Optional, Y Offset for right hand when the actor is sneaking. Default value is -30.0.
  • Offset_Sneak_Right_Z: Optional, Z Offset for right hand when the actor is sneaking. Default value is 70.0.


Example: CastSpellFromHand(Game.GetPlayer(), Firebolt, false) -> Have the player cast cast a Firebolt from their right hand.


Requirements


Source

Github Link

FAQ

Q: ESPFE?
A: This doesn't actually use an ESP.

Q: Is this compatible on a existing save?
A: It should work yes.

Q: Will you make a patch for X?
A: Maybe eventually, but not right now.

Q: I have a suggestion to improve the mod. Can you do it?
A: Maybe, if I have time and I like the idea, I'll consider it.

Q: Will you port this to <insert other version of Skyrim>?
A: It requires SKSE and won't work on any platform that doesn't support SKSE.

Q: I have this cool idea. <insert idea> Will you add this?
A: Maybe. If I like it and doesn't take too much time/effort.

Q: Does this work on Skyrim 1.6+, aka "Anniversary Edition"?
A: As far as I know, it should. I'm still on SE 1.5.97 myself so I don't know for sure. Apparently it still doesn't work with AE. I don't know why. If anyone could help me solve this, please do, as I'm baffled as to why.  It should work for AE now.