Jump to content

Recommended Posts

1 hour ago, Corsayr said:

Do I need a new script or something to use this?

I don't believe so. You'd have to modify what you have and you'd just need SLS 0.628 which I haven't posted yet. 

1 hour ago, Corsayr said:

&& (((Game.GetFormFromFile(0x000D09E8, "SL Survival.esp") as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()) == FALSE) \

This is ok... but

1. what happens if the user hasn't got SLS installed? If you're not checking if SLS is installed before hand you'll get some log spam from GetFormFromFile. 

2. What happens when the user has disabled a particular licence? I'm not actually sure what happens to the 'ValidUntil' globals in this case. They may remain at their current values and the player will always be considered to not have a valid licence. 

 

StorageUtil variables will tell you if the licence is disabled and you don't need to worry about checking is SLS installed. 

 

If StorageUtil.GetIntValue(None, "_SLS_HasValidClothesLicence", Missing = -2) == 0

   ; Clothes licence is enabled and the player does not have one or it's expired. 

EndIf

 

This way you don't have to worry about if SLS is installed or the licence in question is enabled or not. 

 

 

Link to post
10 minutes ago, Monoman1 said:

1. what happens if the user hasn't got SLS installed? If you're not checking if SLS is installed before hand you'll get some log spam from GetFormFromFile. 

The good news is Teutonic doesn't want that hanging out there either so they made me do a check

 

The better news is I am compiling the new version now and fingers crossed. 🤞

Link to post

 

<snip>

 

v0.628

- Fixed toggling off licences globally will toggle off the new licence types. 
- Fixed a bug with merchant restrictions and magic licence disable. I think.
- Fixed toll evasion FG bug. Should now be safe to turn off toll evasion again if you want. 
- Fixed some iffy logic in eviction. Toggling the property licence should now instantly evict/unevict you IF your bounty isn't over the limit and outside mods are not blocking you via the API. 
- Fixed kennel slaves not getting devices until the sliders were set in the mcm.
- Reversed time of day for vampires with sleep deprivation. Let me know how it goes because I rarely make it as far as being a vampire.
- Fixed armor/weapon equipped guard behaviors no longer rely on toll evasion being active and can be enabled independently. Uses LocTrackCentral instead. 
- Added option to fire guard warnings for wearing armor in any slot and not just head/hands/body/feet but this option does not respect licence exceptions. 
- Fixed double punishments for wearing armor around town. 
- Send event "_SLS_AuthorativeConvoEnd" event when finished talking to toll guards & enforcers. I might have missed some exit points. Let me know.
- Unlock and thaneship licence styles should allow you to buy utility type licences (Curfew, whore, property & freedom) now without qualification. 
- Set global StorageUtil variables and sends a mod event when licences change states (valid -> invalid -> valid) or a licence toggle is enabled or disabled. See SendLicenceStateUpdateEvent() in the API script.
- Added an option to disable tolls entirely. Includes toll related objects like toll boxes, ledgers, furniture etc. 

Link to post

How would you even get a license event from SLS if it isn't installed? That won't ever happen.

 

Could you make the time of day "impact" on sleep deprivation an easy-to-change global, so for characters that have odd sleep patterns that are consistent, they can use sleep deprivation features but scale that down a LOT? Doesn't seem important enough to be in the MCM though.

 

If it's already a global, maybe add the name of it to the tooltip?

Link to post
29 minutes ago, Lupine00 said:

How would you even get a license event from SLS if it isn't installed? That won't ever happen.

Think you misread. Corsayr is currently Game.GetFormFromFiling the 'ValidUntil' global variables. Which was my concern. 

Edit: I believe the code snippet is part of a periodic update. Not code run on a modevent. Which is where the confusion is I think. 

29 minutes ago, Lupine00 said:

Could you make the time of day "impact" on sleep deprivation an easy-to-change global,

It's hard coded into the needs script atm. 

Do you mean the 'amplitude' of the various conditions or the time of day?

 

Good to see you again btw ;)

Link to post

Hi maybe you can help me, BW went to bed I think and I am stuck

 

Spoiler

This line (and others like it)

 

        SLS_bCrimeNotNude = (((Game.GetFormFromFile(0x49301, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

 

are giving me this error (and others like it)

 

Compiling "SLAdventures_DLCAndModCompScript"...
C:\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\SLAdventures_DLCAndModCompScript.psc(205,2): variable SLS_bCrimeNotNude is undefined
C:\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\SLAdventures_DLCAndModCompScript.psc(205,2): type mismatch while assigning to a none (cast missing or types unrelated)

 

205,02 is like the space before the SLS_bCrimeNotNude
 

 

Link to post

SLS_bCrimeNotNude is undefined. It doesn't have a type - Int/float/bool. 

 

I'd guess it's meant to be Bool SLS_bCrimeNotNude = (((Game.GetFormFromFile(0x49301, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

Link to post
3 minutes ago, Monoman1 said:

SLS_bCrimeNotNude is undefined. It doesn't have a type - Int/float/bool. 

 

I'd guess it's meant to be Bool SLS_bCrimeNotNude = (((Game.GetFormFromFile(0x49301, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

Ill try that thanks!

 

Link to post

okay one more problem this one is in the Crime laws script

 

Spoiler

These errors and others like it 

 

Starting 1 compile threads for 1 files...
Compiling "SLAdventures_CrimeLawsScript"...
C:\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\SLAdventures_CrimeLawsScript.psc(53,41): a property cannot be used directly on a type, it must be used on a variable
C:\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\SLAdventures_CrimeLawsScript.psc(53,101): SLS_bCrimeNotNude is not a function or does not exist
C:\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\SLAdventures_CrimeLawsScript.psc(53,101): cannot call the member function SLS_bCrimeNotNude alone or on a type, must call it on a variable

 

on this line (and others like it)

 

            && ((SLAdventures_DLCAndModCompScript.bSLSIsLoaded == False) || (SLAdventures_DLCAndModCompScript.SLS_bCrimeNotNude() == False)) \ 

 

 

The bCrimeNotNude is the line from the DLCandModCompScript we fixed before

 

The 41 and 101 slots are the Orange decimals

 

Link to post
14 minutes ago, Corsayr said:

okay one more problem this one is in the Crime laws script

Is SLAdventures_DLCAndModCompScript the name of a script? 

 

You can't really do that because that script can be attached to more than one object. So you need to tell it which object the script is attached to. (Which instance of the script). Usually you do this by declaring it as a property at the top of the script. 

 

SLAdventures_DLCAndModCompScript Property DLCAndModCompScript Auto

 

And fill in the property in the properties window. This creates a variable (DLCAndModCompScript) which is pointing to a script on a particular object. And it is of type SLAdventures_DLCAndModCompScript. 

 

Then the line becomes:

 

&& ((DLCAndModCompScript.bSLSIsLoaded == False) || (DLCAndModCompScript.SLS_bCrimeNotNude() == False)) \ 

 

Or at least I think that's what's wrong. Hard to know for sure without the full scripts. 

Link to post
21 hours ago, Corsayr said:

If it helps here are the scripts as is right now

Having looked at it the implementation is a bit... messy. I mean no offense by that. Confusion is the enemy when it comes to scripting. When you get confused you (and I have done this too many times to count) start to make things even more complex than they need to be. Bolting more stuff on and adding more confusion in the process. 

 

So I changed it to use the StUtil variables. Now this means it'll only work with SLS 0.628+ but there's no checking globals, GetFormsFromFiles and thus no need to check if SLS is installed. The simpler the better when it comes to scripting in my experience, within the scope of what needs to be done. So I've commented out some stuff that I don't think is necessary anymore. Namely the checking is SLS installed and the function LoadFormsSLS. You'd have to run that by Teutonic though to see if that's ok because I don't know if they're used in other scripts. 

 

So then the checks are changed from:

&& ((SLAdventures_DLCAndModCompScript.bSLSIsLoaded == False) || (SLAdventures_DLCAndModCompScript.SLS_bCrimeNotNude() == False)) \ 

 

to:

StorageUtil.GetIntValue(None, "_SLS_HasValidClothesLicence", Missing = -2) == 0

 

If you're getting into scripting then I'd have to say PapyrusUtil is probably THE most useful thing I've ever used in Skyrim scripting. Always keep Putil in mind as it's immensely useful. 

 

<snip>

 

I haven't compiled these because I don't have the rest of the scripts to hand. 

 

PS. Sorry. I'm kind of like the guy that comes in and wipes all the chalk off the board like an asshole. 

Link to post
10 minutes ago, Monoman1 said:

PS. Sorry. I'm kind of like the guy that comes in and wipes all the chalk off the board like an asshole. 

So in the DLCandModComp script you left all the function stuff, does it really still need that?

 

Spoiler

Function LoadFormsSLS()

    If (bSLSIsLoaded == True)

        Bool SLS_bCrimeNotNude = (((Game.GetFormFromFile(0x49301, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeSkimpyOutfit = (((Game.GetFormFromFile(0xD09E8, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeArmored1 = (((Game.GetFormFromFile(0x43648, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeArmored2 = (((Game.GetFormFromFile(0x49300, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeCoveredInCum = (((Game.GetFormFromFile(0xD09E8, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeArmed = (((Game.GetFormFromFile(0x43649, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeHasWeapons = (((Game.GetFormFromFile(0x43649, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeOutAtNight = (((Game.GetFormFromFile(0xD09E7, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeNotCollared = (((Game.GetFormFromFile(0xD1A27, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

        Bool SLS_bCrimeUsedMagic = (((Game.GetFormFromFile(0x43647, SLS) as GlobalVariable).GetValue()) > (Utility.GetCurrentGameTime()))

    Else

    EndIf


EndFunction 

 

 

Link to post
4 minutes ago, Corsayr said:

is that correct?

Ah well I'm not sure what changes you made so you should give it a decent look-over. 

3 minutes ago, Corsayr said:

for real when I first went through it my first reaction was you were winking and saddened by my code... 

Haha :)

Comment block. 2nd most useful thing after Putil. 

Link to post

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

×
×
  • Create New...