Jump to content

jacobpaige

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by jacobpaige

  1. On 1/8/2024 at 2:39 AM, Pickysaurus said:

    This is not intended to be a link to our privacy policy, but it is for the ad provider, we'll let them know thanks. 

     

    This is the consent banner shown to us in this country (UK)

    image.thumb.png.ab368e8ad3bce64e602576cfa279f831.png

    So, where is the "manage cookie settings" option then? I'm getting the same message as the original poster, but I can't find "manage cookie settings" or "manage CCPA settings". Googling just gives this thread.

  2. On 2/11/2024 at 9:48 PM, Infamous95 said:

    In fo4edit find the outfits you dont want. Check to see if their attached to any other records and delete those. Just becareful of removing some records like leveled lists just remove the entry in the leveled list dont delete the whole thing etc. Also before you delete the armor check the file path for the meshes then I believe the mesh has the file path for material files and material files have the path for textures. Just make sure not to delete something thats in use elsewhere.

    Thanks 🙂

    On 2/12/2024 at 4:01 AM, fraquar said:

    Ran out of space?   Disk space?   i.e. storage space on your computer?

    Yeah.

    On 2/12/2024 at 4:45 AM, RoNin1971 said:

    removing meshes & materials will bring you nothing as they ar KB's in size.

    Textures might help a bit, but only a bit and only in large numbers. (MB's each, depends on size. 2k, 4k, 8k?)

     

    Still, no space... HDD/SSD i guess? Then you need to free a LOT more space. (& keep a bunch of GB's free for your PC to operate!)

    I was planning to delete about 60-70% of the mods, which would have freed up several gigs of space. Instead I decided to just upgrade my SSD since prices have dropped quite a bit since the last time I considered doing so.

  3. I recently tried to download all of vtaw's outfits, but ran out of space on my system. So, I'd like to go into each of the mods and remove the outfits that I know I'll never use to make space for the ones I wasn't able to download.

    Am I fine to just go to "'mod_name' -> armor -> 'clothing_item'" and delete it, or will that break something? Also, will this get rid of all the alternate materials/textures/meshes/etc.? If not, then how do I find the ones that aren't being used anymore so that I can delete those too? They're taking up the lion's share of the space, so not getting rid of them kinda defeats the purpose of doing this.

    Any help is appreciated.

  4. That's fine for changing individual records, but Vtaw has a ton of items in their clothing pack, so I'm trying to batch edit using FO4Edit since it's much, much faster. I'm just not sure how to identify the records that need editing when I export them for editing (as shown in the video I linked).

  5. I used this very helpful video to go through Vtaw's latest clothing pack and remove the defense from all of the items (for balance reasons), but now I'd like to go back and find all the pieces that are taking up actual armor slots and add defense back on. I'd also like to add energy resistance so that they're equivalent to their shadowed leather light armor equivalents, and increase their weight.

    I've run into two problems though:

    1. I found the tag in FO4Edit that says which slot the item occupies (BOD2 - Biped Body Template\[0]\[0]), but it returns 1, 11, or 111 when I export it, so I assume I'm doing something wrong.

    2. These items don't currently have resistances, so I'm not sure if I can use this method to add them without causing some sort of problem, or if there's another script that could do this if not. If scripts aren't the right option, then I'm fine with editing manually once I've identified all of them, but I'm uncertain if it's safe to do so in FO4Edit, or the process to do so.

    Any help would be appreciated.

  6. Yeah using UIExtensions you have to restate the menu entries each time before you open the menu, so no need to do anything special. Presumably you're planning to make a formlist or array of followers?

    UIExtensions can handle this very well

    Basically you make a While loop, e.g.

    i = 0

    While i < Formlist.GetSize()

    MyUIListMenu.AddEntryItem(i.GetName(), etc etc insert other parameters here)

    i += 1

    EndWhile

    MyUIListMenu.OpenMenu()

     

    Etc etc

    And hey presto! Your dynamic menu.

    Let me know if you need any more guidance on this, I have been using UIExtensions's list menu to make my own dynamic menus for my mod in progress

     

    Adding three dependencies (SKSE, SkyUI, and UIExtensions) sounds like a bit much just to have a dynamic menu, especially when it's not the main focus of the mod. I don't know that people would even want to download my mod if they didn't already have all three. I'm sure most people already have the first two, so they aren't as much of an issue, but is UIExtensions really necessary for this? I know it makes the menu vertical and scrollable, which would make it look nicer and save me having to split it up when people have a dozen followers, but does it do anything else that would warrant its inclusion for what would basically just be a simple selection menu?

  7. Maybe I'm just doing something wrong. Here's what I did that didn't work:

    1. Setup a quest to find the mannequins nearest the player (with a script on the player to start the quest).
    2. Setup a perk using the same options as doomTowerPerk, but with the condition on Target being isInList [MannequinActivateTrig, PlayerHouseMannequin] and with no requirements on the Subject.
    3. Added the code below as the perk fragment. It basically just resets the quest and then polls the aliases within the quest to try to figure out which one is the mannequin that owns the activator the player just pressed.

     

     

    ;BEGIN FRAGMENT Fragment_19
    Function Fragment_19(ObjectReference akTargetRef, Actor akActor)
    ;BEGIN CODE
    MannequinEquipmentTradingQuest.Reset()
    MannequinEquipmentTradingQuest.Stop()
    MannequinEquipmentTradingQuest.Start()
    Utility.Wait(0.01) ;give quest a chance to populate aliases
    
    Actor mannequin
    int index = 0
    
    while(index < 3)
        mannequin = ((MannequinEquipmentTradingQuest.GetAlias(index)) as ReferenceAlias).GetReference() as Actor
        if mannequin && akTargetRef.isActivateChild(mannequin)
            EquipmentTradingSpell.Cast(mannequin, akActor)
            index = 4
        endif
        index += 1
    EndWhile
    
    if index == 3
        Debug.MessageBox("Could not find matching mannequin")
    endif
    ;END CODE
    EndFunction
    ;END FRAGMENT
    
    ;END FRAGMENT CODE - Do not edit anything between this and the begin comment
    
    SPELL Property EquipmentTradingSpell  Auto  
    
    Quest Property MannequinEquipmentTradingQuest  Auto  
    
    

     

     

     

    But all of that does nothing. When I walk up to a mannequin and click on it, it just opens its inventory.

  8.  

    It would seem that I was right the first time. The papyrus fragment problem wasn't hard, but I still can't figure out how to get the perk to recognize that I've clicked on a mannequin. I've tried GetIsRace == ManakinRace and GetIsInList [MannequinActivateTrigger, PlayerHouseMannequin], but neither work. I'm really not sure what else I can do to distinguish them, and I still don't see how doomTowerPerk is identifying locks.

     

    This is because what you activate with stock mannequins is not the mannequin itself, but an activator called MannequinActivateTrig, which passes the activation along to the mannequin processes. Also, make sure you're looking at the correct condition list: There's the condition list for choosing the perk at all, on the main perk screen, and the condition list on the perk entry point, which (for the Tower stone) will have two tabs, 'Subject' and 'Target'. In doomTower's case, the subject tab has the cooldown condition and the Target tab contains the conditions that a. the target needs to be locked and b. can't be a Master or Key lock.

     

    Well, that's why I added MannequinActivateTrig to the FormList. Just in case that was the problem. It still didn't work. Even the debug notifications didn't happen.

     

    Ah, I totally didn't think to look at the target tab of doomTowerPerk. I'll give it another look.

     

    Edit: I decided to assume that the script was simply not running because it knew that an activator can't cast a spell, so I was trying to refactor it to point at the mannequin that the activator belonged to. Unfortunately, I can't seem to find a way to ask it what it activates.

  9. It would seem that I was right the first time. The papyrus fragment problem wasn't hard, but I still can't figure out how to get the perk to recognize that I've clicked on a mannequin. I've tried GetIsRace == ManakinRace and GetIsInList [MannequinActivateTrigger, PlayerHouseMannequin], but neither work. I'm really not sure what else I can do to distinguish them, and I still don't see how doomTowerPerk is identifying locks.

  10.  

     

     

    You have no idea how much time I've wasted on trying to find a better way to access the entire inventory. It'll help a ton with another mod I'm working on. If I alter one form in the list though, will it alter every instance, or just a random one? Specifically, I'm changing armor and damage ratings on equipment.

     

     

    Set operations performed on a non-ObjectReference Forms (e.g. Weapon, Armor, etc) I believe will change all instances of it throughout the game. AIUI they're also prone to unintended consequences. I haven't personally used them much, though, so I can't speak to if the ones you're intending to use have those issues.

     

    Ah, yes, if it affected all the NPCs too then that would be bad. I expect my current approach has the same problem and I've just not tested for it. I may have to give up on that mod :(

  11. I can't figure out how the doomTowerPerk is recognizing locks. Everything else is fairly self-explanatory, and I think I could probably make the necessary changes fairly easily, but if I don't understand the how it recognizes a lock, I can't redirect it to mannequins.

     

    Edit: Still not sure how it's doing it, but I think I know how I can do it. I just have to figure out how to get a papyrus fragment to compile when it won't let me define a property necessary for compilation until after it's been compiled.

  12.  

    I meant their equipped items, but accessing their inventories is also possible (much less painful with SKSE, but doable even in vanilla). With SKSE, you can use GetContainerForms() to get a Form[] array back, containing every form the actor has at least one of, or alternatively you could iterate through a GetNthForm() loop. GetContainerForms() is by far the better choice; it's not documented on the wiki, but I use it extensively after being pointed to it by cdcooley, and it works beautifully.

     

    In vanilla, you'd need to do the dump/onitemremoved combination to build a list, then bring everything on that list back. It's awkward and slow and suboptimal, but possible.

     

     

    As regards processing a lot of mannequins: Yes, there's some impingement on the script engine, but because you're running the scripts on separate aliases, you get to take advantage of papyrus's multithreading; they'll all run slower, but they'll also all complete at more or less the same time. The total execution time is generally significantly shorter than running them all in sequence would be, too, because of the way the frame-linked functions work. There's a period of increased vulnerability to stack dumps if something else dramatic happens during the execution, but it isn't terribly likely to happen.

     

    W.r.t. the activation option, look at how the Tower perk is implemented in the CK. What happens ingame is that you get a messagebox popup when you activate something (which you can filter through the condition systems) that looks like this:

     

    https://youtu.be/lhX108ee0U4?t=320

     

    There'll be the normal activation text, that executes whatever OnActivate and default processing occurs, and then there'll be your custom activation option that can be chosen. It's rather obtrusive, but this may let you get things to play nice with other scripts. As I said, I want to test this, since I'm not completely sure of what will happen with competing OnActivate() events. There's some other approaches that could be taken with perks to shift things around too that I might experiment with.

     

    W.r.t followers: given the target range, I think a check against PotentialFollowerFaction will be more accurate (and faster) than the GetOutfit() check you're currently using.

     

     

    You have no idea how much time I've wasted on trying to find a better way to access the entire inventory. It'll help a ton with another mod I'm working on. If I alter one form in the list though, will it alter every instance, or just a random one? Specifically, I'm changing armor and damage ratings on equipment.

     

    Ah, I thought you meant the Tower of Strength perk, not the ability you get from the Tower Stone. That sounds like a much better idea than what I've been doing and should completely remove the need for compatibility patches with other mods :D I'll have a look at the perk and see how it's doing what it's doing and if I can replicate it. Thanks :smile:

     

    Well, the GetOutfit check is necessary to prevent item duplication. The fact that it also let me find followers was an added bonus that allowed me to not have it as a separate check. Still, if it's an attribute that can be quickly checked, rather than a list that has to be compiled and iterated over, then it's probably worth doing anyway. I'm just not sure if it would cause problems with custom followers. I've not made one before, so I don't know if PotentialFollowerFaction is a required faction for anyone that might follow you.

  13. FWIW RedDragon, I have trouble following your rewrites of my code too. It's a pretty major style clash.

     

    @jacob:

     

    I *think* I have an approach that can meet most of those things, perhaps even all, but I'll need to do some testing to see if it'll work as I think. My rough plan is to use a perk to add an activation option, similar to the Tower perk, whenever you're trying to activate a default mannequin's linked activator, and a search quest to find all mannequins in a loaded area whenever the player loads a new cell. This will then allow scripts to be applied to those mannequins via alias, which will run only if the custom activation option is chosen. The alias scripts can probably also pre-check the mannequin's inventory for the swap logic.

     

    Regarding the followers portion: Is this to work only on the currently active follower(s), or any follower active or not, or any potential follower?

    How would you access the mannequin's inventories? I haven't been able to find anything that would let me do that short of removing everything then sending it all back and monitoring it through an OnAddItem event, which requires a chest for each mannequin. Or do you mean their equipped items?

     

    Either way, if the player walks into a room with 50 mannequins, wouldn't polling them all for their outfits create a noticeable lag? Especially for people with lots of mods that use scripts? Or were you thinking something like a cloaking spell with a very limited range so that you'd never catch more than a few mannequins at a time?

     

    So, how would the player decide if they wanted normal (whatever that means for them) activation vs. an equipment swap? Tie the perk to whether or not the spell was equipped in the player's hand or something? Would that also be able to switch back to the normal activation if the player unequipped the spell? I've not done much with quests or perks yet so I'm very hazy on the details.

     

    At minimum, active followers, at maximum, those that are currently willing to follow. This is mainly meant to make it quick and easy for people to rearrange their and their followers' wardrobes without having to go through a few dozen menus and dialogue trees while the followers constantly make discontent comments about carrying their burdens. I'm sure there are plenty of people out there, especially RPrs and fashionistas, that like to change everyone's outfits frequently. I just wanted to make that process less painful.

  14. Or just rewrite your main function to have it all in a single loop, so that the first equipment swap can start right away. Maybe even add some fancy visual effect that justifies the spell taking it's time. With video games it's more important to provide quick feedback to the action, then to complete it instantly.

     

    It's already giving visual feedback with the healing animation. It just takes a few seconds after that for the actual swap to occur, which is what I was trying to fix.

  15. How you approach this is going to depend on what exactly you're after. As I understand it, you're trying to do the following:

     

    1. Allow the player to swap their equipped gear with that on a mannequin or follower (but not NPCs in the general case?);

    2. Allow them to do so either through activating the mannequin or casting a spell on either the mannequin or the follower. (Maybe also through follower dialogue? Not specified yet);

    3. Do so in a way that will play relatively nicely with other mannequin-modifying mods;

    4. Still allow vanilla activate->show inventory mannequin inventory management to occur.

     

    Is that correct? Are there any other pieces to this? Am I missing anything?

     

    Well, the minimum functionality was just being able to swap gear with mannequins and followers. Since all NPCs have pre-determined Outfits, it's pretty easy to rule out non-followers, but if people want to mod their games to get rid of Outfits on all NPCs, then this will wind up working on non-followers. For the moment, I've decided not to care about that edge case. If it becomes an issue, I'll add in more explicit logic to identify followers.

     

    As for casting a spell on the mannequin, that was my second approach (after giving up on dynamic menus), but I couldn't get the spell to hit the mannequin. Even when I turned off it's isGhost and isInvulnerable flags, it still just ignored the spell. It's why I switched to having it cast the spell at the player on activation instead. Regardless, I wanted to avoid doing it through dialogue since follower dialogue trees can get pretty crowded as it is and a large part of this mod is the convenience factor, which would be reduced by having to go through the dialogue options.

     

    It would definitely be nice if it didn't interfere with other mannequin mods, but I wasn't able to manage it. It's not hard to patch my modifications in (assuming you don't care about accessing the inventory directly), but it does currently require a patch.

     

    Honestly, I'm a bit on the fence about the fourth one. It wouldn't be that difficult to implement, but it would slow things down compared to my current implementation, and I'm not sure how much use people would actually get out of it.

  16. Dear jacobpaige,

     

    I find it offensive when someone who asks for help tries to teach the helpers. My English is not as good as yours, so I always try to take simple name convention that can understand everyone.

    Maybe someday you will get into such a situation. Nevertheless you have answered and shown gratitude.

     

    Here is the script optimized in runtime and stacksize usage, remember you gave us code snippets and wrote nothing about the mod purpose, that comes just slowly to the surface:

     

    Scriptname jpSwapArmorEffectScript extends ActiveMagicEffect
    {optimized by ReDragon 2018} ; swaps equipment between NPC and Player, if that NPC does not have a designated outfit.
    
    ; https://forums.nexusmods.com/index.php?/topic/6619756-code-optimization-questions/page-3
    ; jacobpaige wrote: "For reference, here's the current version of the code (still need to add the SKSE check)"
    
    ; "Thanks for all the suggestions by the way. I realize how much time it must have taken to write all that,
    ; and it's helpful to see the approaches that other people would have taken."
    
      FormList PROPERTY playerGearList auto Hidden        ; playerGearForSwapping
      FormList PROPERTY npcGearList    auto Hidden        ; npcGearForSwapping
    
      Int iBusy = 2        ; threadlock variable
    
    ; make both actors persistent for a while by using script variables
      Actor playerRef
      Actor npcRef
    
    ;-------------------------
    Bool FUNCTION myF_IsSKSE()
    ;-------------------------
    IF (SKSE.GetVersion() > 0)
        Return TRUE
    ENDIF
    ;---------
        Debug.Trace("jpSwapArmor: SKSE is missing! " +self)        ; see "papyrus.0.log" within folder "..\My Games\Skyrim\Logs\Script"
        Return False
    ENDFUNCTION
    
    ;---------------------------------------------------------
    Bool FUNCTION myF_IsPlayer(Actor akTarget, Actor akCaster)
    ;---------------------------------------------------------
        playerRef = Game.GetPlayer()
    
    IF (akTarget == playerRef)
        IF (akTarget == akCaster)
            Return False    ; player is both
        ENDIF
        npcRef = akCaster        ;    npc is the caster
        Return TRUE                ; * and player is target
    ENDIF
    ;---------
    IF (akCaster == playerRef)
        ; https://www.creationkit.com/index.php?title=GetNumParts_-_Outfit
        IF (akTarget.GetActorBase().GetOutfit().GetNumParts() == 0)            ; SKSE required! GetOutfit(), GetNumParts()
            npcRef = akTarget    ; npc ist the target
            Return TRUE            ; * and player is caster
        ENDIF
    ENDIF
        Return False        ; player not found
    ENDFUNCTION
    
    
    ; -- EVENTs -- 3
    
    EVENT OnEffectStart(Actor akTarget, Actor akCaster)
    IF myF_IsSKSE()
    ELSE
        self.Dispel()
        RETURN    ; - STOP - SKSE not found
    ENDIF
    ;---------------------
    IF myF_IsPlayer(akTarget, akCaster)
    ELSE
        self.Dispel()
        RETURN    ; - STOP - something is bad or missing player
    ENDIF
    ;---------------------
        RegisterForSingleUpdate(0.0)            ; create a second thread
        RegisterForSingleUpdateGameTime(0.0)    ; create a third thread
    
    ;---
        WHILE (iBusy)                ; (iBusy > 0)
            Utility.Wait(0.25)        ; we are hold on here
        ENDWHILE                    ; until both update events are finished
    ;---
        SwapEquipments()
        EquipPlayer()
        
        playerGearList.Revert()        ; cleanup both formlists
        npcGearList.Revert()
    ENDEVENT
    
    
    EVENT OnUpdate()
        GetWornEquipmentByPlayer()
    ENDEVENT
    
    EVENT OnUpdateGameTime()
        GetWornEquipmentByNPC()
    ENDEVENT
    
    
    ; -- FUNCTIONs -- (2) + 4 = 6
    
    ;------------------------
    FUNCTION SwapEquipments()
    ;------------------------
        playerRef.RemoveItem(playerGearList, 1, TRUE, npcRef as ObjectReference)
        npcRef.RemoveItem(npcGearList, 1, TRUE, playerRef as ObjectReference)
    ENDFUNCTION
    
    
    ;---------------------
    FUNCTION EquipPlayer()
    ;---------------------
    ;;;    form[] a = npcGearList.ToArray()    ; **OBSOLETE**
    
    int iMax = npcGearList.GetSize()
    int i = 0
        WHILE (i < iMax)
            playerRef.EquipItemEx( npcGearList.GetAt(i) )    ; SKSE !!
            i = i + 1
        ENDWHILE
    ENDFUNCTION
    
    
    ;----------------------------------
    FUNCTION GetWornEquipmentByPlayer()  ; Player action threading safe
    ;----------------------------------
    ; adapted from https://www.creationkit.com/index.php?title=Slot_Masks_-_Armor
    
    ;/ *** avoid next SKSE provided slotmasks
        int Property kSlotMask50 = 0x00100000 AutoReadOnly ; DecapitateHead
        int Property kSlotMask51 = 0x00200000 AutoReadOnly ; Decapitate
        int Property kSlotMask61 = 0x80000000 AutoReadOnly ; FX01
    ****** /;
    
        int iMask = 0x80300000            ; ignore slotmasks by default
        int iSlot = 0x00000001            ; init by 1
        int i
    
    WHILE (iSlot < 0x80000000)
        IF (Math.LogicalAnd(iMask, iSlot) == iSlot)     ; SKSE !!
            ; slots we have found equipped on already or excluded by initial
        ELSE
            form fm = playerRef.GetWornForm(iSlot)        ; SKSE !!
            IF (fm as Armor)
                playerGearList.AddForm(fm)
                i = i + 1
                iMask += fm.GetSlotMask()                ; SKSE !!    add all slots this item covers too
            ELSE
                iMask += iSlot            ; no armor was found on this slot
            ENDIF
        ENDIF
        iSlot = iSlot * 2                 ; double the number to move on to the next slot
    ENDWHILE
    
        iBusy = iBusy - 1
    ENDFUNCTION
    
    
    ;-------------------------------
    FUNCTION GetWornEquipmentByNPC()  ; NPC action threading safe
    ;-------------------------------
    ; adapted from https://www.creationkit.com/index.php?title=Slot_Masks_-_Armor
    
    ;/ *** avoid next SKSE provided slotmasks
        int Property kSlotMask50 = 0x00100000 AutoReadOnly ; DecapitateHead
        int Property kSlotMask51 = 0x00200000 AutoReadOnly ; Decapitate
        int Property kSlotMask61 = 0x80000000 AutoReadOnly ; FX01
    ****** /;
    
        int iMask = 0x80300000            ; ignore slotmasks by default
        int iSlot = 0x00000001            ; init by 1
        int i
    
    WHILE (iSlot < 0x80000000)
        IF (Math.LogicalAnd(iMask, iSlot) == iSlot)     ; SKSE !!
            ; slots we have found equipped on already or excluded by initial
        ELSE
            form fm = npcRef.GetWornForm(iSlot)            ; SKSE !!
            IF (fm as Armor)
                npcGearList.AddForm(fm)
                i = i + 1
                iMask += fm.GetSlotMask()                ; SKSE !!    add all slots this item covers too
            ELSE
                iMask += iSlot            ; no armor was found on this slot
            ENDIF
        ENDIF
        iSlot = iSlot * 2                 ; double the number to move on to the next slot
    ENDWHILE
    
        iBusy = iBusy - 1
    ENDFUNCTION
    
    
    ;/ *** SKSE implementation ********************************
    int Property kSlotMask30 = 0x00000001 AutoReadOnly ; HEAD
    int Property kSlotMask31 = 0x00000002 AutoReadOnly ; Hair
    int Property kSlotMask32 = 0x00000004 AutoReadOnly ; BODY
    int Property kSlotMask33 = 0x00000008 AutoReadOnly ; Hands
    int Property kSlotMask34 = 0x00000010 AutoReadOnly ; Forearms
    int Property kSlotMask35 = 0x00000020 AutoReadOnly ; Amulet
    int Property kSlotMask36 = 0x00000040 AutoReadOnly ; Ring
    int Property kSlotMask37 = 0x00000080 AutoReadOnly ; Feet
    int Property kSlotMask38 = 0x00000100 AutoReadOnly ; Calves
    int Property kSlotMask39 = 0x00000200 AutoReadOnly ; SHIELD
    int Property kSlotMask40 = 0x00000400 AutoReadOnly ; TAIL
    int Property kSlotMask41 = 0x00000800 AutoReadOnly ; LongHair
    int Property kSlotMask42 = 0x00001000 AutoReadOnly ; Circlet
    int Property kSlotMask43 = 0x00002000 AutoReadOnly ; Ears
    int Property kSlotMask44 = 0x00004000 AutoReadOnly ; Unnamed
    int Property kSlotMask45 = 0x00008000 AutoReadOnly ; Unnamed
    int Property kSlotMask46 = 0x00010000 AutoReadOnly ; Unnamed
    int Property kSlotMask47 = 0x00020000 AutoReadOnly ; Unnamed
    int Property kSlotMask48 = 0x00040000 AutoReadOnly ; Unnamed
    int Property kSlotMask49 = 0x00080000 AutoReadOnly ; Unnamed
    int Property kSlotMask50 = 0x00100000 AutoReadOnly ; DecapitateHead  * masked out
    int Property kSlotMask51 = 0x00200000 AutoReadOnly ; Decapitate      * masked out
    int Property kSlotMask52 = 0x00400000 AutoReadOnly ; Unnamed
    int Property kSlotMask53 = 0x00800000 AutoReadOnly ; Unnamed
    int Property kSlotMask54 = 0x01000000 AutoReadOnly ; Unnamed
    int Property kSlotMask55 = 0x02000000 AutoReadOnly ; Unnamed
    int Property kSlotMask56 = 0x04000000 AutoReadOnly ; Unnamed
    int Property kSlotMask57 = 0x08000000 AutoReadOnly ; Unnamed
    int Property kSlotMask58 = 0x10000000 AutoReadOnly ; Unnamed
    int Property kSlotMask59 = 0x20000000 AutoReadOnly ; Unnamed
    int Property kSlotMask60 = 0x40000000 AutoReadOnly ; Unnamed
    int Property kSlotMask61 = 0x80000000 AutoReadOnly ; FX01            * masked out
    ************************************************************ /;

     

     

     

    Once more for the future, if you use script code or suggestions provided by other forum users,

    its a good idea to say thank you within the source code, not only anonymous inside a forum thread

    that will be forgotten next month.

     

    I actually put the credit in the mod description where people are actually likely to see it. You can click the link in my signature if you'd like to check. Also, I like to help people, especially those that are trying to help me. I'm sorry that my attempts to help offended you instead.

     

    I didn't realize that there were two updates you could simultaneously register for. I'll have to revisit the code and see if I can work that in without breaking anything :wink: Thanks :smile:

     

    In the SwapEquipments function, why are you casting the two Actors as ObjectRefrences?

     

    I did originally try what you're doing in EquipPlayer with the FormList, and while it did compile, it didn't actually work. Though, looking back on it, I was still making a lot of mistakes with properties, so I'll give it another go and make sure that that's not what was going on.

     

    Does threading not spawn a copy of the function and its variables for each thread? If it does, then why have two GetWornEquipment functions? If it doesn't, then that's incredibly bad design.

  17. I would suspect that it is the base armor value since GetArmorRating is pulling from the form while SetArmorRating is modifying the form. Any modifications done by perks and the like would be done on top of that. Only one way to really to know for sure and that would be to test it.

     

     

    As for your last query, I do not know. Not all containers (especially those with CK defined items) can be polled for contents until the player actually interacts with them. You could possibly have one of the 'cloaking' quests which grabs nearby containers to put into aliases where you've got a script which will scan the contents when it is activated. But there is still the chance that the first item highlighted by default is an armor piece with the now incorrect value. I can't think of anything clean to achieve what you want.

     

    I suspected as much (and will be testing once I've done a bit more research into my options), but I was hoping someone already knew. Thanks :)

     

    Would the cloaking method be a good idea in a dungeon or cluttered interior? Some of them, especially player homes, have a ton of containers. Would tagging them all be likely to result in a noticeable slowdown? I'd just test it, but my machine is quite weak and probably couldn't even run the more extreme mods.

     

    Though, I'm not sure it matters since I can't seem to find a way to actually "see" what's in a container.

  18. Specifically, which armor rating is it modifying? Is it the base armor rating of the item, or the adjusted armor rating after accounting for smithing improvements and player enchantments, skills and perks? Or something in between?

     

    I was wanting to make a mod that would ignore the base armor value of all the armors in the game, but still care about smithing improvements etc., but I wasn't sure if simply using this function in an OnItemAdded event to set the armor ratings to zero would do that, or if I'd need to do something a bit more involved.

     

    Also, is there an event (or whatever) that I could use to catch and modify any armor/shield item before the player sees its armor rating? Without individually modifying each of them in the CK that is. Perhaps a way to scan through any containers or barter menus when the player opens them? Or a way to intercept the information as it's about to be displayed to the player? Or maybe a hidden armor perk?

  19. I figured out why it wasn't working. It was a load order issue. But now I have a new problem. My mod is overriding the re-texturing from another mod now that I've moved it down in the order, and I really hate the way vanilla mannequins look. Is there a way to attach my script to every mannequin in the game (not just vanilla) that will work with other mannequin mods? I considered using a quest, but, as far as I can tell, that won't allow me to affect all mannequins period, nor would it actually allow me to remove the vanilla activator script from the mannequins so that I could attach my own, so that I don't have to worry about both scripts trying to run at the same time.

  20.  

    As I was coding up the non-SKSE version, I realized that I was also using SKSE to figure out what the two actors are equipped with. As far as I can tell, there is no vanilla equivalent. Is that right? If so, then my script is basically just going to have to print a message/notification to the player letting them know that they need to get SKSE if they want my mod to work.

     

    If you're working *strictly* with mannequins you should be able to pull the list of forms from their mannequin script and check those with IsEquipped.

     

    Honestly, the most common use case I expect for this is people casting it on a mannequin and then on a follower and then on the mannequin again. So much so that I considered making it three spells, one to target self, one to target an NPC and one to actually carry out the swap, but it ran into a problem with not being able to hit mannequins with spells.

     

    I also considered just doing everything through a dynamically created menu that would list the player and all the player's followers when clicking on a mannequin, but that didn't allow the player to swap with the followers directly, and would have added a SkyUI dependency.

  21. As I was coding up the non-SKSE version, I realized that I was also using SKSE to figure out what the two actors are equipped with. As far as I can tell, there is no vanilla equivalent. Is that right? If so, then my script is basically just going to have to print a message/notification to the player letting them know that they need to get SKSE if they want my mod to work.

  22. This is intended specifically to work only with mannequins, to be clear? What's your goal exactly; what are you trying to change about the default activation setup?

     

    At a minimum, I want the activation to result in the mannequin casting the spell with the effect we've been discussing on the player. I can do this quite easily if I alter the activation script directly, but then the mod can never be removed, so that seems like a really bad idea. This is why I was trying to simply make a child of the activation script and override the OnActivation event, which failed for unknown reasons. Here's the code for reference. It's basically just the original code with a lot of the commented code removed, a single line changed and an additional property.

     

     

    Scriptname MannequinGearTradeOnActivateScript extends MannequinActivatorSCRIPT  
    
    Spell Property EquipmentSwappingSpell Auto
    
    EVENT OnActivate(ObjectReference TriggerRef)
    	PlayCurrentPose()
    	EquipmentSwappingSpell.Cast(self, Game.GetPlayer())
    	
    	;Trace("DARYL - " + self + " Moving to my linked ref")
    	MoveTo(GetLinkedRef())
    	
    	;Trace("DARYL - " + self + " Waiting a second to give me some time to animate to my pose")
    	utility.wait(0.1)
    	
    	;Trace("DARYL - " + self + " Disabling my AI so i'll freeze in place")
    	self.EnableAI(FALSE)
    
    EndEVENT	
    

     

     

     

    If possible, I'd also like to make it so that other mods affecting mannequin behavior can coexist with mine. Though, I'm not really sure what that would entail. I was kind of hoping that kicking control back to the parent script would solve the issue for at least some of them, but I honestly don't know if it would since I don't (and can't) know how they all are ( or will be) implemented.

  23.  

    It might be worth investigating the array system and seeing which one is actually faster, though. Jacob's saying the scan is really slow, so perhaps working with an array and then down-sizing it, avoiding AddForm, is a better call.

     

    Also, jacob, I notice your current implementation still retains the scan of both player & npc. You could cut the time of the scan down in half by doing the preload, and on the activator side even further -- you say it's linked to a mannequin, and so if that's a static link and not a dynamic target like the spell, you can also track exactly what the mannequin has equipped. That pulls your activator case to the two RemoveItem calls and then the Equip loop.

     

    With an SKSE check you can also have your script fail gracefully via using non-SKSE functions as a backup option. They'll be slower but your use of SKSE is relatively limited (ToArray and EquipItemEx) and there are vanilla ways to make those work. You'll need an alias on the player to listen for OnPlayerLoadGame() to check for it, though.

     

    I actually noticed a very clear difference after switching to FormLists. Before, the NPC would be naked for a while. Now, the clothing swap is basically instantaneous once it happens. The only slow part is the actual compilation of the lists.

     

    I'm trying to make it affect all mannequins in the game. So, if someone were rearranging their displays by swapping gear with various mannequins, and changing a few items they themselves were wearing inbetween mannequins, then both lists would be changing constantly. Or is there a way to create a FormList linked to every mannequin in the game (that wouldn't waste massive amounts of memory)? If so, that would dramatically reduce the number of checks I'd need to do since I could just adjust the lists in the OnAddItem and OnRemoveItem events. Though, in this case, I'd be back to the problem of keeping the lists straight during the swap and subsequent EquipPlayer().

     

    The non-SKSE version is a good idea. I'll work it in once I've taken care of the other, higher priority items. Though, I'll have to leave the player naked if I don't use SKSE, or specifically ignore player enchanted items. Or was that bug fixed in EquipItem()?

     

    Speaking of mannequins, I was checking how hard it would be to uninstall my mod, and even with a complete reinstall of the game the changes to mannequins didn't go away. So, I manually reverted the changes and I'm currently writing a script that inherits from the mannequin script that I'll attach to the mannequins instead. And since I'm doing it this way, it occurred to me that I could add a menu and have one option be Swap and the other be Normal Activation (or whatever), which would call the original activation method. This would allow the possibility for other mannequin related mods (posing or whatever) to function as intended, and give players the option to dress the mannequins without stripping themselves.

     

    Is there a way to pass the activation event to the parent script, or do I just need to duplicate that part of the code and not worry about compatibility with other mods?

     

    Edit: Actually, just tried it in game and, for whatever reason, the parent script's OnActivate took precedence over the child's. Is there a way to fix that without altering the parent script?

×
×
  • Create New...