-
Notifications
You must be signed in to change notification settings - Fork 0
Function list
This script regroup base function needed by other scripts and some QoL functions that i use.
Add import _SMF_Utils
at the start of you script (after properties)
-
Closemenu()
Convenient function, Close menu properly by disabling / enabling payer control quickly -
ClosemenuAlt(string menu)
alternate way to close menu like crafting or training
GetPlayerDialogueTarget()
Detect which actor is currently talking to the player. Return Actor Ref
ActorIsNearPlayer(Actor akActor)
Detect if actor is in same cell as the playern and distance is inferior to 512 units, Return true
GetActorPosition(Actor akSource)
Returns an array which contains actor coordinates 0 = X, 1 = Y and 2 = Z
GetOffsets(Actor akSource, Float afDistance = 100.0, float afOffset = 0.0)
Returns an array which contains objectif distance 0 = Y Distance, 1 = X distance
IsSitting(Actor akActor)
Test if game considers that actor is sitting then check if he uses an appropriate furniture as game make no difference between leaning against a pole or sitting, Return True
ListObjectRefInCell(Int aiFormtype, ObjectReference akObject = None, Cell acCell = none)
return an array from a cell, Uses akObject's parent cell or acCell if a cell is specified and akObject is empty
Min(Float afA, float afB)
Returns the lowest value between afA & afB
Max(Float afA, float afB)
Returns the highest value between afA & afB
QoL function to manipulate diverse kind of array
Add import _SMF_ArrayUtils
at the start of you script (after properties)
ArrayAddForm(Form[] akMyArray, Form akMyForm)
Adds a form to the first available element in the array.
ArrayRemoveForm(Form[] akMyArray, Form akMyForm, bool abSort = false)
Removes a form from the array, if found. Sorts the array using ArraySortForm() if abSort is true.
ArraySortForm(Form[] akMyArray, int akI = 0)
Removes blank elements by shifting all elements down.
ArrayClearForm(Form[] akMyArray)
Deletes the contents of this array.
ArrayTotalCountForm(Form[] akMyArray)
Counts the number of indices in this array that do not have a "none" type.
ArrayHasForm(Form[] akMyArray, Form akMyForm)
Attempts to find the given form in the given array, and returns the index of the form if found.
ArrayCountForm(Form[] akMyArray, Form akMyForm)
Attempts to count the number of times the given form appears in this array.
Same functions exist for each kind of data you want to store in your array (you can't store multiple type in one array), check script for more details, all are build on same template.
Type list:
- Form
- Int
- Float
- Keyword
- Actor
- ObjectReference
Optimized Dress / Undress player script, based on Outfit Switcher by White Shadow and Updated Outfit Switcher by Spanksh.
Dress UnDress NPC Script
DressUndressPlayer(Form[] akListEquip,form[] akListL, bool abUnequiped)
To use this script you need to use an array, a form and a bool properties
Ex:
_Form[] Property SMF_EquipList Auto Hidden; (store player outfit)
_Form[] Property SMF_EquipListL Auto Hidden; Store Left hand item
_bool property SMF_UnequipGearAlreadyExecuted = False Auto Hidden; Script status
You must initialise array with these numbers :
_SMF.SMF_EquipList = new Form[32] ;It is the equip slot number avialable
_SMF.SMF_EquipListL = new Form[1] ;Left hand will need only one slot.
_Use function like this : _
__SMF_UnequipGearAlreadyExecuted = DressUndressPlayer(_SMF_EquipList, _SMF_EquipListL, SMF_UnequipGearAlreadyExecuted)
First time the function is called it will undress the player, and switch the bool to true
Second time it will dress the player and switch the bool to false.
Danwguard and DragonBorn amnos are added by script to ensure compatibility with mod that requires to disable it (like enderal)
The amnolist use a hardcoded array to share it with other mods wich uses this script to avoid useless multiple detection and ressource sake.
See script for more detail.
QoL function to detect player location or weather condition.
To spare ressource, it pick campfire / frostfall result if they are isntalled instead of doing detection by itself.
_Add import _SMF_LocationUtils.psc
IsunderShelter()
Detect if player is under a shelter, return true or false
- IsunderTent()
Detect if player is under a campfire tent, return true or false
All location test compare location keyword with keyword array (faster than form) build at SMF initialisation
GetPlayerlocationType()
Return a int who matches location category (check script for value)
All following functions are used to categorize player location to fit my needs for different mod, name are easy to understand. All return true / false
Check _SMF_API.psc to understand better how location are classified.
General category:
IsInDangerousPlace()
IsinSafePlace()
IsInUnhealthyArea()
IsInHealthyArea()
Detailed category:
IsInSupernaturalAndultraUnhealthyPlace()
IsInAbandonnedAndVeryUnhealthyPlace()
IsInCampAndHighUnhealthyPlace()
IsInCampAndAverageUnhealthyPlace()
IsInDwemerAndLowUnhealthyPlace()
IsInCaveAndLowUnhealthyPlace()
IsInLowPopulatedAndLowHealthyPlace()
IsInPopulatedSafeAndAverageHealthyPlace()
IsInSupernaturalAndHighHealthyPlace()
IsInPopulatedAndHighHealthyPlace()
IsInSafeAndUltraHealthyPlace()
Test weather condition:
IsPleasant()
IsCloudy()
IsRaining()
IsSnowing()