Jump to content

Recommended Posts

1 hour ago, LostDremoraDream said:

my crash log said toll collector, it happens relatively early in my game when I do test runs and I don't have any enforcers nearby. Specifically,
I crash in Riften whenever I enter the Riften World Cell, so when I leave the Bee and Barb for example, I crash. And the log says the Toll Collector over by the docks is crashing my game. It's very specific and very wierd.

 

I do not get a CTD with that Argonian Toll Collector in Riften; however, his sandboxing is weird for me. He is always working at the Riften blacksmith's smelter instead of standing by the gate to enforce tolls.

 

The sandboxing package _SLS_TollCollectorSandboxTight is only used by 2 Toll Collectors - the Argonian and Khajiit in Riften.

 

Maybe @Monoman1 can shed some light on that particular sandboxing package. Perhaps its radius should be shrunk down? Or perhaps its World Interactions flag should be turned off?

Edited by Herowynne
Link to comment

I added keywords to Ninirim Collection 6.0 https://www.sunkeumjeong.com/post/sunjeong-ninirim-collection-6-0  

 

I added SLSurvival Bikini Armor Keyword to 90% of them, but I also added Baka SLA keywords to all of them. https://www.patreon.com/posts/slap-redux-1-1v-21212492

 

I don't care to get credited for it, but I thought others might be interested in having it. I tried to follow Baka's guide to keywords, but with such diverse outfits with many pieces, and a lot of keywords.. I'm sure I didn't use them all perfectly as intended, but I think it's pretty good. I've never uploaded before, I just add the .esp from my MO2 mods folder right?

[SunJeong] Ninirim Collection.esp

Link to comment
2 hours ago, clesh2311 said:

Does anyone know where you can get empty cumtainers? Do you craft them, or are they sold or given by NPCs? I've only been able to get them through console commands, uninmersive I would say

There's a chance for them to be sold by alchemist vendors. If you never see them, there may be a conflict in your load order that's overwriting the SLS changes to leveled lists.

Link to comment

I am wearing bikini armors, however I have lost experience while wearing them. I am also unable to Build Bikini Lists in the MCM, and I have pumpkin's and the remastered version. Is something wrong/have I missed something? I also replaced that json file with the one I found in this thread for pumpkin's, have not tested playing after replacing that file, but the populate option is still grayed out.

Link to comment
14 hours ago, Skyfry428 said:

I am wearing bikini armors, however I have lost experience while wearing them. I am also unable to Build Bikini Lists in the MCM, and I have pumpkin's and the remastered version. Is something wrong/have I missed something? I also replaced that json file with the one I found in this thread for pumpkin's, have not tested playing after replacing that file, but the populate option is still grayed out.

 

The armor needs to have the "_sls_bikiniarmor" keyword. You can only add that keyword to the armor in xEdit, or if you download a plugin with that keyword already added to the armor. Based on what you're describing, it sounds like your bikini armor doesn't have that keyword.

Edited by NymphoElf
Link to comment
22 hours ago, NymphoElf said:

 

The armor needs to have the "_sls_bikiniarmor" keyword. You can only add that keyword to the armor in xEdit, or if you download a plugin with that keyword already added to the armor. Based on what you're describing, it sounds like your bikini armor doesn't have that keyword.

They all have the keyword, I made sure of that in xedit, that's why it's a little puzzling.
EDIT: I'm not sure what changed, I just booted up the game and went to check it, and I was able to build the lists this time. Bizarre.

Edited by Skyfry428
Link to comment

After starting a new game, I can't fondle creatures while crouching -  has this been changed lately, or is my install borked?

 

Creature sex works fine otherwise, and I'm pretty sure I've set everything correctly in all the MCM's

 

Edit: Disabled and re-enabled Creature Content in the SLS MCM did the trick. 

Edited by Ar4chnid
Link to comment

finally was annoyed enough by the "hold on a second there princess. one moment while i check your licenses." dialogue to do something about it:

needs po3's papyrus extender 4.4+ (AddItemsOfTypeToArray function to be specific)
(only available for SSE afaik, sorry)

https://www.nexusmods.com/skyrimspecialedition/mods/22854

 

Only did very brief testing with sword/armor/magic, so far everything's working, mostly posting to ask @Monoman1 for permission to upload a compiled pex to the SSE thread.
here's a diff:

Spoiler
--- _SLS_LicenceUtil.psc.orig	2021-09-13 16:26:30.093424400 +0200
+++ _SLS_LicenceUtil.psc	2021-09-13 16:40:50.083829300 +0200
@@ -1,5 +1,13 @@
 Scriptname _SLS_LicenceUtil extends Quest Conditional 
 
+;https://www.creationkit.com/index.php?title=GetType_-_Form
+int skseWeaponType = 41
+int skseAmmoType = 42
+int skseArmorType = 26
+int skseBookType = 27
+int skseScrollType = 23
+
+
 Event OnInit()
 	If Self.IsRunning()
 		SetupSlotMasks()
@@ -764,50 +772,66 @@
 
 Bool Function HasMagicItem(ObjectReference akTarget)
 	Actor akTargetActor = akTarget as Actor
-	Int i = akTarget.GetNumItems()
+
+	Form[] armorItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseArmorType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	Int i = armorItemsArray.length
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
-		If Item as Armor
-			If (Item as Armor).GetWeightClass() == 2
-				If (Item as Armor).GetEnchantment() != None
-					If !Item.HasKeyword(ArmorJewelry) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && !_SLS_LicExceptionsArmor.HasForm(Item) && Item.GetName() != ""
-						If akTargetActor == PlayerRef
+		Item = armorItemsArray[i]
+		If (Item as Armor).GetWeightClass() == 2
+			If (Item as Armor).GetEnchantment() != None
+				If !Item.HasKeyword(ArmorJewelry) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && !_SLS_LicExceptionsArmor.HasForm(Item) && Item.GetName() != ""
+					If akTargetActor == PlayerRef
+						;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
+						Return true
+					Else
+						If !akTargetActor.IsEquipped(Item) || FollowerLicStyle == 1
 							;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
 							Return true
 						Else
-							If !akTargetActor.IsEquipped(Item) || FollowerLicStyle == 1
+							If akTargetActor.GetItemCount(Item) > 1
 								;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
 								Return true
-							Else
-								If akTargetActor.GetItemCount(Item) > 1
-									;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
-									Return true
-								EndIf
-							EndIf						
-						EndIf
+							EndIf
+						EndIf						
 					EndIf
 				EndIf
 			EndIf
-		
-		ElseIf Item as Weapon
-			If Item.HasKeyword(VendorItemStaff)
-				;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
-				Return true
-			EndIf
-			
-		ElseIf Item as Book
-			If Item.HasKeyword(VendorItemSpellTome)
-				;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
-				Return true
-			EndIf
-		
-		ElseIf Item as Scroll
+		EndIf
+	EndWhile
+
+	Form[] weaponItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseWeaponType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	i = weaponItemsArray.length
+	While i > 0
+		i -= 1
+		Item = weaponItemsArray[i]
+		If Item.HasKeyword(VendorItemStaff)
 			;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
 			Return true
 		EndIf
 	EndWhile
+
+	Form[] bookItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseBookType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	i = bookItemsArray.length
+	While i > 0
+		i -= 1
+		Item = bookItemsArray[i]
+		If Item.HasKeyword(VendorItemSpellTome)
+			;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
+			Return true
+		EndIf
+	EndWhile
+
+	Form[] scrollItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseScrollType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	i = scrollItemsArray.length
+	While i > 0
+		i -= 1
+		Item = scrollItemsArray[i]
+		;Debug.Messagebox("Contraband Magic Item: \n" + Item.GetName() + "\n" + Item)
+		Return true
+	EndWhile
+
 	Return false
 EndFunction
 
@@ -968,11 +992,13 @@
 
 Bool Function ActorHasArmor(ObjectReference akTarget)
 	Actor akTargetActor = akTarget as Actor
-	Int i = akTarget.GetNumItems()
+
+	Form[] armorItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseArmorType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	Int i = armorItemsArray.length
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = armorItemsArray[i]
 		If Item as Armor && (Item as Armor).GetWeightClass() < 2
 			If Item.HasKeyword(VendorItemArmor) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != ""
 				If akTargetActor == PlayerRef
@@ -994,11 +1020,13 @@
 
 Bool Function ActorHasNonBikiniArmor(ObjectReference akTarget) ; Not necessary any more?
 	Actor akTargetActor = akTarget as Actor
-	Int i = akTarget.GetNumItems()
+
+	Form[] armorItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseArmorType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	Int i = armorItemsArray.length
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = armorItemsArray[i]
 		If Item as Armor && (Item as Armor).GetWeightClass() < 2 && Item.HasKeyword(VendorItemArmor)
 			If !Item.HasKeyword(_SLS_BikiniArmor) && StorageUtil.GetIntValue(Item, "SLAroused.IsBikiniArmor", Missing = -1) <= 0 && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != ""
 				If akTargetActor == PlayerRef
@@ -1054,30 +1082,19 @@
 	;Debug.Trace("_SLS_: HasWeapon: akTarget:" + akTarget)
 	;Debug.Messagebox("_SLS_: HasWeapon: akTarget:" + akTarget)
 	Actor akTargetActor = akTarget as Actor
-	Int i = akTarget.GetNumItems()
+
+	Form[] weaponItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseWeaponType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	Int i = weaponItemsArray.length
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
-		If Item as Weapon
-			If Item.HasKeyword(VendorItemWeapon) && !_SLS_LicExceptionsWeapon.HasForm(Item)
-				If akTargetActor == PlayerRef
-					Return true
-				Else
-					If !akTargetActor.IsEquipped(Item) || FollowerLicStyle == 1
-						Return true
-					Else
-						If akTargetActor.GetItemCount(Item) > 1
-							Return true
-						EndIf
-					EndIf						
-				EndIf
-			EndIf
-		ElseIf Item as Ammo
+		Item = weaponItemsArray[i]
+
+		If Item.HasKeyword(VendorItemWeapon) && !_SLS_LicExceptionsWeapon.HasForm(Item)
 			If akTargetActor == PlayerRef
 				Return true
 			Else
-				If !akTargetActor.IsEquipped(Item)
+				If !akTargetActor.IsEquipped(Item) || FollowerLicStyle == 1
 					Return true
 				Else
 					If akTargetActor.GetItemCount(Item) > 1
@@ -1087,6 +1104,25 @@
 			EndIf
 		EndIf
 	EndWhile
+
+	Form[] ammoItemsArray = PO3_SKSEFunctions.AddItemsOfTypeToArray(akTargetActor, skseAmmoType, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true)
+	i = ammoItemsArray.length
+	While i > 0
+		i -= 1
+		Item = ammoItemsArray[i]
+
+		If akTargetActor == PlayerRef
+			Return true
+		Else
+			If !akTargetActor.IsEquipped(Item)
+				Return true
+			Else
+				If akTargetActor.GetItemCount(Item) > 1
+					Return true
+				EndIf
+			EndIf						
+		EndIf
+	EndWhile
 	Return false
 EndFunction
 

 

 

 

also also: if i get permission: looking for beta testers who are not that afraid borking their savegame :P 

Link to comment
4 hours ago, yeahhowaboutnooo said:

finally was annoyed enough by the "hold on a second there princess. one moment while i check your licenses." dialogue to do something about it:

needs po3's papyrus extender 4.4+ (AddItemsOfTypeToArray function to be specific)
(only available for SSE afaik, sorry)

https://www.nexusmods.com/skyrimspecialedition/mods/22854

 

Only did very brief testing with sword/armor/magic, so far everything's working, mostly posting to ask @Monoman1 for permission to upload a compiled pex to the SSE thread.
here's a diff:

  Reveal hidden contents

 

 

also also: if i get permission: looking for beta testers who are not that afraid borking their savegame :P 

Knock yourself out. 

 

I thought I heard somewhere that there might be issues with Po3. I can't remember what or where I heard that though so it's probably nothing....

Link to comment
3 hours ago, Monoman1 said:

Knock yourself out. 

Thanks ?

 

3 hours ago, Monoman1 said:

I thought I heard somewhere that there might be issues with Po3. I can't remember what or where I heard that though so it's probably nothing....

Oof, hopefully it's the LE version that's buggy....
Nevertheless i'll probably still look at the source code, because i'd really like to make these functions

Form[] Function AddClothingToArray(ObjectReference akRef, int afArmorType, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false)
Form[] Function AddLightArmorToArray(ObjectReference akRef, int afArmorType, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false)
Form[] Function AddHeavyArmorToArray(ObjectReference akRef, int afArmorType, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false)

instead of getting all armor and then filtering by weight class.

 

whilst i have your attention:
I was one of the persons who had crashes induced by enforcers and have been running _sls_lictowncheck.pex script with the (de)spawns disabled since ~ mid june:

Since then i haven't had a single enforcer induced crash :) 
Not sure if this is because of the spawning or despawning of the enforcers though :( 

 

 

last but not least: psc and pex attached below:

edit: this should go without saying: your mod -> do whatever you want with them

_SLS_LicenceUtil.psc

_SLS_LicenceUtil.pex

 

(i could also do a runtime check via "SKSE.GetVersion() > 1" to check during runtime if the scripts are being executed by oldrim or SSE? saving this link for later: https://www.creationkit.com/index.php?title=SKSE_Script)

Edited by yeahhowaboutnooo
Link to comment

Any idea of what would make both the escort adding dialogue box and the location adding dialogue boxes both to not work properly?

The escorts box shows 1 page of escorts, I click okay and it says "Done 0 escorts added".

And the add location box doesn't show at all, but the location is still added to what I assume is the right zone.

 

Also is a completely new game needed to detect an updated TES5EditMergedPatch?

Edited by Yuuen
Link to comment
13 hours ago, yeahhowaboutnooo said:

instead of getting all armor and then filtering by weight class.

My thinking is that the main problem here is that there are multiple 'sweeps' for each item category through your inventory. When I knew less (not that I know everything now) and when there were fewer licences, my approach was to run a sweep for each licence type. Process the weapon licence, now process the armor licence, now process the magic licence. Sweep, sweep, sweep. It's inefficient.

 

I should have gone with an inventory approach. One sweep through.

First item -> what is it? -> weapon -> process weapon item. 

Second item -> what is it? -> armor -> process armor item. 

 

I'm planning on doing this but I've been really busy with wartimes and it's a daunting, messy task. It is high on my priorities though. So in the long run you might be wasting your time. Didn't say that yesterday as it seems you had the work done already. 

 

13 hours ago, yeahhowaboutnooo said:

I was one of the persons who had crashes induced by enforcers and have been running _sls_lictowncheck.pex script with the (de)spawns disabled since ~ mid june:

Yea. Cause of the CTD was enforcers being disabled/enabled too quickly it seems. Root of the problem was the location tracking system was firing that randomization far too often. This has been fixed in the updated version found in the wartimes thread (see my sig). It's not mainstream because there are unfinished things like wildling and dancing. 

 

I bang on this a lot but I find it funny how SE had this problem and not LE. 

 

Also there was a bug where the two confiscation systems toll/enforcer weren't talking to each other which caused problems. There's also a fix for this in the wartimes update post.

 

13 hours ago, yeahhowaboutnooo said:

(i could also do a runtime check via "SKSE.GetVersion() > 1" to check during runtime if the scripts are being executed by oldrim or SSE?

Have never used it. I assume it could work alright. 

Link to comment
7 hours ago, Monoman1 said:

So in the long run you might be wasting your time. Didn't say that yesterday as it seems you had the work done already. 

Well, worst case it wasn't that much + i learnt something.

Anyhow:
diff:
 

Spoiler
--- _SLS_LicenceUtil.psc.orig	2021-09-13 20:20:48.287300300 +0200
+++ _SLS_LicenceUtil.psc	2021-09-14 19:52:40.611468300 +0200
@@ -1,5 +1,35 @@
 Scriptname _SLS_LicenceUtil extends Quest Conditional 
 
+FormList property itemList auto
+int[] emptyIntArray
+;https://www.creationkit.com/index.php?title=GetType_-_Form
+int skseWeaponType = 41
+int skseAmmoType = 42
+int skseArmorType = 26
+int skseBookType = 27
+int skseScrollType = 23
+
+Bool Function isSSE()
+	if SKSE.GetVersion() > 1
+		return true
+	endif
+	return false
+EndFunction
+
+Bool Function hasPO3scripts()
+	return isSSE()
+EndFunction
+
+Form Function getItemFromContainer(Form aform, int aipos)
+	if aform as ObjectReference
+		return (aform as ObjectReference).GetNthForm(aipos)
+	elseif aform as FormList
+		return (aform as FormList).GetAt(aipos)
+	endif
+	Debug.Notification("getItemFromContainer failed to parse aform")
+	;TODO: throw error
+EndFunction
+
 Event OnInit()
 	If Self.IsRunning()
 		SetupSlotMasks()
@@ -12,6 +42,9 @@
 EndEvent
 
 Function PlayerLoadsGame()
+	;TODO: check if this is a good place to init the array
+	;      or if it's even worth it to use a variable instead of using "Utility.CreateIntArray(0)" for every call
+	emptyIntArray = Utility.CreateIntArray(0)
 	LicNameMaintenance()
 EndFunction
 
@@ -712,10 +745,20 @@
 Bool Function HasClothes(ObjectReference akTarget)
 	Actor akTargetActor = akTarget as Actor
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 2 ;Clothing
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor && (Item as Armor).GetWeightClass() == 2
 			If Item.HasKeyword(VendorItemClothing) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && !_SLS_LicExceptionsArmor.HasForm(Item) && Item.GetName() != ""
 				If akTargetActor == PlayerRef
@@ -765,10 +808,23 @@
 Bool Function HasMagicItem(ObjectReference akTarget)
 	Actor akTargetActor = akTarget as Actor
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 2 ;Clothing
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseWeaponType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseBookType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseScrollType, abNoEquipped = false)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor
 			If (Item as Armor).GetWeightClass() == 2
 				If (Item as Armor).GetEnchantment() != None
@@ -969,10 +1025,22 @@
 Bool Function ActorHasArmor(ObjectReference akTarget)
 	Actor akTargetActor = akTarget as Actor
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 0 ;Light Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		weightClass = 1 ;Heavy Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor && (Item as Armor).GetWeightClass() < 2
 			If Item.HasKeyword(VendorItemArmor) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != ""
 				If akTargetActor == PlayerRef
@@ -995,10 +1063,22 @@
 Bool Function ActorHasNonBikiniArmor(ObjectReference akTarget) ; Not necessary any more?
 	Actor akTargetActor = akTarget as Actor
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 0 ;Light Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		weightClass = 1 ;Heavy Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor && (Item as Armor).GetWeightClass() < 2 && Item.HasKeyword(VendorItemArmor)
 			If !Item.HasKeyword(_SLS_BikiniArmor) && StorageUtil.GetIntValue(Item, "SLAroused.IsBikiniArmor", Missing = -1) <= 0 && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != ""
 				If akTargetActor == PlayerRef
@@ -1055,10 +1135,20 @@
 	;Debug.Messagebox("_SLS_: HasWeapon: akTarget:" + akTarget)
 	Actor akTargetActor = akTarget as Actor
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseWeaponType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseAmmoType, abNoEquipped = false)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Weapon
 			If Item.HasKeyword(VendorItemWeapon) && !_SLS_LicExceptionsWeapon.HasForm(Item)
 				If akTargetActor == PlayerRef
@@ -1356,10 +1446,20 @@
 
 Function ConfiscateWeapons(ObjectReference akTarget)
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseWeaponType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseAmmoType, abNoEquipped = false)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Weapon
 			If Item.HasKeyword(VendorItemWeapon) && !_SLS_LicExceptionsWeapon.HasForm(Item)
 				akTarget.RemoveItem(Item, akTarget.GetItemCount(Item), abSilent = true, akOtherContainer = _SLS_LicenceConfiscationsWeapons)
@@ -1381,10 +1481,22 @@
 
 Function ConfiscateArmors(ObjectReference akTarget)
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 0 ;Light Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		weightClass = 1 ;Heavy Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor
 			If (Item as Armor).GetWeightClass() < 2
 				If Item.HasKeyword(VendorItemArmor) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != "" && !_SLS_LicExceptionsArmor.HasForm(Item)
@@ -1426,11 +1538,24 @@
 
 Function ConfiscateMagicItems(ObjectReference akTarget)
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 2 ;Clothing
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseWeaponType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseBookType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseScrollType, abNoEquipped = false)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	Armor akArmor
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer,i)
 		If Item as Armor
 			akArmor = Item as Armor
 			If akArmor.GetWeightClass() == 2 && akArmor.GetEnchantment() != None
@@ -1466,10 +1591,22 @@
 
 Function ConfiscateNonBikiniArmors(ObjectReference akTarget)
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 0 ;Light Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		weightClass = 1 ;Heavy Armor
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor
 			If (Item as Armor).GetWeightClass() < 2
 				If Item.HasKeyword(VendorItemArmor) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != "" && !_SLS_LicExceptionsArmor.HasForm(Item)
@@ -1493,10 +1630,20 @@
 
 Function ConfiscateClothes(ObjectReference akTarget)
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 2 ;Clothing
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor
 			If (Item as Armor).GetWeightClass() == 2
 				If Item.HasKeyword(VendorItemClothing) && !Item.HasKeyword(SexLabNoStrip) && Item.IsPlayable() && Item.GetName() != "" && !_SLS_LicExceptionsArmor.HasForm(Item)
@@ -2277,11 +2424,21 @@
 
 Form Function HasBodyClothes(ObjectReference akTarget)
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 2 ;Clothing
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	Armor ItemAsArmor
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		ItemAsArmor = Item as Armor
 		If ItemAsArmor
 			If ItemAsArmor.GetWeightClass() == 2
@@ -3511,3 +3668,4 @@
 _SLS_InterfaceFashion Property Fashion Auto
 
 CWScript Property Cw Auto
+

 

 

 

i have a few papyrus questions:

 

The AddArmorOfTypeToList has a bunch of optional arguments, the last one (aiSlotsToSkip) is a List.

Function AddArmorsOfTypeToList(ObjectReference akRef, 
                               Formlist akList, 
                               int afArmorType, 
                               bool abNoEquipped = true, 
                               bool abNoFavorited = false, 
                               bool abNoQuestItem = false, 
                               int[] aiSlotsToSkip = None) global native

 

However if i call that function without setting aiSlotsToSkip a warning is being printed in the papyrus log (which i find annoying)

-> i added a dummy variable 'int[] emptyIntArray' which i currently fill in the PlayerLoadsGame() function:

 Function PlayerLoadsGame()
+	;TODO: check if this is a good place to init the array
+	;      or if it's even worth it to use a variable instead of using "Utility.CreateIntArray(0)" for every call
+	emptyIntArray = Utility.CreateIntArray(0)
 	LicNameMaintenance()
 EndFunction

 

Well, the comments kinda spoil my question:

is this a good place to initialize that variable?

 

2nd question:

whats the best way to throw an error/exception here:

+Form Function getItemFromContainer(Form aform, int aipos)
+	if aform as ObjectReference
+		return (aform as ObjectReference).GetNthForm(aipos)
+	elseif aform as FormList
+		return (aform as FormList).GetAt(aipos)
+	endif
+	Debug.Notification("getItemFromContainer failed to parse aform")
+	;TODO: throw error
+EndFunction

(If aform is something other than an ObjectReference/Formlist then either i have f'd up or skyrim is dying)

 

Last question:
i had to add the following formlist property to the .esp s.t. i can keep the script compatible with both oldrim and SSE:

Quote

FormList property itemList auto

-> allows for minimal edits in the individual functions, e.g. HasMagicItem() diff:

Spoiler
@@ -765,10 +808,23 @@
 Bool Function HasMagicItem(ObjectReference akTarget)
 	Actor akTargetActor = akTarget as Actor
 	Int i = akTarget.GetNumItems()
+	Form itemContainer = akTarget
+
+	If hasPO3scripts()
+		itemList.revert()
+		int weightClass = 2 ;Clothing
+		PO3_SKSEFunctions.AddArmorsOfTypeToList(akTarget, itemList, weightClass, abNoEquipped = false, abNoFavorited = false, abNoQuestItem = true, aiSlotsToSkip = emptyIntArray)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseWeaponType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseBookType, abNoEquipped = false)
+		PO3_SKSEFunctions.AddItemsOfTypeToList(akTarget, itemList, skseScrollType, abNoEquipped = false)
+		i = itemList.GetSize()
+		itemContainer = itemList
+	Endif
+
 	Form Item
 	While i > 0
 		i -= 1
-		Item = akTarget.GetNthForm(i)
+		Item = getItemFromContainer(itemContainer, i)
 		If Item as Armor
 			If (Item as Armor).GetWeightClass() == 2
 				If (Item as Armor).GetEnchantment() != None

 

kind of a two part question:
Could you add that property to the _SLS_LicenceUtil script inside the _SLS_LicenceQuest quest for potential future releases?

BTW: Do you know of a way to concatenate/append arrays to one another and/or initialize FormLists without them being properties?

 

 

Last but not least the downloads:
Built upon SL-Survival 0.662 Beta, no guaranties that it works with any other version:

(actually i'm 99% sure it won't work with another version, due to the .esp change)

Sexlab Survival SSE 0.662 Beta - Hang on a Second there fix.7z

 

REQUIRES: my modified version of po3's PapyrusExtenderSSE:

Papyrus Extender SSE - 4.5.1+AddArmorsOfTypeToArray_List.7z

 

(know C++? check if my code is decent enough for a pull request on github: klick me)

 

 

EDIT:
I knew i would forget something:
There's one "issue": The checks are now so fast that most of the time the force greet doesn't fire at all ¯\_(ツ)_/¯

papyrus logs seem fine though. As in: if i alt-tab and peek into the papyrus.log i see a new

_SLS_: Licence infraction type: -2. Mandatory restraints level: 0. Is properly restrained: TRUE

which tells me that the code is working.
Plus: if i actually remove all licences and add a bunch of clothing it does take up to ~15 secs for the enforcer to dismiss me again.

 

EDIT EDIT:

for users: if after having installed my fixes the enforcers still need a lot of time to process your inventory, it could be due to 2 reasons i think:

  1. you have a lot of clothing but no magic licence
  2. you have a bikini licence and a lot of bikini armors
Edited by yeahhowaboutnooo
Link to comment
21 hours ago, yeahhowaboutnooo said:

is this a good place to initialize that variable?

Depends on personal taste I guess. 

How often will the array be used?

How much memory would it use?

Is the script approaching the variable limit?

etc you know yourself. 

 

I might be inclined to just declare a global array since there's a certain time sensitivity to this task. What's one more array in the grand scheme of things....?

21 hours ago, yeahhowaboutnooo said:

whats the best way to throw an error/exception here:

Not sure what you're doing but it's probably just a case of whatever is calling getItemFromContainer() doing a 'if != None' check. 

You can do 

If akItem && akItem as Armor

 

on the one line and it will proc in order as expected. 

 

21 hours ago, yeahhowaboutnooo said:

Could you add that property to the _SLS_LicenceUtil script inside the _SLS_LicenceQuest quest for potential future releases?

Mmm, I'm finding it really difficult to find the time to mod lately. If you want to push changes to the esp that's fine but my approach will likely be a lot different if/when I eventually overhaul the licence scan. Much of the script will probably have to be gutted. 

21 hours ago, yeahhowaboutnooo said:

Do you know of a way to concatenate/append arrays to one another

PapyrusUtil

MergeFormArray

21 hours ago, yeahhowaboutnooo said:

nd/or initialize FormLists without them being properties?

Game.GetFormFromFile will work

21 hours ago, yeahhowaboutnooo said:

There's one "issue": The checks are now so fast that most of the time the force greet doesn't fire at all ¯\_(ツ)_/¯

There's logic in the FG to not fire a force greet for a small window (Might be 0.5 seconds or something like that). If the scan completes before the window closes and you've no contraband then there's no force greet. Stops them pestering you too much. If not done before the window closes then you're greeted anyway and you get that looping dialogue until it's done. This is to stop you being able to run away from the entrance without confiscations. 

Edited by Monoman1
Link to comment

This may be a stupid question but was it this mod that added "rest anywhere" spell to the player or was it something else? I have recently totally redid my load order, getting rid of several winter survival mods (got tired of cold and am now running Project Rainforest so my new character does not look stupid prancing around in bikini) but I did not get the spell on a new game. Was wondering if I got a bug or just messed up my setup.

Link to comment
2 hours ago, belegost said:

This may be a stupid question but was it this mod that added "rest anywhere" spell to the player or was it something else? I have recently totally redid my load order, getting rid of several winter survival mods (got tired of cold and am now running Project Rainforest so my new character does not look stupid prancing around in bikini) but I did not get the spell on a new game. Was wondering if I got a bug or just messed up my setup.

Sanguine's Debauchery, pretty sure.

Link to comment
15 minutes ago, Yuuen said:

Sanguine's Debauchery, pretty sure.

 

Right! Actually not as much SG+ as I think SexLabs Dialogues which I got rid becasue of blacksmith quest which I was notinterested in and extra dialogue lines in every single conversation. Man, it actually makes the whole SLS experience much more difficult now, especially with RND tiredness and SLS sleep deprivation on. Damn, I guess no more cheesing it by sleeping for free in front of a fireplace in a tavern.

 

Thanks for the reply.

Edited by belegost
Link to comment
58 minutes ago, belegost said:

 

Right! Actually not as much SG+ as I think SexLabs Dialogues which I got rid becasue of blacksmith quest which I was notinterested in and extra dialogue lines in every single conversation. Man, it actually makes the whole SLS experience much more difficult now, especially with RND tiredness and SLS sleep deprivation on. Damn, I guess no more cheesing it by sleeping for free in front of a fireplace in a tavern.

 

Thanks for the reply.

There IS a sleep on the ground function in the wheel... :P

Link to comment
5 hours ago, Monoman1 said:

There IS a sleep on the ground function in the wheel... :P

 

You're right, I forgot about it. I don't use it very much as I'm not very fond of wheel menus. Too console-like. Guess I'll have to make peace with it.

Link to comment

Anyway, is there a way to add custom followers as escorts? I have recently started running around with Sofia and Skeever but both of them have their own frameworks and do not count as followers. More over, they are explicitly singled out by NFF as DO NOT IMPORT. SLS does not see them as valid escorts, they can't be added even by targeting them directly and I can't leave Whiterun now because of that.

Edited by belegost
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