Jump to content

Recommended Posts

View File

Automatic Ammo Unequip on Sexlab Animations

 

This is just a very light weight little script that checks if any of the actors involved in a Sexlab sex scene has arrows or bolts equipped.
If they do, it unequips them.
That's about it.

 

The idea for the script code is 90% stolen from the source code of a seemingly dead mod named Cupid - Arrow Be Gone.

 

So what's the difference to Auto Unequip Ammo, you ask?
Well, first it does work for me which that mod never did. And it works on all actors involved in a Sexlab sex scene, not just on the player character and followers.
It's not customizable either which is a plus in my book because this is supposed to be a very simple feature.

 

And before I forget to mention it:
What this mod doesn't do is check for arrows or bolts added by anything else than the main game and its two DLCs (not counting Hearthfire).
I needed to put all known ammo items in a formlist for this to work so if someone is using a mod that adds new arrows or bolts then it won't work with those.
But that's easy to fix, and if you don't know how just ask me and I'll make you a custom version of that formlist.
Here's a quick how to in case you want to do that yourself instead (which would be great of course :P).
I'll add all custom esp files that get uploaded in the mod topic to that post too so you can find them easier.

 

Credits:
PROXiCiDE for that Cupid source code
Ashal for the Sexlab API
Andy14 for convincing me that this is easy to do, because he uploaded another very short script with the same purpose (which I didn't use in the end though)


  • Submitter
  • Submitted
    06/15/2017
  • Category
  • Requires
    Skyrim + all DLC, Sexlab
  • Special Edition Compatible
    No

 

Link to comment

As usual, great mod :) AUA never works on followers for me, only PC and a mass orgy looks hilarious, sad and ludicrous at the same time. I usually pan the camera to look at the sky because of the quivers (not the shaking kind).

 

Does this coexist with AUA or does one have to uninstall and make a clean save?

 

And will this unequip only on SL scenes or also when the bow is unequipped eg when walking the world or in combat with swords/magic?

Link to comment

I don't see any reason why it should conflict with AUA. Didn't test that though, because as I wrote, AUA didn't really work for me for some reason, not even for the player character.

You don't need a clean save either. Just install this and see if it works. It's just a script that checks if ammo is equipped on the characters involved in a sex scene (only when initiated through Sexlab though, this doesn't work with OSA) and if it is then it gets unequipped. So it should not cause any conflicts whatsoever.

 

And no, there is no connection to the bow. Unequipping that doesn't trigger anything in this script. It's just a few lines of code really.

Link to comment

for PC in SL scene (not follower) and for general NPC not at all.

This must be it. Never cared for the rest of the functions of that mod, that arrow quiver on the back doesn't bother me as long as the PC isn't supposed to be naked. ^^

Link to comment

 

for PC in SL scene (not follower) and for general NPC not at all.

This must be it. Never cared for the rest of the functions of that mod, that arrow quiver on the back doesn't bother me as long as the PC isn't supposed to be naked. ^^

 

 

Thanks Bazinga, one very annoying issue gone.

 

Link to comment

Thanks for this. However I do have a request, could you add the Skyforge Steel arrows from Amidianborn's Book of Silence mod?

I suppose these are inside aMidianBorn book of silence_WEAPONS?

Downloading atm.

 

If you wanna do it on your own though:

>>> deleted because the Creation Kit is a piece of crap. Honestly. <<<

 

edit:

So forget about CK and use TES5Edit instead.

Start it through your mod manager, rightclick the mod list that shows up and "Select None". Then select only aMidianborn_Skyforge_Weapons.esp and SexlabAmmoUnequip.esp.

Now click Ok and wait until the message "Background Loader: finished" appears.

 

Rightclick SexlabAmmoUnequip.esp in the list to the left and select "Add Masters". Add the aMidianBorn_Skyforge_Weapons.esp as master file.

 

Now select the AmmoFormList in the tree on the left (it's in the SexlabAmmoUnequip.esp) and rightclick on the empty field I marked red here:

post-162794-0-56938900-1497551041_thumb.jpg

 

Click Add.

Yes, you are absolutely sure.

 

Inside the tree for the Skyforge weapons mod go to Ammunition and select the only entry in there.

Doubleclick on the FormID text box on the right side and copy the content (SkyforgeSteelArrow "Skyforge Steel Arrow" [AMMO:0500332A])

 

Insert that into the entry that you added to the AmmoFormList before (rightclick -> edit).

 

Done. Close TES5Edit and confirm that you want to save the change.

 

 

List of custom esps and the required mods (updated for v1.02):

 

aMidianborn Skyforge Weapons: 

aMidianborn_Skyforge_Weapons compatible.7z

 

The Avengers Hawkeye Arrow:

TheAvengersHawkeyeArrowWepMod compatible.7z

Link to comment

Ok, I forgot to include the "FollowerIronArrow" in the formlist.

But how was I supposed to know that followers use a different kind of iron arrows?

 

Added them so Lydia & co. will unequip that endless supply of special iron arrows too now.

 

@Azzhat:

I think I also added that edit to the Skyforge arrow version I did for you.

Link to comment

Ok, I forgot to include the "FollowerIronArrow" in the formlist.

But how was I supposed to know that followers use a different kind of iron arrows?

 

Added them so Lydia & co. will unequip that endless supply of special iron arrows too now.

 

@Azzhat:

I think I also added that edit to the Skyforge arrow version I did for you.

 

With FormType 42 it would be independent of DLC's, Mods, Follower - always works.
Keywords is generally a little bit ... wobbly. ;)
Link to comment

 

Ok, I forgot to include the "FollowerIronArrow" in the formlist.

But how was I supposed to know that followers use a different kind of iron arrows?

 

Added them so Lydia & co. will unequip that endless supply of special iron arrows too now.

 

@Azzhat:

I think I also added that edit to the Skyforge arrow version I did for you.

 

With FormType 42 it would be independent of DLC's, Mods, Follower - always works.
Keywords is generally a little bit ... wobbly. ;)

 

:D

Hi Andy. And sure, you are right of course. I saw that that piece of Papyrus code you posted in another thread (forgot where though) and at first I wanted to use it too. But then I somehow stumbled across that Cupid source code and I prefered the way it was handled there.

 

The thing that bothered me was that (and you wrote that yourself) checking for formtype checks every single item in the inventory and a lot of other stuff too (can't remember exactly, something about eyebrows and stuff like that). And that sounded like it would create a lot of unnecessary Papyrus stress because naturally most of the stuff you find on any given character is not ammo.

 

I never tried it your way though and I don't know how to compare script efficiency either so maybe that wouldn't be a problem.

 

And then I figured that there are not that many mods adding new ammo out there and if anyone needs a custom version he can just ask and I'll do it in a few minutes.

Link to comment

For my own mod i'am working something similar. When the player becomes etherreal (=ghost) all equipped armor, weapons and arrows are dropped to the ground.

I do not use any formlist only the arrows must have the proper keyword. So i do not need any formlists.

Instead of dropping arrows and weapons unequipping is very similar.

 

If it is for interest here an extract of my own script

 

;----------------------------------------------------------
;
;----------------------------------------------------------

Function Drop_Equipped_Ammo()
    
    ; search inventar until equipped ammo is found
   
   form x
   int  i = _aPlayer.GetNumItems()
            
   while (i > 0)
        i -= 1
        x = _aPlayer.GetNthForm(i)
                
        if (x && x.HasKeyword(VendorItemArrow))
                 
         if _aPlayer.IsEquipped(x)
            drop_object (x, _aPlayer.GetItemCount(x))
            i = 0;
            endif
      endif
    endwhile
 
EndFunction

;------------------------------------------------------------------

Function Drop_Player_weapons (int aiHand)

   weapon   weapon_part
   armor    armor_part
 
   int      i_weapon_type
   
  ;/0: Nothing (Hand to hand)
    1: One-handed sword
    2: One-handed dagger
    3: One-handed axe
    4: One-handed mace
    5: Two-handed sword
    6: Two-handed axe/mace
    7: Bow
    8: Staff
    9: Magic spell
    10: Shield
    11: Torch
    12: Crossbow /;
   
   i_weapon_type = _aPlayer.GetEquippedItemType (aiHand)
   if i_weapon_type && (i_weapon_type != 9)
      if (i_weapon_type == 10)
         armor_part = _aPlayer.GetEquippedShield()
         drop_object (armor_part)
      else
         weapon_part = _aPlayer.GetEquippedweapon()
         drop_object (weapon_part)
      endif
   endif;
   
EndFunction

;------------------------------------------------------------------------------
;  
;------------------------------------------------------------------------------

function drop_equipment ()
   form armor_part
   ;
   Log ("drop_equipment")
   armor_part = _aPlayer.GetWornForm(0x00000004)
   if (Is_body_covering (armor_part))
      drop_object (armor_part)
   endif
   
   armor_part = _aPlayer.GetWornForm(0x00000080)
   drop_object (armor_part)
    
   armor_part = _aPlayer.GetWornForm(0x00000002)
   drop_object (armor_part)
   
   armor_part = _aPlayer.GetWornForm(0x00000008)
   drop_object (armor_part)
    
   Drop_Player_weapons (0)
   Drop_Player_weapons (1)
   Drop_Equipped_Ammo()
 
EndFunction

With regards

Link to comment

Thanks, BadIdea57

 

On a quick glance that approach looks like a mix between the formtype script Andy wrote and mine. You also scan the complete character container but instead of checking for formtype 42 you use the vendoritemarrow keyword I used too. Of course you don't need a formlist then, because you get the form ID of the items you want to drop by scanning the character container.

I only scan the worn items and drop the ones that have that keyword. But to drop them I need to have them in the formlist, at least I couldn't find another way to return the ID of the items detected by WornHasKeyWord.


Hi Bazinga,

 

just installed your mod and while it makes the arrows invisible, the hunting bows still appear on NPC during sex

Doesn't Sexlab unequip those given the right stripping settings in the Sexlab MCM?

Link to comment

Thanks, BadIdea57

 

On a quick glance that approach looks like a mix between the formtype script Andy wrote and mine. You also scan the complete character container but instead of checking for formtype 42 you use the vendoritemarrow keyword I used too. Of course you don't need a formlist then, because you get the form ID of the items you want to drop by scanning the character container.

I only scan the worn items and drop the ones that have that keyword. But to drop them I need to have them in the formlist, at least I couldn't find another way to return the ID of the items detected by WornHasKeyWord.

Hi Bazinga,

 

just installed your mod and while it makes the arrows invisible, the hunting bows still appear on NPC during sex

Doesn't Sexlab unequip those given the right stripping settings in the Sexlab MCM?

i cant find a setting in sexlab to unequip on npcs

 

Link to comment

It's under Timers and Stripping.

And there are 3 different submenus there (stripping settings for normal, foreplay and aggressive animations), afaik for some reason that I never understood the aggressor doesn't have the weapon slot checked in the default Sexlab strip setting for aggressive animations.

 

Oh, and there are also stripping settings in the Defeat MCM in case you use that mod. Don't ask me about how both mods interact in that regard, I don't know. I only know that bows always get unequipped in my game.

Link to comment

 

 

Ok, I forgot to include the "FollowerIronArrow" in the formlist.

But how was I supposed to know that followers use a different kind of iron arrows?

 

Added them so Lydia & co. will unequip that endless supply of special iron arrows too now.

 

@Azzhat:

I think I also added that edit to the Skyforge arrow version I did for you.

 

With FormType 42 it would be independent of DLC's, Mods, Follower - always works.
Keywords is generally a little bit ... wobbly. ;)

 

:D

Hi Andy. And sure, you are right of course. I saw that that piece of Papyrus code you posted in another thread (forgot where though) and at first I wanted to use it too. But then I somehow stumbled across that Cupid source code and I prefered the way it was handled there.

 

The thing that bothered me was that (and you wrote that yourself) checking for formtype checks every single item in the inventory and a lot of other stuff too (can't remember exactly, something about eyebrows and stuff like that). And that sounded like it would create a lot of unnecessary Papyrus stress because naturally most of the stuff you find on any given character is not ammo.

 

I never tried it your way though and I don't know how to compare script efficiency either so maybe that wouldn't be a problem.

 

And then I figured that there are not that many mods adding new ammo out there and if anyone needs a custom version he can just ask and I'll do it in a few minutes.

 

 

 

At first I thought it would cost performance - the loop.
I've measured it with several actors. It is only measurable from about 10 actors - I believe it was 0.2 milliseconds.
 
At the moment i looking for a 100% solution for torches - these things are really annoying.
Link to comment

Hi. How do you write this not working just for addons. Im using moded deadric arrows and that work fine . But added new items no :(. If you can ,please do extension for these : bow and arrows : http://www.nexusmods.com/skyrim/mods/28390/

Sorry, nearly missed this.

 

As mentioned in the mod description I'll add all custom versions of the esp file to this post here.

You will find the Avenger Hawkeye Arrow one there too.

Link to comment

That's unfortunate. Normally bound arrows wouldn't be a problem because they get dispelled when the bound bow gets unequipped anyway.

...

Are you sure that these are the same arrows? Sounds more like some new arrow type added by that follower mod that's just using the same texture and visual effect.

Which follower mod is it btw?

 

 

edit: I think I will delete bound arrows from the formlist again, doesn't make sense to have them in there, but I didn't know that before because I never used that Bound Bow spell. Not that having them in there would do any harm, the script kicks in after the characters go back to non-combat stance anyway so the arrows are already gone then.

And I just checked, even if the script was faster the then unequipped Bound Arrows would still vanish from the inventory as soon as the spell stops working (which is as soon as the character leaves the combat stance or equips another weapon).

Link to comment

Yeah, it's the standard vanilla bound arrows, formID 10b0a7. The mod is "Companions and Followers" one of the female followers has the vanilla bound items in her inventory as her permanent gear.

 

I'm not sure what you are saying in your edit, are you going to update the mod to include the vanilla bound arrows? I don't see any reason not to, if an NPC has them in their inventory they can just requip them, and if an NPC actually used the bound bow spell, they will expire anyway.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use