Jump to content

Script improvement 2 - Scent of Sex Restoration. (Abandoned - too much work!)


Recommended Posts

Posted (edited)

If I can get this fixed, I think Scent of Sex (SSX) will be a working mod for everyone. But it is scripts again, and I'm hopeless with them.

 

I wonder if a kindly soul who is good at scripts could spot the problem and fix it? I'd like to share the fixed script on the mod's page, too, so everyone benefits. Eldr3d is no longer working on the mod.

 

Here's the problem.  in the Rules section, I can decide to add a "Specific Actor" from those in the Cell near the player. 

 

The mod finds the actors in the vicinity, no problem. If I choose a regular Skyrim NPC the mod will add that actor without any issues.

However, if the NPC/Actor comes from a mod - ESP or ESPFE - trying to add the actor throws an error.  SSX cannot accept mod added actors.  Validation fails.

 

Here are two screens that show the issue:

 

 

 


 

Let's add Kust, a nice sensible chap in Falkreath who is a regular Skyrim NPC. The mod is very happy to welcome him aboard:

 

Works.thumb.jpg.c45f17a45a896afd7e46e293fe9b3437.jpg

 

Now let's add Wiren, a hearty fighting Nord lass with a fondness for Nord Mead and is added to the game via an ESPFE:    

And the mod doesn't like her at all, throwing a warning message:

 

Fail.thumb.jpg.857bc25f0c78be67216eb8aa4e4ec79f.jpg

 

NB - it does not matter if the mod-added actor comes by ESP or ESPFE, the result is the same.

 
 

 

 

The result:  a user cannot add a mod-added Actor to the Rules in SSX, rendering that part of the mod pretty broken.

 

I believe the problem lies in this script: SSX_Deferred_Actors_Loader_Quest  around line 40 onwards (if opened in Notepad).  It may also have a bearing on the SSX_Runner_Quest because I think one triggers something in the other. Validating the actors needs to be blind to Skyrim NPCs vs mod-added NPCs, or something.  I guess it's probably not a major fix but I struggle to create a simple script for my own mods, let alone fix something.

 

It's cheeky of me to ask, but it would be cool to fix this issue for everyone.  Any takers please?

 

I'd like to post the fixed script to the SSX mod for everyone to benefit from.

 

Thanks!

 

Edited by Bluegunk
Posted (edited)

It uses the skse function GetModName(int modIndex) which doesn't work with esl/esl flagged esp plugins as they all load in slot 254 (the same "modindex").

You might be able to remove this functionality if all it does is show which mod an actor is from, but I'm guessing even that would require a fair bit of editing.

 

EDIT: The actual error is thrown by the MCM script line 3409:

 

if (editRuleL2.isSpecific(positionEdited) || editRuleL2.isFaction(positionEdited) || editRuleL2.isRelationship(positionEdited)) && editRuleL2.getIDs(positionEdited)==""
debug.MessageBox(ssxRunnerQuest.s("$SSX_WarningYouNeedToSpecify"))
return
endIf

Figuring out what is going on here will be a real head scratcher!

Edited by Yinkle
Posted (edited)

Oh. Thank you, Yinkle. That's in the SSX_Runner_Quest.  Hmm that seems more complex than I thought. 

 

The choose a Specific Actor part of the MCM doesn't return a mod, it merely shows if an actor is Skyrim in the ( ).  It appears to look only at Skyrim actors.

 

All a bit bewildering to me.

 

We couldn't add??

Int GetLightModByName(String name)
  • Returns the index of the specified light mod.
String GetLightModName(Int modIndex)
  • Returns the light mod's name at the specified index.
Edited by Bluegunk
Posted (edited)
32 minutes ago, Bluegunk said:

Oh. Thank you, Yinkle. That's in the SSX_Runner_Quest.  Hmm that seems more complex than I thought. 

 

The choose a Specific Actor part of the MCM doesn't return a mod, it merely shows if an actor is Skyrim in the ( ).  It appears to look only at Skyrim actors.

 

All a bit bewildering to me.

 

We couldn't add??

Int GetLightModByName(String name)
  • Returns the index of the specified light mod.
String GetLightModName(Int modIndex)
  • Returns the light mod's name at the specified index.

I don't think that's the issue here, as far as I can tell, all it does is add the mod name in the brackets - if it fails to find a mod name it just adds empty brackets. I don't think the actual string is used for anything else.

 

The real issue is finding out why if (editRuleL2.isSpecific(positionEdited) || editRuleL2.isFaction(positionEdited) || editRuleL2.isRelationship(positionEdited)) && editRuleL2.getIDs(positionEdited)=="" is true!

 

"editRuleL2" refers to an instance of the SSX_Rule_Alias script which is 3676 lines long - not something I'd be up for figuring out as it would probably take bloody ages!

Edited by Yinkle
Posted

Hm. Thanks! I think that's enough to put my off my dinner!  Looks like I'll have to put this idea aside.  There are other ways to make the mod work. targeting individuals would have been nice.

Posted (edited)

Getting it to display the names is easy - You can change the getObjectModName function (~line 6630 in SSX_Runner_Quest.psc) to use PO3_SKSEFunctions.GetFormModName(f,false) instead of Game.GetModName(modIndex), since the former does work on esps and esls/espfes - no need to decide whether to call the Light version or not. The mod already calls other function from PO3_SKSEFunctions so it already requires Papyrus Extender.

 

I looked through the code and I think the main issue is that it what it actually stores is the forms Editor IDs, which aren't always specified for actor references placed in cells - I added some prints to a couple functions called when clicking the add button then tested locally with NPCs from The Ancient Profession (esp) and The Dibellan Baths (espfe) and it shows empty strings for all of them. I checked in xedit and neither of those mods set editor ids on the placed npc. I think if you want this to support all mods the logic would need to be re-written to rely on something that is always available like the actual form ID, but that would be a considerable amount of work.

Edited by zeelok
Posted

Thank you Zeelok.

 

It would appear this is no short job, as I had thought. And Eldr3d has abandoned the mod, too.

 

Let us all leave it.  Thank you both for looking into it!

  • Bluegunk changed the title to Script improvement 2 - Scent of Sex Restoration. (Abandoned - too much work!)

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...