-
Notifications
You must be signed in to change notification settings - Fork 38
/
sslSystemConfig.psc
2004 lines (1802 loc) · 63.3 KB
/
sslSystemConfig.psc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
scriptname sslSystemConfig extends sslSystemLibrary
; // TODO: Add a 3rd person mod detection when determining FNIS sensitive variables.
; // Disable it when no longer relevant.
; ------------------------------------------------------- ;
; --- System Resources --- ;
; ------------------------------------------------------- ;
SexLabFramework property SexLab auto
int function GetVersion()
return SexLabUtil.GetVersion()
endFunction
string function GetStringVer()
return SexLabUtil.GetStringVer()
endFunction
bool property Enabled hidden
bool function get()
return SexLab.Enabled
endFunction
endProperty
; bool property InDebugMode auto hidden
bool property DebugMode hidden
bool function get()
return InDebugMode
endFunction
function set(bool value)
InDebugMode = value
if InDebugMode
Debug.OpenUserLog("SexLabDebug")
Debug.TraceUser("SexLabDebug", "SexLab Debug/Development Mode Deactivated")
MiscUtil.PrintConsole("SexLab Debug/Development Mode Activated")
if PlayerRef && PlayerRef != none
PlayerRef.AddSpell((Game.GetFormFromFile(0x073CC, "SexLab.esm") as Spell))
PlayerRef.AddSpell((Game.GetFormFromFile(0x5FE9B, "SexLab.esm") as Spell))
endIf
else
if Debug.TraceUser("SexLabDebug", "SexLab Debug/Development Mode Deactivated")
Debug.CloseUserLog("SexLabDebug")
endIf
MiscUtil.PrintConsole("SexLab Debug/Development Mode Deactivated")
if PlayerRef && PlayerRef != none
PlayerRef.RemoveSpell((Game.GetFormFromFile(0x073CC, "SexLab.esm") as Spell))
PlayerRef.RemoveSpell((Game.GetFormFromFile(0x5FE9B, "SexLab.esm") as Spell))
endIf
endIf
int eid = ModEvent.Create("SexLabDebugMode")
ModEvent.PushBool(eid, value)
ModEvent.Send(eid)
endFunction
endProperty
Faction property AnimatingFaction auto
Faction property GenderFaction auto
Faction property ForbiddenFaction auto
Weapon property DummyWeapon auto
Armor property NudeSuit auto
Armor property CalypsStrapon auto
Form[] property Strapons auto hidden
Spell property SelectedSpell auto
Spell property CumVaginalOralAnalSpell auto
Spell property CumOralAnalSpell auto
Spell property CumVaginalOralSpell auto
Spell property CumVaginalAnalSpell auto
Spell property CumVaginalSpell auto
Spell property CumOralSpell auto
Spell property CumAnalSpell auto
Spell property Vaginal1Oral1Anal1 auto
Spell property Vaginal2Oral1Anal1 auto
Spell property Vaginal2Oral2Anal1 auto
Spell property Vaginal2Oral1Anal2 auto
Spell property Vaginal1Oral2Anal1 auto
Spell property Vaginal1Oral2Anal2 auto
Spell property Vaginal1Oral1Anal2 auto
Spell property Vaginal2Oral2Anal2 auto
Spell property Oral1Anal1 auto
Spell property Oral2Anal1 auto
Spell property Oral1Anal2 auto
Spell property Oral2Anal2 auto
Spell property Vaginal1Oral1 auto
Spell property Vaginal2Oral1 auto
Spell property Vaginal1Oral2 auto
Spell property Vaginal2Oral2 auto
Spell property Vaginal1Anal1 auto
Spell property Vaginal2Anal1 auto
Spell property Vaginal1Anal2 auto
Spell property Vaginal2Anal2 auto
Spell property Vaginal1 auto
Spell property Vaginal2 auto
Spell property Oral1 auto
Spell property Oral2 auto
Spell property Anal1 auto
Spell property Anal2 auto
Keyword property CumOralKeyword auto
Keyword property CumAnalKeyword auto
Keyword property CumVaginalKeyword auto
Keyword property CumOralStackedKeyword auto
Keyword property CumAnalStackedKeyword auto
Keyword property CumVaginalStackedKeyword auto
Keyword property ActorTypeNPC auto
Keyword property SexLabActive auto
Keyword property FurnitureBedRoll auto
; FormList property ValidActorList auto
; FormList property NoStripList auto
; FormList property StripList auto
Furniture property BaseMarker auto
Package property DoNothing auto
Sound property OrgasmFX auto
Sound property SquishingFX auto
Sound property SuckingFX auto
Sound property SexMixedFX auto
Sound[] property HotkeyUp auto
Sound[] property HotkeyDown auto
Static property LocationMarker auto
FormList property BedsList auto
FormList property BedRollsList auto
FormList property DoubleBedsList auto
Message property UseBed auto
Message property CleanSystemFinish auto
Message property CheckSKSE auto
Message property CheckFNIS auto
Message property CheckSkyrim auto
Message property CheckSexLabUtil auto
Message property CheckPapyrusUtil auto
Message property CheckSkyUI auto
Message property TakeThreadControl auto
Topic property LipSync auto
VoiceType property SexLabVoiceM auto
VoiceType property SexLabVoiceF auto
FormList property SexLabVoices auto
; FormList property VoicesPlayer auto ; No longer used - v1.56
SoundCategory property AudioSFX auto
SoundCategory property AudioVoice auto
Idle property IdleReset auto
GlobalVariable property DebugVar1 auto
GlobalVariable property DebugVar2 auto
GlobalVariable property DebugVar3 auto
GlobalVariable property DebugVar4 auto
GlobalVariable property DebugVar5 auto
; ------------------------------------------------------- ;
; --- Config Properties --- ;
; ------------------------------------------------------- ;
; Booleans
bool property RestrictAggressive auto hidden
bool property AllowCreatures auto hidden
bool property NPCSaveVoice auto hidden
bool property UseStrapons auto hidden
bool property RestrictStrapons auto hidden
bool property RedressVictim auto hidden
bool property RagdollEnd auto hidden
bool property UseMaleNudeSuit auto hidden
bool property UseFemaleNudeSuit auto hidden
bool property UndressAnimation auto hidden
bool property UseLipSync auto hidden
bool property UseExpressions auto hidden
bool property RefreshExpressions auto hidden
bool property ScaleActors auto hidden
bool property UseCum auto hidden
bool property AllowFFCum auto hidden
bool property DisablePlayer auto hidden
bool property AutoTFC auto hidden
bool property AutoAdvance auto hidden
bool property ForeplayStage auto hidden
bool property OrgasmEffects auto hidden
bool property RaceAdjustments auto hidden
bool property BedRemoveStanding auto hidden
bool property UseCreatureGender auto hidden
bool property LimitedStrip auto hidden
bool property RestrictSameSex auto hidden
bool property RestrictGenderTag auto hidden
bool property SeparateOrgasms auto hidden
bool property RemoveHeelEffect auto hidden
bool property AdjustTargetStage auto hidden
bool property ShowInMap auto hidden
bool property DisableTeleport auto hidden
bool property SeedNPCStats auto hidden
bool property DisableScale auto hidden
bool property FixVictimPos auto hidden
bool property ForceSort auto hidden
; Integers
int property AnimProfile auto hidden
int property AskBed auto hidden
int property NPCBed auto hidden
int property OpenMouthSize auto hidden
int property UseFade auto hidden
int property Backwards auto hidden
int property AdjustStage auto hidden
int property AdvanceAnimation auto hidden
int property ChangeAnimation auto hidden
int property ChangePositions auto hidden
int property AdjustChange auto hidden
int property AdjustForward auto hidden
int property AdjustSideways auto hidden
int property AdjustUpward auto hidden
int property RealignActors auto hidden
int property MoveScene auto hidden
int property RestoreOffsets auto hidden
int property RotateScene auto hidden
int property EndAnimation auto hidden
int property ToggleFreeCamera auto hidden
int property TargetActor auto hidden
int property AdjustSchlong auto hidden
; Floats
float property CumTimer auto hidden
float property ShakeStrength auto hidden
float property AutoSUCSM auto hidden
float property MaleVoiceDelay auto hidden
float property FemaleVoiceDelay auto hidden
float property ExpressionDelay auto hidden
float property VoiceVolume auto hidden
float property SFXDelay auto hidden
float property SFXVolume auto hidden
float property LeadInCoolDown auto hidden
; Boolean Arrays
bool[] property StripMale auto hidden
bool[] property StripFemale auto hidden
bool[] property StripLeadInFemale auto hidden
bool[] property StripLeadInMale auto hidden
bool[] property StripVictim auto hidden
bool[] property StripAggressor auto hidden
; Float Array
float[] property StageTimer auto hidden
float[] property StageTimerLeadIn auto hidden
float[] property StageTimerAggr auto hidden
float[] property OpenMouthMale auto hidden
float[] property OpenMouthFemale auto hidden
float[] property BedOffset auto hidden
; Compatibility checks
bool property HasHDTHeels auto hidden
bool property HasNiOverride auto hidden
bool property HasFrostfall auto hidden
bool property HasSchlongs auto hidden
bool property HasMFGFix auto hidden
FormList property FrostExceptions auto hidden
MagicEffect HDTHeelEffect
; Data
Actor CrosshairRef
Actor property TargetRef auto hidden
Actor[] property TargetRefs auto hidden
int HookCount
bool HooksInit
sslThreadHook[] ThreadHooks
int property LipsPhoneme auto hidden
bool property LipsFixedValue auto hidden
int property LipsMinValue auto hidden
int property LipsMaxValue auto hidden
int property LipsSoundTime auto hidden
float property LipsMoveTime auto hidden
; ------------------------------------------------------- ;
; --- Config Accessors --- ;
; ------------------------------------------------------- ;
float function GetVoiceDelay(bool IsFemale = false, int Stage = 1, bool IsSilent = false)
if IsSilent
return 3.0 ; Return basic delay for loop
endIf
float VoiceDelay = MaleVoiceDelay
if IsFemale
VoiceDelay = FemaleVoiceDelay
endIf
if Stage > 1
VoiceDelay -= (Stage * 0.8) + Utility.RandomFloat(-0.2, 0.4)
if VoiceDelay < 0.8
return Utility.RandomFloat(0.8, 1.3) ; Can't have delay shorter than animation update loop
endIf
endIf
return VoiceDelay
endFunction
bool[] function GetStrip(bool IsFemale, bool IsLeadIn = false, bool IsAggressive = false, bool IsVictim = false)
if IsLeadIn
if IsFemale
return StripLeadInFemale
else
return StripLeadInMale
endIf
elseif IsAggressive
if IsVictim
return StripVictim
else
return StripAggressor
endIf
elseIf IsFemale
return StripFemale
else
return StripMale
endIf
endFunction
bool function UsesNudeSuit(bool IsFemale)
return ((!IsFemale && UseMaleNudeSuit) || (IsFemale && UseFemaleNudeSuit))
endFunction
bool function HasCreatureInstall()
return FNIS.GetMajor(true) > 0 && (Game.GetCameraState() < 8 || PlayerRef.GetAnimationVariableInt("SexLabCreature") > 0)
endFunction
float[] function GetOpenMouthPhonemes(bool isFemale)
float[] Phonemes = new float[16]
int i = 16
while i > 0
i -= 1
if isFemale
Phonemes[i] = OpenMouthFemale[i]
else
Phonemes[i] = OpenMouthMale[i]
endIf
endWhile
return Phonemes
endFunction
bool function SetOpenMouthPhonemes(bool isFemale, float[] Phonemes)
if Phonemes.Length < 16
return false
endIf
if OpenMouthFemale.Length < 16
OpenMouthFemale = new float[17]
endIf
if OpenMouthMale.Length < 16
OpenMouthMale = new float[17]
endIf
int i = 16
while i > 0
i -= 1
if isFemale
OpenMouthFemale[i] = PapyrusUtil.ClampFloat(Phonemes[i], 0.0, 1.0)
else
OpenMouthMale[i] = PapyrusUtil.ClampFloat(Phonemes[i], 0.0, 1.0)
endIf
endWhile
return true
endFunction
bool function SetOpenMouthPhoneme(bool isFemale, int id, float value)
if id < 0 || id > 15
return false
endIf
if isFemale
if OpenMouthFemale.Length < 16
OpenMouthFemale = new float[17]
endIf
OpenMouthFemale[id] = PapyrusUtil.ClampFloat(value, 0.0, 1.0)
else
if OpenMouthMale.Length < 16
OpenMouthMale = new float[17]
endIf
OpenMouthMale[id] = PapyrusUtil.ClampFloat(value, 0.0, 1.0)
endIf
return true
endFunction
int function GetOpenMouthExpression(bool isFemale)
if isFemale
if OpenMouthFemale.Length >= 17 && OpenMouthFemale[16] >= 0.0 && OpenMouthFemale[16] <= 16.0
return OpenMouthFemale[16] as int
endIf
else
if OpenMouthMale.Length >= 17 && OpenMouthMale[16] >= 0.0 && OpenMouthMale[16] <= 16.0
return OpenMouthMale[16] as int
endIf
endIf
return 16
endFunction
bool function SetOpenMouthExpression(bool isFemale, int value)
if isFemale
if OpenMouthFemale.Length < 17
OpenMouthFemale = new float[17]
endIf
OpenMouthFemale[16] = PapyrusUtil.ClampInt(value, 0, 16) as Float
return true
else
if OpenMouthMale.Length < 17
OpenMouthMale = new float[17]
endIf
OpenMouthMale[16] = PapyrusUtil.ClampInt(value, 0, 16) as Float
return true
endIf
return false
endFunction
bool function AddCustomBed(Form BaseBed, int BedType = 0)
if !BaseBed
return false
elseIf !BedsList.HasForm(BaseBed)
BedsList.AddForm(BaseBed)
endIf
if BedType == 1 && !BedRollsList.HasForm(BaseBed)
BedRollsList.AddForm(BaseBed)
elseIf BedType == 2 && !DoubleBedsList.HasForm(BaseBed)
DoubleBedsList.AddForm(BaseBed)
endIf
return true
endFunction
bool function SetCustomBedOffset(Form BaseBed, float Forward = 0.0, float Sideward = 0.0, float Upward = 37.0, float Rotation = 0.0)
if !BaseBed || !BedsList.HasForm(BaseBed)
Log("Invalid form or bed does not exist currently in bed list.", "SetBedOffset("+BaseBed+")")
return false
endIf
float[] off = new float[4]
off[0] = Forward
off[1] = Sideward
off[2] = Upward
off[3] = PapyrusUtil.ClampFloat(Rotation, -360.0, 360.0)
StorageUtil.FloatListCopy(BaseBed, "SexLab.BedOffset", off)
return true
endFunction
bool function ClearCustomBedOffset(Form BaseBed)
return StorageUtil.FloatListClear(BaseBed, "SexLab.BedOffset") > 0
endFunction
float[] function GetBedOffsets(Form BaseBed)
float[] Offsets = new float[4]
if StorageUtil.FloatListCount(BaseBed, "SexLab.BedOffset") == 4
StorageUtil.FloatListSlice(BaseBed, "SexLab.BedOffset", Offsets)
return Offsets
endIf
int i = BedOffset.Length
; For some reason with the old function if you change the value of the variable with the returned BedOffset Array the value also change on the original BedOffset
while i > 0
i -= 1
Offsets[i] = BedOffset[i]
endWhile
return Offsets
endFunction
; ------------------------------------------------------- ;
; --- Strapon Functions --- ;
; ------------------------------------------------------- ;
Form function GetStrapon()
if Strapons.Length > 0
return Strapons[Utility.RandomInt(0, (Strapons.Length - 1))]
endIf
return none
endFunction
Form function WornStrapon(Actor ActorRef)
int i = Strapons.Length
while i
i -= 1
if ActorRef.GetItemCount(Strapons[i]) > 0
return Strapons[i]
endIf
endWhile
return none
endFunction
bool function HasStrapon(Actor ActorRef)
return WornStrapon(ActorRef) != none
endFunction
Form function PickStrapon(Actor ActorRef)
form Strapon = WornStrapon(ActorRef)
if Strapon
return Strapon
endIf
return GetStrapon()
endFunction
Form function EquipStrapon(Actor ActorRef)
form Strapon = PickStrapon(ActorRef)
if Strapon
ActorRef.AddItem(Strapon, 1, true)
ActorRef.EquipItem(Strapon, false, true)
endIf
return Strapon
endFunction
function UnequipStrapon(Actor ActorRef)
int i = Strapons.Length
while i
i -= 1
if ActorRef.IsEquipped(Strapons[i])
ActorRef.RemoveItem(Strapons[i], 1, true)
endIf
endWhile
endFunction
function LoadStrapons()
Strapons = new form[1]
Strapons[0] = CalypsStrapon
if Game.GetModByName("StrapOnbyaeonv1.1.esp") != 255
LoadStrapon("StrapOnbyaeonv1.1.esp", 0x0D65)
endIf
if Game.GetModByName("TG.esp") != 255
LoadStrapon("TG.esp", 0x0182B)
endIf
if Game.GetModByName("Futa equippable.esp") != 255
LoadStrapon("Futa equippable.esp", 0x0D66)
LoadStrapon("Futa equippable.esp", 0x0D67)
LoadStrapon("Futa equippable.esp", 0x01D96)
LoadStrapon("Futa equippable.esp", 0x022FB)
LoadStrapon("Futa equippable.esp", 0x022FC)
LoadStrapon("Futa equippable.esp", 0x022FD)
endIf
if Game.GetModByName("Skyrim_Strap_Ons.esp") != 255
LoadStrapon("Skyrim_Strap_Ons.esp", 0x00D65)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x02859)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x0285A)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x0285B)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x0285C)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x0285D)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x0285E)
LoadStrapon("Skyrim_Strap_Ons.esp", 0x0285F)
endIf
if Game.GetModByName("SOS Equipable Schlong.esp") != 255
LoadStrapon("SOS Equipable Schlong.esp", 0x0D62)
endIf
ModEvent.Send(ModEvent.Create("SexLabLoadStrapons"))
endFunction
Armor function LoadStrapon(string esp, int id)
Form Strapon = Game.GetFormFromFile(id, esp)
if Strapon && (Strapon as Armor)
Strapons = PapyrusUtil.PushForm(Strapons, Strapon)
endif
return Strapon as Armor
endFunction
; ------------------------------------------------------- ;
; --- Hotkeys --- ;
; ------------------------------------------------------- ;
sslThreadController Control
event OnKeyDown(int keyCode)
if !Utility.IsInMenuMode() && !UI.IsMenuOpen("Console") && !UI.IsMenuOpen("Loading Menu")
if keyCode == ToggleFreeCamera
ToggleFreeCamera()
elseIf keyCode == TargetActor
if Control
DisableThreadControl(Control)
else
SetTargetActor()
endIf
elseIf keyCode == EndAnimation && BackwardsPressed()
ThreadSlots.StopAll()
endIf
endIf
endEvent
event OnCrosshairRefChange(ObjectReference ActorRef)
CrosshairRef = none
if ActorRef
CrosshairRef = ActorRef as Actor
endIf
endEvent
function SetTargetActor()
if CrosshairRef && CrosshairRef != none
TargetRef = CrosshairRef
SelectedSpell.Cast(TargetRef, TargetRef)
Debug.Notification("SexLab Target Selected: "+TargetRef.GetLeveledActorBase().GetName())
; Give them stats if they need it
Stats.SeedActor(TargetRef)
; Attempt to grab control of their animation?
sslThreadController TargetThread = ThreadSlots.GetActorController(TargetRef)
if TargetThread && !TargetThread.HasPlayer && (TargetThread.GetState() == "Animating" || TargetThread.GetState() == "Advancing")
sslThreadController PlayerThread = ThreadSlots.GetActorController(PlayerRef)
if (!PlayerThread || !(PlayerThread.GetState() == "Animating" || PlayerThread.GetState() == "Advancing")) && TakeThreadControl.Show()
if PlayerThread != none
ThreadSlots.StopThread(PlayerThread)
endIf
GetThreadControl(TargetThread)
endIf
endIf
endif
endFunction
function AddTargetActor(Actor ActorRef)
if ActorRef
if TargetRefs.Find(ActorRef) != -1
TargetRefs[TargetRefs.Find(ActorRef)] = none
endIf
TargetRefs[4] = TargetRefs[3]
TargetRefs[3] = TargetRefs[2]
TargetRefs[2] = TargetRefs[1]
TargetRefs[1] = TargetRefs[0]
TargetRefs[0] = ActorRef
endIf
endFunction
; Actor function GetNthValidTargetActor(int i)
; Form FormRef = StorageUtil.FormListGet(self, "TargetActors", i)
; if SexLabUtil.IsActor(FormRef)
; return FormRef as Actor
; endIf
; return none
; endFunction
; Actor[] function GetTargetActors()
; StorageUtil.FormListRemove(self, "TargetActors", TargetRef, true)
; Actor[] Target
; int i = StorageUtil.FormListFilterByTypes(self, "TargetActors")
; while i
; endWhile
; Form[] All = new Form[5]
; StorageUtil.FormListSlice(self, "TargetActors", All)
; int i = 5
; while i
; i -= 1
; if All[i]
; if !SexLabUtil.IsActor(FormRef)
; StorageUtil.FormListRemove(self, "TargetActors", All[i])
; else
; endIf
; endIf
; endWhile
; endFunction
sslThreadController function GetThreadControlled()
return Control
endFunction
function GetThreadControl(sslThreadController TargetThread)
if Control || !(TargetThread.GetState() == "Animating" || TargetThread.GetState() == "Advancing")
Log("Failed to control thread "+TargetThread)
return ; Control not available
endIf
; Set active controlled thread
Control = TargetThread
if !Control || Control == none
Log("Failed to control thread "+TargetThread)
return ; Control not available
endIf
; Lock players movement
PlayerRef.StopCombat()
if PlayerRef.IsWeaponDrawn()
PlayerRef.SheatheWeapon()
endIf
PlayerRef.SetFactionRank(AnimatingFaction, 1)
ActorUtil.AddPackageOverride(PlayerRef, DoNothing, 100, 1)
PlayerRef.EvaluatePackage()
Game.DisablePlayerControls(true, true, false, false, false, false, false, false, 0)
Game.SetPlayerAIDriven()
; Give player control
Control.AutoAdvance = false
Control.EnableHotkeys(true)
Log("Player has taken control of thread "+Control)
endFunction
function DisableThreadControl(sslThreadController TargetThread)
if Control && Control == TargetThread
; Release players thread control
MiscUtil.SetFreeCameraState(false)
if Game.GetCameraState() == 0
Game.ForceThirdPerson()
endIf
Control.DisableHotkeys()
Control.AutoAdvance = true
Control = none
; Unlock players movement
PlayerRef.RemoveFromFaction(AnimatingFaction)
ActorUtil.RemovePackageOverride(PlayerRef, DoNothing)
PlayerRef.EvaluatePackage()
Game.EnablePlayerControls()
Game.SetPlayerAIDriven(false)
endIf
endfunction
function ToggleFreeCamera()
if Game.GetCameraState() != 3
MiscUtil.SetFreeCameraSpeed(AutoSUCSM)
endIf
MiscUtil.ToggleFreeCamera()
endFunction
bool function BackwardsPressed()
return Input.GetNumKeysPressed() > 1 && MirrorPress(Backwards)
endFunction
bool function AdjustStagePressed()
return (!AdjustTargetStage && Input.GetNumKeysPressed() > 1 && MirrorPress(AdjustStage)) \
|| (AdjustTargetStage && !(Input.GetNumKeysPressed() > 1 && MirrorPress(AdjustStage)))
endFunction
bool function IsAdjustStagePressed()
return Input.GetNumKeysPressed() > 1 && MirrorPress(AdjustStage)
endFunction
bool function MirrorPress(int mirrorkey)
if mirrorkey == 42 || mirrorkey == 54 ; Shift
return Input.IsKeyPressed(42) || Input.IsKeyPressed(54)
elseif mirrorkey == 29 || mirrorkey == 157 ; Ctrl
return Input.IsKeyPressed(29) || Input.IsKeyPressed(157)
elseif mirrorkey == 56 || mirrorkey == 184 ; Alt
return Input.IsKeyPressed(56) || Input.IsKeyPressed(184)
else
return Input.IsKeyPressed(mirrorkey)
endIf
endFunction
; ------------------------------------------------------- ;
; --- Animation Profiles --- ;
; ------------------------------------------------------- ;
function ExportProfile(int Profile = 1)
SaveAdjustmentProfile()
endFunction
function ImportProfile(int Profile = 1)
SetAdjustmentProfile("../SexLab/AnimationProfile_"+Profile+".json")
endfunction
function SwapToProfile(int Profile)
AnimProfile = Profile
SetAdjustmentProfile("../SexLab/AnimationProfile_"+Profile+".json")
endFunction
bool function SetAdjustmentProfile(string ProfileName) global native
bool function SaveAdjustmentProfile() global native
; ------------------------------------------------------- ;
; --- 3rd party compatibility --- ;
; ------------------------------------------------------- ;
Spell function GetHDTSpell(Actor ActorRef)
if !HasHDTHeels || !HDTHeelEffect || !ActorRef; || !ActorRef.GetWornForm(Armor.GetMaskForSlot(37))
return none
endIf
int i = ActorRef.GetSpellCount()
while i
i -= 1
Spell SpellRef = ActorRef.GetNthSpell(i)
Log(SpellRef.GetName(), "Checking("+SpellRef+") for HDT HighHeels")
if SpellRef && StringUtil.Find(SpellRef.GetName(), "Heel") != -1
return SpellRef
endIf
int n = SpellRef.GetNumEffects()
while n
n -= 1
if SpellRef.GetNthEffectMagicEffect(n) == HDTHeelEffect
return SpellRef
endIf
endWhile
endWhile
return none
endFunction
Faction property BardExcludeFaction auto
ReferenceAlias property BardBystander1 auto
ReferenceAlias property BardBystander2 auto
ReferenceAlias property BardBystander3 auto
ReferenceAlias property BardBystander4 auto
ReferenceAlias property BardBystander5 auto
bool function CheckBardAudience(Actor ActorRef, bool RemoveFromAudience = true)
if !ActorRef
return false; Invalid argument
elseIf RemoveFromAudience
return BystanderClear(ActorRef, BardBystander1) || BystanderClear(ActorRef, BardBystander2) || BystanderClear(ActorRef, BardBystander3) \
|| BystanderClear(ActorRef, BardBystander4) || BystanderClear(ActorRef, BardBystander5)
else
return ActorRef == BardBystander1.GetReference() || ActorRef == BardBystander2.GetReference() || ActorRef == BardBystander3.GetReference() \
|| ActorRef == BardBystander4.GetReference() || ActorRef == BardBystander5.GetReference()
endIf
endFunction
bool function BystanderClear(Actor ActorRef, ReferenceAlias BardBystander)
if ActorRef == BardBystander.GetReference()
BardBystander.Clear()
ActorRef.EvaluatePackage()
Log("Cleared from bard audience", "CheckBardAudience("+ActorRef+")")
return true
endIf
return false
endFunction
; ------------------------------------------------------- ;
; --- System Use --- ;
; ------------------------------------------------------- ;
bool function CheckSystemPart(string CheckSystem)
if CheckSystem == "Skyrim"
return (StringUtil.SubString(Debug.GetVersionNumber(), 0, 3) as float) >= 1.6
elseIf CheckSystem == "SKSE"
return SKSE.GetScriptVersionRelease() >= 66
elseIf CheckSystem == "SkyUI"
return Quest.GetQuest("SKI_ConfigManagerInstance") != none
elseIf CheckSystem == "SexLabUtil"
return SexLabUtil.GetPluginVersion() >= 16403
elseIf CheckSystem == "PapyrusUtil"
return PapyrusUtil.GetVersion() >= 41
elseIf CheckSystem == "NiOverride"
return SKSE.GetPluginVersion("SKEE64") >= 7 || NiOverride.GetScriptVersion() >= 7 ;SSE
elseIf CheckSystem == "FNIS"
return FNIS.VersionCompare(7, 0, 0) >= 0
elseIf CheckSystem == "FNISGenerated"
return FNIS.IsGenerated()
elseIf CheckSystem == "FNISCreaturePack"
return FNIS.VersionCompare(7, 0, 0, true) >= 0
elseIf CheckSystem == "FNISSexLabFramework" && PlayerRef.Is3DLoaded() && Game.GetCameraState() > 3
return PlayerRef.GetAnimationVariableInt("SexLabFramework") >= 16000
elseIf CheckSystem == "FNISSexLabCreature" && PlayerRef.Is3DLoaded() && Game.GetCameraState() > 3
return PlayerRef.GetAnimationVariableInt("SexLabCreature") >= 16000
endIf
return false
endFunction
bool function CheckSystem()
; Check Skyrim Version
if !CheckSystemPart("Skyrim")
CheckSkyrim.Show(1.6)
return false
; Check SKSE install
elseIf !CheckSystemPart("SKSE")
CheckSKSE.Show(2.15)
return false
; Check SkyUI install - depends on passing SKSE check passing
elseIf !CheckSystemPart("SkyUI")
CheckSkyUI.Show(5.2)
return false
; Check SexLabUtil install - this should never happen if they have properly updated
elseIf !CheckSystemPart("SexLabUtil")
CheckSexLabUtil.Show()
return false
; Check PapyrusUtil install - depends on passing SKSE check passing
elseIf !CheckSystemPart("PapyrusUtil")
CheckPapyrusUtil.Show(4.3)
return false
; Check FNIS generation - soft fail
; elseIf CheckSystemPart("FNISSexLabFramework")
; CheckFNIS.Show()
endIf
; Return result
return true
endFunction
function Reload()
; DebugMode = true
if DebugMode
Debug.OpenUserLog("SexLabDebug")
Debug.TraceUser("SexLabDebug", "Config Reloading...")
endIf
LoadLibs(false)
SexLab = SexLabUtil.GetAPI()
; SetVehicle Scaling Fix
SexLabUtil.VehicleFixMode((DisableScale as int))
; Configure SFX & Voice volumes
AudioVoice.SetVolume(VoiceVolume)
AudioSFX.SetVolume(SFXVolume)
; Remove any targeted actors
RegisterForCrosshairRef()
CrosshairRef = none
TargetRef = none
; TFC Toggle key
UnregisterForAllKeys()
RegisterForKey(ToggleFreeCamera)
RegisterForKey(TargetActor)
RegisterForKey(EndAnimation)
; Mod compatability checks
; - HDT/NiO High Heels
HasNiOverride = Config.CheckSystemPart("NiOverride")
HasHDTHeels = Game.GetModByName("hdtHighHeel.esm") != 255
if HasHDTHeels && !HDTHeelEffect
HDTHeelEffect = Game.GetFormFromFile(0x800, "hdtHighHeel.esm") as MagicEffect
endIf
; - Frostfall exposure pausing
HasFrostfall = Game.GetModByName("Frostfall.esp") != 255; && Game.GetModByName("Campfire.esm") != 255; || Game.GetModByName("Chesko_Frostfall.esp") != 255
if HasFrostfall && !FrostExceptions
FrostExceptions = Game.GetFormFromFile(0x6E7E6, "Frostfall.esp") as FormList
endIf
; - SOS/SAM Schlongs (currently unused)
HasSchlongs = Game.GetModByName("Schlongs of Skyrim - Core.esm") != 255 || Game.GetModByName("SAM - Shape Atlas for Men.esp") != 255
; - MFG Fix check
HasMFGFix = MfgConsoleFunc.ResetPhonemeModifier(PlayerRef) ; TODO: May need to check another way, some players might get upset that their mfg is reset on load
if !FadeToBlackHoldImod || FadeToBlackHoldImod == none
FadeToBlackHoldImod = Game.GetFormFromFile(0xF756E, "Skyrim.esm") as ImageSpaceModifier ;0xF756D **0xF756E 0x10100C** 0xF756F 0xFDC57 0xFDC58 0x 0x 0x
endIf
if !FadeToBlurHoldImod || FadeToBlurHoldImod == none
FadeToBlurHoldImod = Game.GetFormFromFile(0x44F3B, "Skyrim.esm") as ImageSpaceModifier ;0x201D3 0x44F3B **0xFD809 0x1037E2 0x1037E3 0x1037E4 0x1037E5 0x1037E6** 0x
endIf
if !ForceBlackVFX || ForceBlackVFX == none
ForceBlackVFX = Game.GetFormFromFile(0x8FC39, "SexLab.esm") as VisualEffect ;0x44F3A
endIf
if !ForceBlurVFX || ForceBlurVFX == none
ForceBlurVFX = Game.GetFormFromFile(0x8FC3A, "SexLab.esm") as VisualEffect ;0x101967
endIf
; Clean valid actors list
StorageUtil.FormListRemove(self, "ValidActors", PlayerRef, true)
StorageUtil.FormListRemove(self, "ValidActors", none, true)
; TODO: confirm forms are the same in SSE
if GetBedOffsets(Game.GetFormFromFile(0xB8371, "Skyrim.esm"))[3] != 180.0
SetCustomBedOffset(Game.GetFormFromFile(0xB8371, "Skyrim.esm"), 0.0, 0.0, 0.0, 180.0) ; BedRoll Ground
endIf
Form DA02Altar = Game.GetFormFromFile(0x5ED79, "Skyrim.esm")
if DA02Altar && !BedsList.HasForm(DA02Altar)
BedsList.AddForm(DA02Altar)
BedRollsList.AddForm(DA02Altar)
endIf
Form CivilWarCot01L = Game.GetFormFromFile(0xE2826, "Skyrim.esm")
if CivilWarCot01L && !BedsList.HasForm(CivilWarCot01L)
BedsList.AddForm(CivilWarCot01L)
endIf
Form WRTempleHealingAltar01 = Game.GetFormFromFile(0xD4848, "Skyrim.esm")
if WRTempleHealingAltar01 && !BedsList.HasForm(WRTempleHealingAltar01)
BedsList.AddForm(WRTempleHealingAltar01)
SetCustomBedOffset(WRTempleHealingAltar01, 0.0, 0.0, 39.0, 90.0)
endIf
Form HHFurnitureBedSingle01 = Game.GetFormFromFile(0x2FBC7, "Skyrim.esm")
if HHFurnitureBedSingle01 && !BedsList.HasForm(HHFurnitureBedSingle01)
BedsList.AddForm(HHFurnitureBedSingle01)
endIf
; Dawnguard additions
if Game.GetModByName("Dawnguard.esm") != 255
; Serana doesn't have ActorTypeNPC, force validate.
StorageUtil.FormListAdd(self, "ValidActors", Game.GetFormFromFile(0x2B6C, "Dawnguard.esm"), false)
; Bedroll
Form DLC1BedrollGroundF = Game.GetFormFromFile(0xC651, "Dawnguard.esm")
if DLC1BedrollGroundF && !BedsList.HasForm(DLC1BedrollGroundF)
BedsList.AddForm(DLC1BedrollGroundF)
BedRollsList.AddForm(DLC1BedrollGroundF)
SetCustomBedOffset(DLC1BedrollGroundF, 0.0, 0.0, 0.0, 180.0)
endIf
endIf
; Dragonborn additions
if Game.GetModByName("Dragonborn.esm") != 255 && !BedsList.HasForm(Game.GetFormFromFile(0x21749, "Dragonborn.esm"))
Log("Adding Dragonborn beds to formlist...")
; Single Bed
Form DLC2DarkElfBed01 = Game.GetFormFromFile(0x21749, "Dragonborn.esm")
Form DLC2DarkElfBed01R = Game.GetFormFromFile(0x35037, "Dragonborn.esm")
Form DLC2DarkElfBed01L = Game.GetFormFromFile(0x35038, "Dragonborn.esm")
BedsList.AddForm(DLC2DarkElfBed01)
BedsList.AddForm(DLC2DarkElfBed01R)
BedsList.AddForm(DLC2DarkElfBed01L)
; Double Bed
Form DLC2DarkElfBedDouble01 = Game.GetFormFromFile(0x32802, "Dragonborn.esm")
Form DLC2DarkElfBedDouble01R = Game.GetFormFromFile(0x36796, "Dragonborn.esm")
Form DLC2DarkElfBedDouble01L = Game.GetFormFromFile(0x36797, "Dragonborn.esm")
BedsList.AddForm(DLC2DarkElfBedDouble01)
BedsList.AddForm(DLC2DarkElfBedDouble01R)
BedsList.AddForm(DLC2DarkElfBedDouble01L)