dagobaking Posted May 17, 2018 Share Posted May 17, 2018 I am trying to copy the worn items of one actor and equip them on another so that they look exactly the same. The problem I am having is that many armors have variations that seem to randomize automatically. Is there a way to override that randomization and control which variations appear when the item is equipped? Here is the function I am using currently: Function copyClothes(Actor a, Actor b) int i = clothes_scan_startslot While i < (clothes_scan_endslot + 1) Form clothesItem = a.GetWornItem(i).Item b.EquipItem(clothesItem, false, true) i = i + 1 EndWhile EndFunction Link to comment Share on other sites More sharing options...
akiras404 Posted May 18, 2018 Share Posted May 18, 2018 If your "variation" means "heavy/medium/light", it may be ObjectMod.In that case, GetWornItemMods will help. Not tested but code will be like this: Function copyClothes(Actor a, Actor b) int i = clothes_scan_startslot While i < (clothes_scan_endslot + 1) Form clothesItem = a.GetWornItem(i).Item b.RemoveItem(clothesItem, -1, true, container_tmp) b.addItem(clothesItem) ObjectMod[] mods = a.GetWornItemMods(i) int j = 0 While j < mods.length b.AttachModToInventoryItem(clothesItem, mods[j]) j = j + 1 EndWhile b.EquipItem(clothesItem, false, true) container_tmp.RemoveItem(clothesItem, -1, true, b) i = i + 1 EndWhile EndFunction Link to comment Share on other sites More sharing options...
dagobaking Posted May 19, 2018 Author Share Posted May 19, 2018 Thank you akiras404. This sounds promising. I will give it a shot tomorrow and let you know how it goes. Link to comment Share on other sites More sharing options...
dagobaking Posted May 21, 2018 Author Share Posted May 21, 2018 If your "variation" means "heavy/medium/light", it may be ObjectMod.In that case, GetWornItemMods will help. Not tested but code will be like this: Function copyClothes(Actor a, Actor b) int i = clothes_scan_startslot While i < (clothes_scan_endslot + 1) Form clothesItem = a.GetWornItem(i).Item b.RemoveItem(clothesItem, -1, true, container_tmp) b.addItem(clothesItem) ObjectMod[] mods = a.GetWornItemMods(i) int j = 0 While j < mods.length b.AttachModToInventoryItem(clothesItem, mods[j]) j = j + 1 EndWhile b.EquipItem(clothesItem, false, true) container_tmp.RemoveItem(clothesItem, -1, true, b) i = i + 1 EndWhile EndFunction What is the best way to set up the "container_tmp"? Is there an existing container that is commonly used for this kind of thing? If possible, I would prefer not to add things to the world. Link to comment Share on other sites More sharing options...
Yulliah Posted May 22, 2018 Share Posted May 22, 2018 You can always create a specific outfit with the exact armor bits included... Just make sure the outfit covers the exact bpdy parts the original outfit covers, otherwise it will crash the CK... Link to comment Share on other sites More sharing options...
dagobaking Posted May 22, 2018 Author Share Posted May 22, 2018 You can always create a specific outfit with the exact armor bits included... Just make sure the outfit covers the exact bpdy parts the original outfit covers, otherwise it will crash the CK... That's a very good solution for an individual play-through. But, I'm hoping for a solution that automates it via code for everyone. I think that the above code could work. But, I'm a little unsure what the best way to set up the temp container is. I've seen that kind of thing discussed for other mods before. But, haven't set it up myself. Link to comment Share on other sites More sharing options...
Recommended Posts