Shade1982 Posted January 23, 2017 Share Posted January 23, 2017 (edited) I think the idea by IsharaMeradin to use an array is very well. Maybe the following could be a useful alternative. Scriptname MannequinActivatorSCRIPT extends Actor ; that is the vanilla actor script attached to each mannequin Scriptname PF_MannequinStay_000D7510 Extends Package Hidden ; that is the vanilla package script, which runs if mannequin is changing the current package Scriptname MannequinActivatorInitArmorSCRIPT extends Actor {theory by ReDragon 2016} ; link: https://forums.nexusmods.com/index.php?/topic/5202710-mannequins-that-are-already-dressed-on-cell-load/ ; Skyrim Creation Kit and Modders ; workflow as follow ; ~~~~~~~~~~~~~~~~~~ ; move this source file "MannequinActivatorInitArmorSCRIPT.psc" into subfolder /scripts/source ; of your Skyrim installation ; ; open creation kit and load skyrim.esm and update.esm ; do not alter the vanilla mannequin base object, which you will find in ; Skyrim.esm as PlayerHouseMannequin [NPC_:00089A85] with formID 0x00089A85 ; make a copy of this NPC and attach this actor script as additional, you should have two scripts attached ; compile the source file to get the executable file "MannequinActivatorInitArmorSCRIPT.pex" inside folder "scripts" ; ; now go to indoor cell you like to have new Mannequins and place a working mannequin here, ; it should have three parts ; 1 XMarkerHeading [STAT:00000034] ; 2 MannequinActivateTrig [ACTI:000D750D] ; 3 PlayerHouseMannequin [NPC_:00089A85] the vanilla base object ; ; change the vanilla base object with your created copy of "PlayerHouseMannequin" ; fill the script array with a weapon and these clothes you like to have, ; keep in mind: if you use two rings only the last will be shown, or you use a shield and ; a two-handed weapon only the last item wins the equipment ; ; save your work as new esp file, for example "MannequinEquipper.esp". Form[] PROPERTY a auto ; add 1 weapon and clothes (9 as max) as default items ; Schwert, Helm, Rüstung, Handschuhe, Stiefel, etc.. ; -- EVENTs -- 2 EVENT OnInit() ; http://www.creationkit.com/index.php?title=AddItem_-_ObjectReference ;;; RegisterForSingleUpdate(2.0) ; delay of two seconds should be enough RegisterForSingleUpdate( Utility.RandomFloat(2.0, 3.0) ) ; a bit asynchronously ENDEVENT EVENT OnUpdate() Debug.Trace(self+" OnUpdate() - has been reached..") int i = 0 WHILE (i < a.Length) form fm = a[i] ; get the item IF ( fm ) self.AddItem(fm, 1, TRUE) ; now add specific clothes myF_AddToSlot(i, fm) ENDIF i = i + 1 ; increment by 1 ENDWHILE myF_CleanUpArray() ENDEVENT ; -- FUNCTIONs -- 2 ;-------------------------- FUNCTION myF_CleanUpArray() ;-------------------------- form[] b ; create a temporary NONE array of same type a = b ; clean the script array property, we do not need it anymore ENDFUNCTION ;------------------------------------- FUNCTION myF_AddToSlot(Int i, Form fm) ;------------------------------------- MannequinActivatorSCRIPT ps = (self as Actor) as MannequinActivatorSCRIPT ; ps is the pointer to vanilla script IF ( ps ) ELSE RETURN ; - STOP - mannequin has not the vanilla script attached ENDIF ;--------------------- IF (i < 5) IF (i == 0) ps.ArmorSlot01 = fm ELSEIF (i == 1) ps.ArmorSlot02 = fm ELSEIF (i == 2) ps.ArmorSlot03 = fm ELSEIF (i == 3) ps.ArmorSlot04 = fm ELSEIF (i == 4) ps.ArmorSlot05 = fm ENDIF ELSE IF (i == 5) ps.ArmorSlot06 = fm ELSEIF (i == 6) ps.ArmorSlot07 = fm ELSEIF (i == 7) ps.ArmorSlot08 = fm ELSEIF (i == 8) ps.ArmorSlot09 = fm ELSE ;IF (i == 9) ps.ArmorSlot10 = fm ENDIF ENDIF ;;; self.EquipItem(fm) ; certainly unused ENDFUNCTION Your script seems to be exactly what I need, but I'm having trouble with the array syntax for some reason. Could you give me an example of how this should be? Form[] PROPERTY a auto ; add 1 weapon and clothes (9 as max) as default items ; Schwert, Helm, Rüstung, Handschuhe, Stiefel, etc.. Edited January 23, 2017 by Shade1982 Link to comment Share on other sites More sharing options...
cumbrianlad Posted January 24, 2017 Author Share Posted January 24, 2017 Thanks for the reply and for everyone else who tried to get this old duffer to comprehend papyrus. I'm still pretty sure that it's a form of writing material made from reeds or something. I wrote my scripts on paper, hoping that this would be close enough not to matter and posted them into the letter tray labelled DVDrr on the computer thing. It tried to eat it but spat it back out again. I guess there's no substitute for the old ways...it eats papyrus and nothing else, it seems. I may come back to this but scripts and me seem to go together like roaring fires and chocolate fire guards...mainly it's my brain that melts. I've got a workaround that suits me for this mod but sooner or later I'm sure to want to do this again. Maybe at that time I'll have found a supplier of authentic Egyptian papyrus and advanced my powers of cuneiform script writing*. * Only kidding folks, but thanks all the same. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 24, 2017 Share Posted January 24, 2017 (edited) .. Edited March 6, 2017 by ReDragon2013 Link to comment Share on other sites More sharing options...
Shade1982 Posted January 25, 2017 Share Posted January 25, 2017 Thanks for the reply, I'll give that a go later on. I also found a much easier way to dress mannequins, which doesn't require any extra scripting at all.Place all the items you want your mannequins to use somewhere outside of the player area. Link the world object to the mannequin you want dressed up. Add the default script "DefaultAddToLinkSCRIPT" (or something to that effect) to the world object (not the base object). Don't forget to set the script properties to true. I have no idea what they do exactly, but the description gives me the feeling they need to be set to true.I've tested this method and it works for me. But in theory, this probably only works once (which should probably be enough in most instances), so this method won't work in non-noresetzones. Link to comment Share on other sites More sharing options...
cumbrianlad Posted January 26, 2017 Author Share Posted January 26, 2017 Wow, shade1982, How the heck did you figure that out? Any sentence with the phrase "Doesn't require any scripting at all" is music to my ears! I think I'll give this a go. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 26, 2017 Share Posted January 26, 2017 (edited) .. Edited March 6, 2017 by ReDragon2013 Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 26, 2017 Share Posted January 26, 2017 (edited) .. Edited March 6, 2017 by ReDragon2013 Link to comment Share on other sites More sharing options...
Shade1982 Posted January 27, 2017 Share Posted January 27, 2017 If not you certainly want to use the following vanilla script. DefaultAddToLinkonLoadSCRIPT: scriptname DefaultAddToLinkonLoadSCRIPT extends objectReference {Add the reference to the linked container or actor inventory on Load} import Debug import Utility bool Property ShouldEquip = FALSE Auto { OPTIONAL: Set to TRUE if you want the actor to equip this item also. (DEFAULT = FALSE) Warning! - Has to be an actor! } bool Property ForceEquip = FALSE Auto { OPTIONAL: If set to TRUE the actor cannot unequip this themselves (ShouldEquip MUST be TRUE also). (DEFAULT = FALSE) Warning! - Has to be an actor! } bool Property AlreadyLoaded = FALSE Auto hidden ;;bool Property AllowDuplicates = FALSE Auto ;;{Check TRUE if you want the script to add the item even if the LinkRef already has one in its inventory (Default FALSE)} Event onCellLoad() if AlreadyLoaded == FALSE getLinkedRef().addItem(self, 1, true) ;Trace("DARYL - " + self + " added to " + GetLinkedRef()) if (ShouldEquip == TRUE) (getLinkedRef() as Actor).EquipItem(self.GetBaseObject(), ForceEquip) ;Trace("DARYL - " + self + " equipping onto " + GetLinkedRef()) endif AlreadyLoaded = TRUE endif endEvent That is the one I was talking about. Now I just have to figure out how to be able to get them to equip weapons as well. But that is a different issue entirely :). Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 27, 2017 Share Posted January 27, 2017 Getting mannequins to equip weapons...Unless you don't want to require users to use a mod like the Vanilla Mannequin Script Fix [VMSF] (which I can understand due to the added poses and stuff), you'll need to edit the MannequinActivatorScript yourself. I suggest using the USLEEP copy as there are corrections to be carried over. Then all you have to do is look for akBaseItem as Armorand change to ((akBaseItem as Armor) || (akBaseItem as Weapon) || (akBaseItem as Ammo)) There may also be an akBaseObject variation of the same as the original script uses OnObjectUnequipped. When I updated the VMSF, I had some reason to swap OnObjectUnequipped out for OnItemRemoved and so there is only the akBaseItem variation on that version of the script. Link to comment Share on other sites More sharing options...
z64fan13 Posted May 2, 2018 Share Posted May 2, 2018 Here's a method in Creation Kit that doesn't require any scripts. In short we're adding the armors as a "Skin" rather than a traditional outfit, which don't work with mannequins for some reason: Part 11) Make sure you have all the armor addons available in your .esp file for the armor you plan to dress the mannequin with. If you are using a custom armor mod, then you will need to duplicate those addons into your .esp. If you don't know what any of that means, then stop here. This process is too advanced for you. Watch some YouTube guides, then come back when you have some more experience with CK. 2) Find and Duplicate the Armor "ArmorManakin"3) Open the duplicate file and rename it to something easy to find (ex: "_modname_mannequinarmor")4) Under "Biped Object" click to highlight in blue all the armor slots you want the mannequin to be able to equip. 5) Under "Show All" and "Models" you should see the armor addons listed for the mannequin's naked hands, body and feet. Leave those alone.6) Save often, because creation kit crashes a LOT.7) Right click anywhere in the list's box and select "New" from the drop down. This will bring up the "Select Form" window8 ) Find and add the armor addons that you want the mannequin to wear by double clicking on them. You can use the "Filter" box to search for the addons by name. Repeat as needed.9) You should now have a complete list of armor addons in the Armor Window. Check the "show all" box if a few are missing. Some of them are hidden by default for some reason.10) At this point double click each armor addon in the list and make sure the "Manakin Race" is highlight in the "Additional Races" box, since some custom armors don't do this by default. Part 21) Save at this point, since CK crashes a LOT2) Find and Duplicate the Actor "PlayerHouseMannequin"3) Open the duplicate file and rename the "ID" box. Most of the tabs can be left as is. Don't touch the default mannequin activator script. It's there for a reason.4) Under the "Traits" tab use the drop down menu next to "Skin" to select the armor you created in Part 1. Hopefully you gave it an easy name to find.5) Check the "Female" box if you want the mannequin to be a female model. (NOTE: You may need to duplicate assets from a mod that puts females mannequins into the game. I do not believe vanilla skyrim has female mannequins by default)6) OPTIONAL: If you want the mannequin to hold the armor in it's inventory, then you can add them in the "Inventory" Tab. This will not affect the mannequin's default appearance. Removing the armors in-game also won't affect the appearance. I also added the duplicate ArmorManakin package from Part 1 to the inventory, but I don't think this is required for the mod to work. Do NOT add an outfit to the "Default Outfit". 7) Click "OK" and save.8 )You may now add your fully dressed mannequin to the game. Follow this guide if you don't know how: . If this link breaks, then just look it up on YouTube. DISCLAIMER #1: I have not tested every armor under the sun with this method nor do I plan to. Inevitably some HDT or BBP armor won't play nice with mannequins, so be prepared to tinker around if something breaks. Prior to writing this guide, I successfully dressed a Mannequin in the full Midnight Breed armor (BBP) and a KS HDT Wig. DISCLAIMER#2: This method sets the armor as the mannequin's "skin", which means the armor is in it's default appearance. It is intended for the mannequin to be an ornamental display. Because of this, if you want 5 different armored mannequins, then you need to go through the above process 5 times. Theoretically, you can add different armors to the mannequin in-game, but you have to make sure the new armor's priority is set higher than the default armor that is baked into the "Skin". You can change the priority in Creation Kit using the "armor addon" window for each of the armors. If you don't know what that means then educate yourself with YouTube or the CK wiki. TROUBLESHOOTING "The mannequin is naked in game"A: Double check Part 1 step 4) and 10). "Some of the armors are showing in game, but other aren't"A: Double check Part 1 step 4) and 10). Also, make sure 2 armor addons aren't assigned to the same armor slot. If they are, then the addon with the highest priority will win. The loser will not display. "The mannequin looks weird in the preview model in CK and/or the cell view. Did I screw up?"A: Probably not. The preview function and the cell view are notoriously inaccurate. Doubly true with custom armors or any item that uses HDT physics. Check the mannequin in-game before panicking. "I uninstalled the custom armor mod and now the mannequin is naked/invisible/a floating head"A: Working as intended. If you are adding the mannequin to a standalone mod, then you need to duplicate the armor assets (Part 1; Step 1). Otherwise, don't uninstall the original armor mod. "Now all the mannequins in-game are wearing the armor. What did I do?"A: This is why we duplicated the assets in Part 1, Step 2 and Part 2, Step 2. If you edited the original files, then bad things will happen. "I can't find the mannequin in-game"A: You likely skipped Part 2, Step 8. You need to add the mannequin to a cell for it to show up in game. "When I remove a piece of armor from the inventory, it doesn't change the mannequin's appearance"A: Working as intended. Read Disclaimer #2 again "The mannequin won't equip new armors that I give it in game"A: Read Disclaimer #2 again. Specifically the part about armor priority. "How did my mannequin get hair...and eyes.....and why can't I change it back in the 'body parts data" tab?"A: I believe this is a bug in the "manakin race". I ran into it too. Try redoing part 2 and make a new mannequin actor. If that doesn't work, then recreate the Manakin Race as a custom race. Bear in mind, you will have to repeat Part 1, Step 10 if you change the mannequin's race. "Where do I find female mannequin assets?"A: I used https://www.nexusmods.com/skyrim/mods/9131?tab=files "I did EVERY step in the guide and it still isn't working. I promise I did every step exactly"A: I promise you didn't. It's also possible you free-styled and added extra steps that broke the mannequin. Double check, then triple check each step. Check for conflicting mannequin mods, then go back and check every step again. When in doubt, refer to disclaimer #1. Link to comment Share on other sites More sharing options...
Recommended Posts