A performant framework for finding available sex actors and pairing them together, without interrupting quests, scenes, or player dialogue.
The only reason to install this mod is if another mod requires it. You can create your own ASF mod using only an SPID config file, and many users do just that. Yet some of the more advanced features are exclusive to Papyrus Scripting.
Why is this needed?
The SexLab Framework is wonderful. But there are things it does not handle. It does not help you find a good spot for animations to take place. It offers no functionality for marking an actor as busy or free. It has little functionality for finding sex partners. Nor does it offer NPCs the ability to have preferences (Oral, Rough, Missionary...)
Few of these caveats impact dialogue and quest-sex mods. Which is why so many of those exist. But all of these become difficulties when you try to build a mod where NPCs autonomously have sex. Autonomously choose to have sex without the player prompting them, or a story quest fully controlling them.
Mods that add autonomous sex build all of that functionality from scratch. This is incredibly difficult. You will find various degrees of success. Most mods that do this are known for their bugs. People often temporarily disable mods like Slaverun or Public Whore, while playing other quests, because of these issues. Now that ASF exists, all mods that feature autonomous sex should use its simple API instead of building their own -- in my unbiased opinion 😁. They will find less bugs, unparalleled customization for user preference, and more realism.
Benefits for Mod Users when a sex mod switches to ASF
- Unlikely to have your quests, scenes, or dialogue interrupted by sex.
- Extensive customizability via the MCM, SPID, and KID. Choose who has sex and what they like.
- ASF can find nearby furniture and objects and play SexLab animations with them. What furniture and what animations play is customizable via KID.
- Actors can have animation preferences (like doggystyle or anal) that are distributed via SPID. ASF will more frequently choose preferred animations. Fully customizable for the user, like any SPID config.
- Locations (such as SolitudeJail) can also have preferences, distributed via KID. Also fully customizable. Child locations inherit preferences from their parent if they lack one of their own, so you can distribute preferences to an entire region or just one home.
Addons
There are a couple addons in the downloads area. These can be downloaded and installed after the main mod.
-
SexLab Aroused (ASF_Addon_SexLabAroused_vX-X-X.zip) — Makes arousal a consideration when pairing actors. Strongly recommended you install this. The thresholds are configurable in the MCM. Most SLA variants are supported. Including newer performance-friendly editions such as OSLA and SLO Aroused NG.
-
Scene Positions (ASF_Addon_ScenePositions_vX-X-X.zip) — Default KID configuration file for where actors can have sex. Distributes bed and bondage keywords to relevant objects. Also filters which animations happen at these locations. Strongly recommended you install this.
-
Base Object Swapper (ASF_Addon_BOS_Activators_vX-X-X.zip) — Increases the number of available locations you can prefer for sex scenes. New locations include Rugs and tables.
- Skip Beasts & Elder Races (ASF_Addon_SkipBeastsElders_vX-X-X.zip) — This is a customized version of ASF's SPID distribution file. It causes ASF to ignore the following races: ElderRace, ElderRaceVampire, KhajiitRace, KhajiitRaceVampire, ArgonianRace, ArgonianRaceVampire. You can install this addon as-is, or use the .ini as a template to customize ASF to your liking.
FAQ
-
Can I manually mark an actor as an initiator or recipient using the dev console? Open the console, click on the actor, and type AddSpell ASF_Ability_Include_Initiator or AddSpell ASF_Ability_Include_Recipient. Similarly you can exclude with the spells ASF_Ability_Exclude_Initiator and ASF_Ability_Exclude_Recipient. Use RemoveSpell if you ever wish to undo.
-
Is there Creature support? No. If somebody is interested in building and maintaining this, please reach out to me. It likelymakes sense to have creature support be a separate addon mod with its own additions to the API. In my experience creatures often require a largely separate set of code, to handle all of the races and actor sorting.
- Is there builtin futa support? No. However enabling all gender pairings in your MCM (gay, lesbian, straight) will cause ASF to stop caring about gender.
Technical Details for mod authors
Expand the spoiler to read about how the framework functions.
ASF makes it easy to add sexual autonomy to NPCs, and handles all of the common pitfalls for you. If you have ever implemented sex between randomly paired NPCs, you know how deep of a rabbit hole this endeavor is. It can take hundreds of gameplay hours to find all of the edge cases, which interrupt ongoing quests/scenes. At times these edge cases break immersion, other times they break player quests. Either way they frustrate the player. This framework's goal is to handle as much of that for you as possible, while being far more performant and responsive than your typical actor search. It builds on my knowledge maintaining an autonomous sex mod, and then finding and patching edge cases.
ASF starts by creating a list of relevant actors, it distributes a keyword to them (ASF_ActorBase_Included) using SPID. This step filters out children, mannequins, etc. All before the main menu has loaded. It also allows for user preference, where some users might tweak their SPID to filter out beast races, elderly females, that sort of thing. The vast majority of actors will end up completely ignored by ASF, because they are not relevant to this type of mod.
The actors that receive that keyword will be given a spell. The spell effect starts when an actor enters the same area as the player. That spell listens for OnPackageChange. It then checks to see if the current package can be safely interrupted by a sex scene. If it is safe to interrupt, the actor is dynamically given the ASF_PackageValid keyword. If they can not be interrupted, the keyword is temporarily removed.
Thus when you enter an area, all actors who are currently relevant to autonomous sex will have a keyword assigned to them. Using the function FindAllReferencesWithKeyword we can instantly get a list of nearby prevalidated actors. ASF provides a convenient set of functions that are internally powered by the above. These functions will honor user MCM options, and help you avoid additional pitfalls.
ASF breaks actors out into two groups. Those who initiate sex, and the actors they can have sex with. Initiators and Recipients. An actor can be in both groups. But you might opt to restrict some actors to just one of the two, for example slaves will commonly be recipients only. If you want to find a valid initiator to start a sex scene, you can use the ASF function FindActors_Initiator(). If you then want to find a valid recipient for them, you can use the function FindActors_Recipient(Initiator=ActorYouJustFound).
Initiators are different from recipients in a few ways. For example, the default MCM settings will not mark an initiator as valid if they are sleeping. But a recipient would still be a valid target for someone's sexual interest, even if they are sleeping. So a sleeping actor might continue being a valid recipient once they go to bed, but they will stop initiating sex scenes since they are asleep.
ASF's FindActor functions will do additional last minute filtration on actors, ensuring that they are not engaged in temporary actions that we should not interrupt. It filters them out using Condition Functions, so the performance rivals alias fills. But you do not need to build complex sets of aliases yourself, ASF provides you that level of performance via a simple API instead. It further handles distance in a realistic way, preferring to pair together actors who are closer together, and stopping as soon as a valid pair is found.
ASF can optionally be provided a SexLab Thread, which it will populate with valid actors. If an actor can not be added, it continues searching for the next closest match. It can optionally reserve a thread when a valid actor is found, which can notably reduce how much work SexLab has to do for autonomous sex. The function StartRandomScene() provides a great demonstration of how to use all of the above functionality. And it might be the only function your mod uses, depending on how straight forward your needs are.
ASF is extremely flexible. Each function in the API is documented in the code, in the same manner that SexLab documented its functions. Just open ASF_API.psc to get started.
Some additional features
- The search functions can return multiple actors, making it easy to start group sex scenes.
-
On each PackageChange ASF adds the following keywords to an actor, if they pass the relevant conditions:
- ASF_PackageValid_Initiator — Current package indicates that they are a valid initiator. If the SLA integration is installed, then this actor is also currently aroused.
- ASF_PackageValid_Recipient — Currently valid recipient.
- ASF_PackageValid — Is either a valid initiator, recipient, or both.
- ASF_ActorGroup_PlayerTeam — Actor is a follower, includes temporary followers from quests. Also includes player.
- ASF_ActorGroup_Guard — Actor is a guard.
-
You can mark actors as Initiators or Recipients by giving them keywords.
-
The keywords:
- ASF_Initiator_Included
- ASF_Initiator_Excluded - Takes precedence over the Included keyword.
- ASF_Recipient_Included
- ASF_Recipient_Excluded - Takes precedence over the Included keyword.
- These keywords can be directly assigned to the NPC_ via your plugin, or SPID.
- Can be assigned to a clothing item. While an actor wears that clothing they will inherit the keywords effects.
- Can be added to a MagicEffect. When this effect is active on an actor they will inherit the effects of the keyword. This is especially useful for temporary exclusions. You can create a spell (or copy one from ASF) that temporarily excludes an actor. Cast it on the actor, and then dispel it when you no longer need to exclude the actor. It is not recommended to directly cast the ASF exclusions spells on actors, because these might get dispelled by ASF itself or by another mod. Instead create your own spell by duplicating an ASF one. Cast the duplicate, No other mod will dispel it because it is your spell.
-
The keywords:
- You can distribute the keyword ASF_ActorBase_Included directly to any actor that your mod needs to be included in ASF. Assigning this keyword directly will override user preference; which is beneficial in cases where user preference could break your mod. For example your story quest might expect a specific Argonian NPC to have sex, but user preference causes ASF to ignore all Argonians. On the other hand you can distribute the keyword ASF_ActorBase_Excluded to anyone who should always be ignored by ASF.
- You can distribute custom keywords to actors via any convenient means: using a plugin, SPID, or given dynamically at run time. Then search for those actors using ASF FindActor functions. You can pass these functions multiple keywords. Give it your keyword to limit results to your actors, and pass an additional PackageValid keyword to further narrow the result to only valid actors
Extra advanced features
-
Can create your own custom Condition Functions for the last minute validation, and use that in your searches. The primary use case for this would be if you wanted to further filter actors beyond the SexLab valid checks that ASF does.
- Say you want to quickly find valid recipients that are currently under the influence of a calm spell. You can accomplish that by copying the recipient valid condition list, and then adding your extra checks.
-
Before diving this deep into ASF's flexibility, you should first familiarize yourself with the EvaluateConditionList() function that powers it.
- Each condition list is a MGEF, which ASF internally refers to as Evaluators.
- ASF passes an Evaluator MGEF to the above function, along with a subject actor to evaluate.
- Optionally ASF can even be told who this actor will pair with, in which case they will be made the target in the Condition Functions. The currently evaluated actor remains the subject.
- The condition list evaluates the subject and optional target. If the subject passes all of the conditions, they are included in the returned list of actors. If they fail to pass they are excluded from your search.
-
You can have ASF add/remove keywords to actors during certain events, based on whether the actor fails or passes the conditions you specify. You just need to add your custom Evaluator to the appropriate FormList. Assign your Evaluator the keyword that you want ASF to manage. Inspect the following FormLists to better understand how this works.
- ASF_FLST_Evaluators_Enduring — Evaluators in this list will run once, when the actor enters the currently loaded area. This list is useful for conditions that are unlikely to change very often. For example, whether or not the actor is part of the Guard faction.
- ASF_FLST_Evaluators_Package — Evaluators in this list will rerun every time the actor switches packages. Like the above, keywords will be added/removed based on whether the actor passes the condition.
Permissions & Copyright
I want the community to own this mod, not me.
- You have my permission to use this API in any mod.
-
You can create forks of this mod, so long as they are also open source and free.
- Before publishing a fork, I kindly request that you contact me. Whenever possible I would love to integrate others work into the main branch here. But if am ever AWOL, or you simply do not want to work with me, you have permission to publish your fork.
- Please share any patches or feature ideas you have with me. I can post this project to GitHub so we can collaborate.
Edited by kaxat
What's New in Version 2.0.4 RC
Released
The latest stable version of this mod is still v1.x. Version 2 is currently a Release Candidate (RC). It is nearing stable release. Only one known bug remained in the previous version. Hopefully this patches it.
The ScenePos Addon is also receiving a patch alongside ASF v2.0.4. Download both.
ASF v2.0.4 RC (2026-03-22 ASF__v2-0-4_RC.zip)
-
New
- Added MCM option that tells ASF to never center scenes. This allows other mods to center scenes. Mods like furniture frameworks.
-
Tweaks
- Improved error message when using ASF Allure - Player spell and SexLab generates an actor invalid code.
- Now logs to console when any NPC generates an actor invalid code, assuming console logging is enabled in MCM. Should make it easier on some users to find out why some actors are not animating.
- Added more evaluators to debug spell.
- Reduced ScenePositions logging.
-
Fixes
- Altered temporary test code that is helping isolate a conflict, where scenes animate in the sky or beyond the bounds of a map. Possible that issue is now patched. Need users to confirm. If this happens to you please post an ASF.0.log file and if possible your latest crash log. Crash log contains load order and I will use that to try to find the conflict. Thanks to @layzpeon & @lazycai for being so helpful diagnosing this.
- Corrected some typos. Including 2 in magic effects that were reported by @Messiah2002. Thank you for helping improve the mod!
- Prevented some harmless errors from making their way into the Papyrus.0.log.
- Use alternate SexLab animation search when running SexLab without patches. Attempts to improve gendered animation selection, even if you do not have SL P+ nor SL Utility Plus installed. Credit to @layzpeon & @leighn for reporting this.
Scene Positions - v2.0.1 (2026-03-22 ASF_Addon_ScenePositions_v2-0-1.zip)
- Fix: Updated ANIO_KID.ini file to exclude SexLabSexMarkers from the "Lean Marker" animation spots. This could cause animations to play on top of each other.
Install this like you would any other mod. The plugin is a .esp flagged as an .esl, so it takes up no room in your load order.
Requirements
- SexLab v1.x or P+
- powerofthree's Papyrus Extender Requires version 5.3+. Recommend version 6+ for the performance improvements.
- SPID - Spell Perk Item Distributor If running version 6.x of this mod, 6.8.1 was the last version to fully support outfits. If running a 7.x version, then 7.2 restored outfit support but is still in beta.
Soft requirements for all features to work
- KID - Keyword Item Distributor Used by Scene Positions feature to assign preferences to objects.
- ANIO - AnimObject Swapper Used by default Scene Positions config to swap out the throne use in SexLab animations with a local variant. The Dragonsreach throne gets used in Whiterun, Elisif's throne while in Solitude, etc.
Uninstall
This is as safe as any plugin can be to uninstall. Ideally you will uninstall in a secluded area like QASmoke, after dismissing any followers. Then disable this mod in the MCM and click the Uninstall button.