Guest Posted June 18, 2022 Posted June 18, 2022 I went through some of the larger script files and made some edits where they seemed appropriate.I haven't even compile tested the changes (sorry, don't have it working yet) so maybe you want to hold it off the few suggestions in the attached patch. nothing major. There were a few things I thought were a little peculiar, however: In scripts/Source/zadLibs.psc, function AnimSwitchKeyword() the `If akActor.WornHasKeyword(zad_DeviousYokeBB)` branch seems to attach elbowbinders. Could be intentional, but I believe there are some yoke images that could belong here. In the bondage game, scripts/Source/zadcFurnitureScript.psc, e.g. function DeviceMenuLockNPC(), the condition Choice2 == 1 seems to be tested twice. possibly the last is just an effectively disabled debug remnant. dd_changes.patch
ImpaKt Posted June 19, 2022 Posted June 19, 2022 Can anyone help with a floating chain issue? I have HDT SMP installed, CBPC, BHUNP (also the Baka factory BHUNP DD) and have built it on bodyslide multiple times as well as run it through FNIS. Still can't seem to get chains on ankles and wrists to work. Thanks!
nameareoverratedanyways Posted June 19, 2022 Posted June 19, 2022 Has anybody encountered an issue with DD items failing to equip properly? Items will show as equipped in the inventory UI, but will not appear on the character model and can be unequipped/reequipped at will in the inventory. I haven't been able to consistently reproduce this, but it seems to happen when another mod like DCL tries to equip multiple items in the same slot. For example, if DCL tries to equip Steel Chastity Bra and Gold Chastity Bra, both with show as equipped in the inventory, despite only the former appearing the character model. The gold bra inventory item can then be unequipped without running through the DD unlock menu. The larger issue is that from that point onward, the gold bra will never work properly again. Trying to equip any Gold Chastity Bra onto the player will not run through the DD "are you sure" menu and will not appear on the player. Anybody see anything similar? Any suggestions on lines of investigation?
Roggvir Posted June 19, 2022 Posted June 19, 2022 (edited) 10 hours ago, picobyte said: Didn't even know C pre-processor statements were allowed Oh, Papyrus compiler doesn't support it. You setup your compilation pipeline so it runs the source through any preprocessor of your choice and feed its result to the Papyrus compiler. 10 hours ago, picobyte said: The scope for a definition could be tricky. I'm guessing defines have global scope as load order until and #undef? If multiple mods copy the code, then you get version conflicts if the first mod is updated. Actually, there is absolutely nothing tricky about any of it. What do you mean by "version conflicts"? that makes no sense, what would conflict with what? I frequently modify and recompile scripts from almost every mod i use, same as any mods i make that use any 3rd party scripts or frameworks, all without any "conflicts" (whatever you mean by that). There are thousands ways how to set up your compilation pipeline, i use a "common.inc" placed in the project's directory with all the project's script sources. When i press Ctrl+F5 to compile a single script, it runs a batch file (also located in the project's script source directory, to allow optional per-project configuration should i need it), passing it the script's file name. The batch file runs gcc preprocessor feeding it the script source while loading "common.inc" from the same directory, then it passes the processed source to Papyrus compiler. Similarly, when i press Ctrl+F6 to mass compile ALL script sources found in same path of currently opened/active script source, the batch file runs gcc to preprocess all the sources first, placing the preprocessed sources in a temp directory, and then runs Papyrus compiler with the -a option for mass compiling, pointing it to the temp folder. You need to spend few minutes to setup your pipeline, but you do that once. It beats using properties as poor man's "constants" like ppl often tend to do (which is just... eeew, especially with frameworks, when 3rd party scripts are then accessing all these properties, wasting time and even risking deadlocks when those scripts are poorly written). You can also use macros to replace various time wasting non-native functions with proper native calls (things like SetActorValue instead of the "shortcut" SetAV, and other crap like that, which again some mod makers just keep on using because i guess they are just lazy to type few letters more). But sorry, this is really just a frustrated rant, i know nobody gives a crap. Edited June 19, 2022 by Roggvir
Guest Posted June 19, 2022 Posted June 19, 2022 2 hours ago, Roggvir said: You can also use macros to replace various time wasting non-native functions with proper native calls (things like SetActorValue instead of the "shortcut" SetAV, and other crap like that, which again some mod makers just keep on using because i guess they are just lazy to type few letters more). If it's just a 1-on-1 conversion, including all occurring case variants: #define SetAV(str, val) SetActorValue(str, val) #define setAV(str, val) SetActorValue(str, val) #define SetAv(str, val) SetActorValue(str, val) #define Setav(str, val) SetActorValue(str, val) #define setav(str, val) SetActorValue(str, val) I'll spend some time setting up my build system, different OS, same conmpiler. Would be interested in the batch file.
Elsidia Posted June 19, 2022 Posted June 19, 2022 16 hours ago, Roggvir said: nd it could be even more simple, like this: And how you support to write this line in your setup? If StorageUtil.GetIntValue(akActor, "zad_Equipped" + LookupDeviceType(zad_DeviousDevice) + "_LockJammedStatus") == 1
Elsidia Posted June 19, 2022 Posted June 19, 2022 5 hours ago, ImpaKt said: Still can't seem to get chains on ankles and wrists to work. HDT SMP isn't support DD chains as it's limited functionality as LE version. If anybody writes a HDT physics nod 1 to 1 as in LE, chains will work. As for wrist chains - it never works in SE As for ankle chains - after put chains on, save a game, exit to Windows, start Skyrim again and load a save. While save is loaded chains will work. As load a save again not work, need repeat previous exit procedure. In theory ankle chains in HDT SMP doesn't need work, but with this voodoo it's somehow works. As Bethesda say: "It somehow works!" )) If chains still not work, then you have wrong HDT chains meshes need update to latest made by our hero Zarantha.
Elsidia Posted June 19, 2022 Posted June 19, 2022 4 hours ago, nameareoverratedanyways said: Anybody see anything similar? Any suggestions on lines of investigation? First read troubleshooting page: https://www.loverslab.com/topic/99700-devious-devices-se-51-2021-03-24/?do=findComment&comment=2247110 But now i give some small clue - remove all LE versions of mods, remove all old DD patches from another mods and remove noenchanment restriction mod or configure it as in troubleshooting page tells.
Guest Posted June 19, 2022 Posted June 19, 2022 (edited) 2 hours ago, Elsidia said: And how you support to write this line in your setup? If StorageUtil.GetIntValue(akActor, "zad_Equipped" + LookupDeviceType(zad_DeviousDevice) + "_LockJammedStatus") == 1 Not everything can be solved by the pre-processor, but maybe via stringizing or concatenation macros. Could get ugly, though. Edited June 19, 2022 by picobyte
Elsidia Posted June 19, 2022 Posted June 19, 2022 33 minutes ago, picobyte said: Not everything can be solved by the pre-processor, but maybe via stringizing or concatenation macros. Could get ugly, though. Then why need do something ugly if there is always working solution, or if @Roggvir offer other solution then i just ask how this solution will work with existing functions.
kernalkillingfloor Posted June 19, 2022 Posted June 19, 2022 Hello, I'm having issues with the blindfold. neither the DD blindfold, nor the leeches mode seem to be working. I saw a reddit post about this, he seemed to fix it by disabling his ENB DOF, I don't have an ENB installed however. Mod list: "0000","Unmanaged: FNIS" "0001","DLC: HearthFires" "0002","DLC: Dragonborn" "0003","DLC: Dawnguard" "0004","Creation Club: ccQDRSSE001-SurvivalMode" "0005","Creation Club: ccBGSSSE037-Curios" "0006","Creation Club: ccBGSSSE025-AdvDSGS" "0007","Creation Club: ccBGSSSE001-Fish" "0008","1.2.2.1 - ThiefSE" "0009","Alternate Start - Live Another Life" "0010","AmorousAdventures" "0011","Bijin NPCs" "0012","BodySlide and Outfit Studio" "0013","Chaconne 1.4" "0014","Dripping when aroused" "0015","FeetLoversCumTextures" "0016","FeetLoversIdles" "0017","Fuz Ro D'oh" "0018","Optimized Vanilla Textures - HD" "0019","JContainers SE" "0020","Multiple Floors Sandboxing - Bash Patch Compatible" "0021","SexLab Solutions v" "0022","Pregnant and Creampie Voice Pack" "0023","Nusbie Voices" "0024","Sexlab Doggy Style Sounds" "0025","Unofficial Skyrim Special Edition Patch" "0026","SexLab Attraction SE v" "0027","Hvergelmir's Aesthetics - Brows" "0028","UIExtensions" "0029","SL Defeat SSE" "0030","SexLabArousedSSELoose" "0031","SexLab Theft and Seduction SE v" "0032","Sexlab Sexlab Approach Redux" "0033","Schlongs of Skyrim SE" "0034","Fnis" "0035","RaceMenu Special Edition" "0036","XP32 Maximum Skeleton Special Extended" "0037","SLAL_SE" "0038","ZAZ" "0039","Dragon Plate Brazen Renewal Ver SSE" "0040","Rosa Round-Bottom ---ADULT Follower Mod--- SSE" "0041","SoS AE" "0042","Rydin Animations SLAL Pack_Complete_SSE v" "0043","SESuperHotCosplayerLoadingScreensThatWillBlowYourMindAndDick" "0044","IMPROVED CAMERA - SA 3p in 1p" "0045","SkyUI_5_2_SE" "0046","SexLabFrameworkAE_v" "0047","Address Library for SKSE Plugins (Anniversary Edition)" "0048","R246 RaceMenu Presets" "0049","The Pure - CBBE" "0050","Better Shape Creature" "0051","Blue Demon Aria" "0052","Sexy Skyrim SE Statues" "0053","Expressive Facegen Morphs SE" "0054","Expressive Facial Animation - Female Edition" "0055","(4) Community Overlays 2 - Main - CBBE and Male" "0056","(3) Community Overlays 2 - Main - UUNP and Male" "0057","(2) Community Overlays 2 - Main - CBBE" "0058","(1) Community Overlays 2 - Main - UUNP" "0059","ZMDs Feet Soles Nail Texture Overlays RaceMenu SE" "0060","sexy idle Animation - Skyrim Special Edition" "0061","Fair Skin Complexion for CBBE" "0062","HDT-SMP for SSE 1.5.97" "0063","ABC" "0064","Simply Better Torches" "0065","Better Jumping AE" "0066","The Joy of Perspective" "0067","Skyrim 3D Landscapes Groundcovers 2k" "0068","Realistic Water Two SE" "0069","Verdant - A Skyrim Grass Plugin - ESPFE" "0070","Skyrim 3D Landscapes" "0071","Skyrim 3D Trees and Plants" "0072","Ancient Land 2.2" "0073","Interesting Roads" "0074","Landscape Fixes For Grass Mods" "0075","No More Bloom AND HDR (Merged)" "0076","SexLab_Extra_Voices_" "0077","Devious Adventures" "0078","Devious Devices" "0079","Deviously Cursed Loot" "0080","Legendary Armors - Bikini Complete SSE" "0081","Enhanced Character Edit" "0082","RaceMenu High Heels Fixes" "0083","Celes Nightingale High Heels" "0084","All In One" "0085","OWBody - Petite" "0086","Lingerie Set CBBE Curvy" "0087","Northgirl Armor UNP" "0088","Merta Assassin" "0089","Ordinator 9.31.0" "0090","Cassandra Frost Witch" "0091","Unofficial Material Fix" "0092","Tembtra Thief" "0093","Undies - SSE CBBE BodySlide" "0094","True Storms - Main File 1.0.2" "0095","COCO Lingerie - CBBE SE" "0096","Audio Overhaul Skyrim (3.3.2)" "0097","KS Hairdos SSE - Female" "0098","RaceMenu Anniversary Edition" "0099","CBBE SE Northgirl Full Pack 1.1.3" "0100","BodySlide and Outfit Studio -" "0101","SINful CBP" "0102","CBPC - Physics with Collisions" "0103","CBBE 3BBB" "0104","CBBE 3BA"
Roggvir Posted June 19, 2022 Posted June 19, 2022 (edited) 7 hours ago, Elsidia said: And how you support to write this line in your setup? If StorageUtil.GetIntValue(akActor, "zad_Equipped" + LookupDeviceType(zad_DeviousDevice) + "_LockJammedStatus") == 1 That doesn't have anything to do with the preprocessor i was ranting about, but you know that. To answer the question, it looks like this: int _jslot = JFormMap_getObj(_jcpActors, _actor as objectReference) if _jslot > 0 if JValue_solveInt(_jslot, ".devices." + _deviceType + ".jammed") == 1 Alternatively, if you wouldn't already know the device type, you can replace _deviceType with a call to GetDeviceType(zad_DeviousDevice), but because no matter what you want to do with a device, you always have to get some device param/info, there is always a call to GetDevice(_jcpDevices, zad_DeviousDevice) somewhere at the begining of any such code, which returns JContainer with ALL parameters of that device and you can get the device type from it (i store all device parameters in JContainers, so i do not need to have millions of properties on every device item script - it makes it easier to maintain and the scripts a bit more lightweight). 8 hours ago, picobyte said: If it's just a 1-on-1 conversion, including all occurring case variants: Yes, most of such things are just 1:1 when it comes to function arguments, but there may be a few where the arguments may differ a bit (i don't remember all cases from top of my head), and some functions aren't just wrappers calling single native function, but they contain more lines of code or some logic (for example Actor.AddToFaction()), so those calls may need be rewritten manually, especially if the original script code used them in a one-liner - i only rewrite those if there are multiple instances of such garbage - if it is just one or two, i usually don't bother. 8 hours ago, picobyte said: Would be interested in the batch file. I can send it to you later when i get to my computer - send me a PM to remind me pls. Edited June 19, 2022 by Roggvir
Elsidia Posted June 19, 2022 Posted June 19, 2022 31 minutes ago, Roggvir said: That doesn't have anything to do with the preprocessor i was ranting about, but you know that. I'm not that high level scripter as you, because i don't know. My question was - you recommend to redo procedure LookupDeviceType(zad_DeviousDevice) to new version. I understand from script that now instead of string it returns integer. As in this If StorageUtil.GetIntValue(akActor, "zad_Equipped" + LookupDeviceType(zad_DeviousDevice) + "_LockJammedStatus") == 1 is used string because i ask how you see work this line) So never mind i already nothing understand)
David Willers Posted June 19, 2022 Posted June 19, 2022 Hello for some reason my MO2 detects this mod as plugin (esp) 43 type instead of 44, how does that come? thought this mod is already converted
ponutpounder Posted June 19, 2022 Posted June 19, 2022 Will there be ever a light version? I don't usually use even half of those, and a lot of them are just recolors. I would love if I could just pick at least just one color to make this whole DDs family mods a lot less of a hog.
zarantha Posted June 19, 2022 Posted June 19, 2022 (edited) 19 hours ago, picobyte said: I went through some of the larger script files and made some edits where they seemed appropriate.I haven't even compile tested the changes (sorry, don't have it working yet) so maybe you want to hold it off the few suggestions in the attached patch. nothing major. There were a few things I thought were a little peculiar, however: In scripts/Source/zadLibs.psc, function AnimSwitchKeyword() the `If akActor.WornHasKeyword(zad_DeviousYokeBB)` branch seems to attach elbowbinders. Could be intentional, but I believe there are some yoke images that could belong here. In the bondage game, scripts/Source/zadcFurnitureScript.psc, e.g. function DeviceMenuLockNPC(), the condition Choice2 == 1 seems to be tested twice. possibly the last is just an effectively disabled debug remnant. dd_changes.patch 26.72 kB · 3 downloads Let's please move this to the dev thread. Zadlibs is one of the script files that are most likely to be updated and there have certainly already been changes between the current release and beta versions, and even between beta releases. If you attach a script patch here (the compiled files, not just the .patch you have there) then users will almost certainly install it on the wrong mod version and break their devices or even their game. Especially since I have no idea what version you're working off of. Since we have an ongoing beta, it's best all fixes go in the dev thread so they can be included with the release if the fix is good. There's also no active git where you could push the changes to. The public one hasn't been updated in years, so all fixes go through kimy. Edited June 19, 2022 by zarantha
zarantha Posted June 19, 2022 Posted June 19, 2022 28 minutes ago, David Willers said: Hello for some reason my MO2 detects this mod as plugin (esp) 43 type instead of 44, how does that come? thought this mod is already converted Form 43 works fine on SE. And this mod doesn't have any records that would need form 44. Just ignore the warning. As long as you grabbed the download with 'SE and VR' in the file name, everything that needs to be converted is converted. If you're going to be gungho and require the version update, then install the beta from the troubleshooting post.
zarantha Posted June 19, 2022 Posted June 19, 2022 29 minutes ago, ponutpounder said: Will there be ever a light version? I don't usually use even half of those, and a lot of them are just recolors. I would love if I could just pick at least just one color to make this whole DDs family mods a lot less of a hog. Probably not.
David Willers Posted June 19, 2022 Posted June 19, 2022 1 hour ago, zarantha said: Form 43 works fine on SE. And this mod doesn't have any records that would need form 44. Just ignore the warning. As long as you grabbed the download with 'SE and VR' in the file name, everything that needs to be converted is converted. If you're going to be gungho and require the version update, then install the beta from the troubleshooting post. Awesome man thanks a lot! that's good enough
Roggvir Posted June 19, 2022 Posted June 19, 2022 3 hours ago, Elsidia said: My question was - you recommend to redo procedure LookupDeviceType(zad_DeviousDevice) to new version. I understand from script that now instead of string it returns integer. As in this If StorageUtil.GetIntValue(akActor, "zad_Equipped" + LookupDeviceType(zad_DeviousDevice) + "_LockJammedStatus") == 1 is used string because i ask how you see work this line) My recommendation to rework the LookupDeviceType() function (and any other similar functions), while utilizing the "power" of preprocessor defines, is to make things simpler, little bit faster, and also more user-friendly/convenient for the script authors. First, you have those "defines", which can be defined directly in the script source, or in some include file that your compilation pipeline tells the preprocessor to load. These "defines" are not understood by Papyrus compiler, they are for the preprocessor, which parses the script source and replaces any occurences of those "defines" into whatever they are defined to be replaced with, and then you give the resulting processed script source to Papyrus Compiler. For example, this is an unprocessed RAW script source, that Papyrus Compiler would fail to compile, not understanding what the hell that #define is, and subsequently not knowing what that NUMBER_TEN means: Quote ScriptName MyScript hidden ; this is one of those "defines" definition for the preprocessor (and will not be included in the preprocessor output) #define NUMBER_TEN 10 int function WhatIsTenPlusN(int _n) global return (NUMBER_TEN + _n) endFunction ...when you run the above RAW source through the preprocessor, it will replace NUMBER_TEN with a literal value of 10, and spits out a new source that the Papyrus Compiler can compile: Quote ScriptName MyScript hidden ; this is one of those "defines" definition for the preprocessor (and will not be included in the preprocessor output) int function WhatIsTenPlusN(int _n) global return (10 + _n) endFunction Now, why is that nice? You, as a scripter, will be always working with the RAW source, and instead of writing 10 you will write things like NUMBER_TEN. It may not seem like an improvement for the above oversimplistic example, but when you have dozens, or even hundreds of such values spread among pages and pages of dozens of script sources, suddenly it becomes very convenient to write __hood__, __gloves__, __gag__, ..., __armcuffs__, instead of 1, 2, 3, ..., 25, etc. When you see __armcuffs__, you instantly understand what it is. When you see 25, you think "wtf is this number?" and if you are not enough familiar with the context surrounding this value, you may have to look it up somewhere. It makes it impossible to make a mistake. If you make a typo and write __rmcuffs__ instead of __armcuffs__, the preprocessor won't recognize the malformed name, won't replace it, and therefore the Papyrus Compiler will throw an error directing your attention to your mistake. But if you make a typo and write 2 instead of 25, then there won't be any error, but the code won't do what you intended it to do, and it may take you a long time to find this mistake (if you even notice at any point in the game that something is not right). Another benefit is when you need to change the value(s). You don't need to hunt for every occurence of 25 in all your scripts to change it to 37, instead you just go wherever you define those "defines", change the value once and you are done (you also need to preprocess and recompile all the scripts, but that is just a matter of pressing Ctrl+F6 and waiting a few seconds/minutes depending on how many scripts you have to recompile). Of course, you can be EVIL ? and use properties instead: Quote int property __hood__ = 1 auto int property __gloves__ = 2 auto int property __gag__ = 3 auto ... int property __armcuffs__ = 25 auto ...which is not really a good way, IF you can avoid it (which you can), because what are properties? They often end up being calls to wrapper functions to get/set a hidden variable value - when you refer to an (auto) property within the same script that owns the property, the compiler optimizes the code to use the hidden variable right away, but when you refer to the property from any other script (as is QUITE OFTEN the case in DD and similar mods/frameworks), what you are then doing is calling the property getter, a function that returns the hidden variable value, with all the burdens of external function call (thread has to acquire a lock on the script that owns the property, having to wait for any other script that may have it currently locked to finish its job, which not only adds tiny bit of UNNECESSARY strain on the Papyrus VM, but it also increases risks of introducing deadlocks in case some badly written scripts enter the equation - rare, but happens). Why do this, when there is a way better, lightweight, and much more convenient solution in form of using preprocessor defines? 1
Elsidia Posted June 19, 2022 Posted June 19, 2022 1 hour ago, Roggvir said: Why do this, when there is a way better, lightweight, and much more convenient solution in form of using preprocessor defines? To be honest i'm hardly understand half of this post, but i try hard. What i understand is done by not got typo error in other mods scripts. Then what is wrong with this: Spoiler string Function LookupDeviceType(keyword kwd) if kwd == zad_DeviousPlug return "Plug" ElseIf kwd == zad_DeviousHeavyBondage return "WristRestraint" ElseIf kwd == zad_DeviousBelt return "Belt" ElseIf kwd == zad_DeviousBra return "Bra" ElseIf kwd == zad_DeviousCollar return "Collar" ElseIf kwd == zad_DeviousArmCuffs return "ArmCuffs" ElseIf kwd == zad_DeviousLegCuffs return "LegCuffs" ElseIf kwd == zad_DeviousArmbinder return "Armbinder" ElseIf kwd == zad_DeviousYoke return "Yoke" ElseIf kwd == zad_DeviousCorset return "Corset" ElseIf kwd == zad_DeviousClamps return "Clamps" ElseIf kwd == zad_DeviousGloves return "Gloves" ElseIf kwd == zad_DeviousHood return "Hood" ElseIf kwd == zad_DeviousSuit return "Suit" ElseIf kwd == zad_DeviousGag return "Gag" ElseIf kwd == zad_DeviousGagPanel return "GagPanel" ElseIf kwd == zad_DeviousPlugVaginal return "PlugVaginal" ElseIf kwd == zad_DeviousPlugAnal return "PlugAnal" ElseIf kwd == zad_DeviousHarness return "Harness" ElseIf kwd == zad_DeviousBlindfold return "Blindfold" ElseIf kwd == zad_DeviousBoots return "Boots" ElseIf kwd == zad_DeviousPiercingsNipple return "PiercingsNipple" ElseIf kwd == zad_DeviousPiercingsVaginal return "PiercingsVaginal" ElseIf kwd == zad_DeviousArmbinderElbow return "ArmBinderElbow" ElseIf kwd == zad_DeviousYokeBB return "YokeBB" ElseIf kwd == zad_DeviousCuffsFront return "CuffsFront" ElseIf kwd == zad_DeviousStraitJacket return "StraitJacket" ElseIf kwd == zad_DeviousBondageMittens return "Mittens" ElseIf kwd == zad_DeviousHobbleSkirt return "HobbleSkirt" ElseIf kwd == zad_DeviousHobbleSkirtRelaxed return "HobbleSkirt" EndIf Log("LookupDeviceType received invalid keyword " + kwd) EndFunction Entry there is keyword and you can't write wrong keyword. Also keywords in DD is made that you can understand about what type of item is speak. Function exit is none if entry is wrong or string text what can't understand wrong like "Gloves" If you fear typo then just send keyword to that function and it's returns correct string line of variable.
ImpaKt Posted June 19, 2022 Posted June 19, 2022 14 hours ago, Elsidia said: HDT SMP isn't support DD chains as it's limited functionality as LE version. If anybody writes a HDT physics nod 1 to 1 as in LE, chains will work. As for wrist chains - it never works in SE As for ankle chains - after put chains on, save a game, exit to Windows, start Skyrim again and load a save. While save is loaded chains will work. As load a save again not work, need repeat previous exit procedure. In theory ankle chains in HDT SMP doesn't need work, but with this voodoo it's somehow works. As Bethesda say: "It somehow works!" )) If chains still not work, then you have wrong HDT chains meshes need update to latest made by our hero Zarantha. Thanks, I was reading through the pages and found like 7 of the same questions. I'll try ur suggestion!
Roggvir Posted June 19, 2022 Posted June 19, 2022 (edited) 1 hour ago, Elsidia said: To be honest i'm hardly understand half of this post, but i try hard. What i understand is done by not got typo error in other mods scripts. Then what is wrong with this: Reveal hidden contents string Function LookupDeviceType(keyword kwd) if kwd == zad_DeviousPlug return "Plug" ElseIf kwd == zad_DeviousHeavyBondage return "WristRestraint" ElseIf kwd == zad_DeviousBelt return "Belt" ElseIf kwd == zad_DeviousBra return "Bra" ElseIf kwd == zad_DeviousCollar return "Collar" ElseIf kwd == zad_DeviousArmCuffs return "ArmCuffs" ElseIf kwd == zad_DeviousLegCuffs return "LegCuffs" ElseIf kwd == zad_DeviousArmbinder return "Armbinder" ElseIf kwd == zad_DeviousYoke return "Yoke" ElseIf kwd == zad_DeviousCorset return "Corset" ElseIf kwd == zad_DeviousClamps return "Clamps" ElseIf kwd == zad_DeviousGloves return "Gloves" ElseIf kwd == zad_DeviousHood return "Hood" ElseIf kwd == zad_DeviousSuit return "Suit" ElseIf kwd == zad_DeviousGag return "Gag" ElseIf kwd == zad_DeviousGagPanel return "GagPanel" ElseIf kwd == zad_DeviousPlugVaginal return "PlugVaginal" ElseIf kwd == zad_DeviousPlugAnal return "PlugAnal" ElseIf kwd == zad_DeviousHarness return "Harness" ElseIf kwd == zad_DeviousBlindfold return "Blindfold" ElseIf kwd == zad_DeviousBoots return "Boots" ElseIf kwd == zad_DeviousPiercingsNipple return "PiercingsNipple" ElseIf kwd == zad_DeviousPiercingsVaginal return "PiercingsVaginal" ElseIf kwd == zad_DeviousArmbinderElbow return "ArmBinderElbow" ElseIf kwd == zad_DeviousYokeBB return "YokeBB" ElseIf kwd == zad_DeviousCuffsFront return "CuffsFront" ElseIf kwd == zad_DeviousStraitJacket return "StraitJacket" ElseIf kwd == zad_DeviousBondageMittens return "Mittens" ElseIf kwd == zad_DeviousHobbleSkirt return "HobbleSkirt" ElseIf kwd == zad_DeviousHobbleSkirtRelaxed return "HobbleSkirt" EndIf Log("LookupDeviceType received invalid keyword " + kwd) EndFunction Entry there is keyword and you can't write wrong keyword. Also keywords in DD is made that you can understand about what type of item is speak. Function exit is none if entry is wrong or string text what can't understand wrong like "Gloves" If you fear typo then just send keyword to that function and it's returns correct string line of variable. As @picobyte pointed out, it is a rather inefficient way of getting a device type for given keyword, because of how those conditions are structured. If you happen to be looking up device type for the zad_DeviousPlug keyword, you get your answer ("Plug") very fast, because that keyword is checked for in the very first condition. But if you happen to be looking up device type for zad_DeviousHobbleSkirtRelaxed, which is checked in the very last condition, the code becomes extremely inefficient, because it must first evaluate ALL the previous conditions, before it can get to the last one (at which point it can finally return the correct answer "HobbleSkirt"). A better way, proposed by picobyte in his post, would be to build two arrays when the mod gets first initialized. First array would contain all the keywords. Second array would contain all the corresponding strings that the current LookupDeviceType() function is returning ("Plug", "WristRestraint", "Belt", "Bra", etc.). Quote keyword[] deviceKeywords string[] deviceTypes function ModInitialization() deviceKeywords = new keyword[128] deviceTypes = new string[128] deviceKeywords[0] = zad_DeviousPlug deviceTypes[0] = "Plug" deviceKeywords[1] = zad_DeviousHeavyBondage deviceTypes[1] = "WristRestraint" deviceKeywords[2] = zad_DeviousBelt deviceTypes[2] = "Belt" deviceKeywords[3] = zad_DeviousBra deviceTypes[3] = "Bra" ... endFunction Then the LookupDeviceType() function would simply use the native array.Find() to get the index of the keyword in the deviceKeywords array, and then use that index number to get and return the corresponding string in the deviceTypes array, which should be significantly faster in most situations: Quote string function LookupDeviceType(keyword kwd) int index = deviceKeywords.Find(kwd) if index > -1 return deviceTypes[index] endIf return "" endFunction And then i recommended to use the preprocessor defines, to make it yet a bit more simple by returning integers instead of strings, thus not needing the deviceTypes array, while still keeping it easy to work with and maintain thanks to using the defines: Quote #define __plug__ 0 #define __wristRestraint__ 1 #define __belt__ 2 #define __bra__ 3 ... keyword[] deviceKeywords function ModInitialization() deviceKeywords = new keyword[128] deviceKeywords[__plug__] = zad_DeviousPlug deviceKeywords[__wristRestraint__] = zad_DeviousHeavyBondage deviceKeywords[__belt__] = zad_DeviousBelt deviceKeywords[__bra__] = zad_DeviousBra ... endFunction function Whatever(...) int deviceType = deviceKeywords.Find(someDeviceKeyword) if deviceType == __plug__ ; nice and understandable define name instead of a confusing integer, yay! Debug.Trace("Oh look! it is a plug! Let's... plug something with it!") ... endIf endFunction ...i would also move all the data into JContainers, making it even more convenient for various reasons, but that is a story for another day I think i should stop cluttering the topic with this stuff. Edited June 19, 2022 by Roggvir 2
nameareoverratedanyways Posted June 20, 2022 Posted June 20, 2022 20 hours ago, Elsidia said: First read troubleshooting page: https://www.loverslab.com/topic/99700-devious-devices-se-51-2021-03-24/?do=findComment&comment=2247110 But now i give some small clue - remove all LE versions of mods, remove all old DD patches from another mods and remove noenchanment restriction mod or configure it as in troubleshooting page tells. I did have a look at the page previously, but didn't find anything obvious that matches what I'm seeing. I'm not running any LE versions or old patches. Closest thing I found on the page was the SLIF patcher which mentioned that having the wrong version would break device locks. Don't believe I have any version of the patcher. Also, what is SLIF?
zarantha Posted June 20, 2022 Posted June 20, 2022 1 hour ago, nameareoverratedanyways said: I did have a look at the page previously, but didn't find anything obvious that matches what I'm seeing. I'm not running any LE versions or old patches. Closest thing I found on the page was the SLIF patcher which mentioned that having the wrong version would break device locks. Don't believe I have any version of the patcher. Also, what is SLIF? Patches could be other mods that have patches for DD, like Devious Lore. Or it could be old script patches. There's a couple of mods that can have the same result - No Enchantment Restriction is one. It's best to make sure you don't have any of the mods mentioned in the conflicts or troubleshooting sections of the troubleshooting post. Make sure nothing is overwriting DD's scripts. In mod managers, that's the lightning bolts. If you don't see it in MO2, enable the conflicts column, or look at information -> conflicts. SLIF is SexLab Inflation Framework. For SLIF to work, it needed to integrate some code into DD's scripts. If the DD version of the script patch doesn't match the install DD version, then things break in DD. Could be quests, could be traps, usually it's device locks. Easiest way to test is to make sure your skyrim install folder is clean (use MO2, or do a purge in Vortex), then enable/deploy only DD and it's requirements. Start a new game and use something like additem menu or console in some devices from DDx to test with (DDa devices usually don't have the scripts and DDi doesn't have a good sample to test with).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now