marmax Posted June 4, 2021 Posted June 4, 2021 3 hours ago, EgoBallistic said: I don't think any of your mods are interfering with Commonwealth Captives. There is likely some other reason it is not working. Can you run around to some locations that should spawn captives, then post your script log? That may reveal something. I already created the file. Here it is! Papyrus.0.log
Hiemfire Posted June 4, 2021 Posted June 4, 2021 47 minutes ago, marmax said: Yes, thank you. There really is that folder there and the file appears. You are welcome.
EgoBallistic Posted June 5, 2021 Author Posted June 5, 2021 13 hours ago, marmax said: I already created the file. Here it is! Papyrus.0.log 276.08 kB · 2 downloads It doesn't seem that Commonwealth Captives is loading at all in your game. The mod logs a couple of lines at startup, like this: [06/04/2021 - 03:32:05AM] EBCC_CaptiveManager: OnPlayerLoadGame ... [06/04/2021 - 03:32:06AM] EBCC_AnimationManagerScript: AAF API version 163 Beta but those are not in your log. There are no errors about Commonwealth Captives either. So it looks like the mod is not activated.
marmax Posted June 5, 2021 Posted June 5, 2021 2 hours ago, EgoBallistic said: It doesn't seem that Commonwealth Captives is loading at all in your game. The mod logs a couple of lines at startup, like this: [06/04/2021 - 03:32:05AM] EBCC_CaptiveManager: OnPlayerLoadGame ... [06/04/2021 - 03:32:06AM] EBCC_AnimationManagerScript: AAF API version 163 Beta but those are not in your log. There are no errors about Commonwealth Captives either. So it looks like the mod is not activated. It's strange, because I've installed it several times, (Always with the same result) I even did a complete reinstallation of the entire game folder, clean, and it's enabled in MCM! The "mode/plugin" is all enabled in Vortex. I just didn't activate the translation, because if I install it together with the original mode, it creates a redundancy (conflict). What is causing this?
EgoBallistic Posted June 5, 2021 Author Posted June 5, 2021 2 hours ago, marmax said: It's strange, because I've installed it several times, (Always with the same result) I even did a complete reinstallation of the entire game folder, clean, and it's enabled in MCM! The "mode/plugin" is all enabled in Vortex. I just didn't activate the translation, because if I install it together with the original mode, it creates a redundancy (conflict). What is causing this? I don't know. Whatever is going on is not normal. All I can tell you is that your script logs indicate the mod is not activated. Your script log does show that you have removed some mods. This can cause problems with your save. Try starting a new game and see if it still happens.
marmax Posted June 5, 2021 Posted June 5, 2021 4 hours ago, EgoBallistic said: Não sei. O que quer que esteja acontecendo não é normal. Tudo o que posso dizer é que seus logs de script indicam que o mod não está ativado. Seu log de script mostra que você removeu alguns mods. Isso pode causar problemas ao salvar. Experimente iniciar um novo jogo e veja se ainda acontece. Yes, I also thought it wasn't normal, later when I decide to start again I'll install it right away. Thank you! ?
EgoBallistic Posted June 6, 2021 Author Posted June 6, 2021 (edited) OMG this outfit crap. So in the current release of Commonwealth Captives there is a bug where, over time, your rescued settlers will go back to wearing only ropes. This happens because CC uses "outfits" to equip ropes and whatnot on the captives. What I didn't realize was that changing the outfit of a newly-spawned captive was causing every other instance of that NPC to also change outfits. If the game spawns "EBCC Female Captive 12" and puts a "ropes and collar" outfit on her, then every instance of "EBCC Female Captive 12" in the game gets that outfit applied to her. Which is bad. So I've been looking into ways to get around this. In the process, I finally discovered how SetOutfit() affects Actor and ActorBase records. So here it is: Calling SetOutfit() on an Actor that is based on a simple, non-templated, non-leveled ActorBase changes the Outfit of the ActorBase. Calling akActor.SetOutfit(X) will cause akActor.GetActorBase.GetOutfit() and akActor.GetLeveledActorBase.GetOutfit() to both return X. This is what causes the bug in CC 0.92 and 0.93. Calling SetOutfit() on an Actor that is based on a LeveledActor changes the outfit of the ActorBase that was chosen from the LeveledActor list. As above, calling akActor.SetOutfit(X) will cause akActor.GetActorBase.GetOutfit() and akActor.GetLeveledActorBase.GetOutfit() to both return X. This will have the same effect as the situation above. But... Calling SetOutfit() on an Actor that is based on a templated ActorBase only changes the temporary LeveledActorBase. It does not change the actual ActorBase nor any of the templates. Calling akActor.SetOutfit(X) will cause akActor.GetLeveledActorBase.GetOutfit() to return X, but calling akActor.GetActorBase.GetOutfit() will return the template's original outfit. And in this case akActor.GetLeveledActorBase() is a temporary FF-prefixed ActorBase we don't care about. Phew. So I created two new Leveled NPCs, EBCC_LChar_FemaleNPC and EBCC_LChar_MaleNPC. Each of these holds all the female and male settler ActorBases that are already in the mod. Then, I created two new ActorBases, EBCC_WorkshopNPCFemale and EBCC_WorkshopNPCMale. These are templated from EBCC_LChar_FemaleNPC and EBCC_LChar_MaleNPC respectively. Now in the scripts, instead of placing one of the individual female or male ActorBases like I did before, I place an EBCC_WorkshopNPCFemale or EBCC_WorkshopNPCMale depending on die roll. This results in a random male or female Actor, like before. But, unlike before, when I change this Actor's outfit using SetOutfit(), no other NPC is affected. I discovered all this through trial and error. It's certainly not documented. But using an ActorBase that is templated from that LeveledActor works as expected, I can change the outfits of individual NPCs without affecting the others. Oh - one other interesting and undocumented thing I discovered. Adding an item to an NPC using AddItem() will cause the NPC to refresh its outfit. So if you have an NPC with a Wastelander outfit, then you strip the NPC and EquipItem() some ropes on them, then you give them something via AddItem(), they revert to their Wastelander outfit. Ugh. Fortunately, now that I know about these behaviors, I can work around them. Edited June 6, 2021 by EgoBallistic 8
Karna5 Posted June 6, 2021 Posted June 6, 2021 12 minutes ago, EgoBallistic said: Oh - one other interesting and undocumented thing I discovered. Adding an item to an NPC using AddItem() will cause the NPC to refresh its outfit. So if you have an NPC with a Wastelander outfit, then you strip the NPC and EquipItem() some ropes on them, then you give them something via AddItem(), they revert to their Wastelander outfit. Ugh. Fortunately, now that I know about these behaviors, I can work around them. That's neat info on the template distinctions, EgoBallistic. Thanks for sharing that On a side note, I noticed in game that indeed AddItem resets their outfit--unless I have their inventory open with the OpenActorContainer first. If their inventory is open it does not reset their outfit. I don't know if there's a script method to open their inventory first, but if there's the equivalent then you can get around the AddItem issue like I do by command console
EgoBallistic Posted June 7, 2021 Author Posted June 7, 2021 (edited) 1 hour ago, Karna5 said: unless I have their inventory open with the OpenActorContainer first. If their inventory is open it does not reset their outfit. Yeah I forgot to mention that part. NPC outfit behavior is different when it is scripted versus when the player does it. As you say, using AddItem() resets their outfit, but adding an item manually does not. Also, if you have a script that equips some clothes or armors on an NPC, then dismiss them to a Settlement, the NPC will keep the newly equipped clothes on. But when you go visit the Settlement later they will have reverted to their Outfit. But if the player equips the same items at the same time the NPC will not revert to their Outfit. Very frustrating. 1 hour ago, Karna5 said: I don't know if there's a script method to open their inventory first There is - Actor.OpenInventory(). I think I'll give that a try just to see what happens. Edit: unfortunately, that won't work. Calling OpenInventory() pauses the script. I am going to stick with Outfits, which at this point is working well. Edited June 7, 2021 by EgoBallistic
Hiemfire Posted June 7, 2021 Posted June 7, 2021 (edited) 4 hours ago, EgoBallistic said: OMG this outfit crap. So in the current release of Commonwealth Captives there is a bug where, over time, your rescued settlers will go back to wearing only ropes. This happens because CC uses "outfits" to equip ropes and whatnot on the captives. What I didn't realize was that changing the outfit of a newly-spawned captive was causing every other instance of that NPC to also change outfits. If the game spawns "EBCC Female Captive 12" and puts a "ropes and collar" outfit on her, then every instance of "EBCC Female Captive 12" in the game gets that outfit applied to her. Which is bad. So I've been looking into ways to get around this. In the process, I finally discovered how SetOutfit() affects Actor and ActorBase records. So here it is: Calling SetOutfit() on an Actor that is based on a simple, non-templated, non-leveled ActorBase changes the Outfit of the ActorBase. Calling akActor.SetOutfit(X) will cause akActor.GetActorBase.GetOutfit() and akActor.GetLeveledActorBase.GetOutfit() to both return X. This is what causes the bug in CC 0.92 and 0.93. Calling SetOutfit() on an Actor that is based on a LeveledActor changes the outfit of the ActorBase that was chosen from the LeveledActor list. As above, calling akActor.SetOutfit(X) will cause akActor.GetActorBase.GetOutfit() and akActor.GetLeveledActorBase.GetOutfit() to both return X. This will have the same effect as the situation above. But... Calling SetOutfit() on an Actor that is based on a templated ActorBase only changes the temporary LeveledActorBase. It does not change the actual ActorBase nor any of the templates. Calling akActor.SetOutfit(X) will cause akActor.GetLeveledActorBase.GetOutfit() to return X, but calling akActor.GetActorBase.GetOutfit() will return the template's original outfit. And in this case akActor.GetLeveledActorBase() is a temporary FF-prefixed ActorBase we don't care about. Phew. So I created two new Leveled NPCs, EBCC_LChar_FemaleNPC and EBCC_LChar_MaleNPC. Each of these holds all the female and male settler ActorBases that are already in the mod. Then, I created two new ActorBases, EBCC_WorkshopNPCFemale and EBCC_WorkshopNPCMale. These are templated from EBCC_LChar_FemaleNPC and EBCC_LChar_MaleNPC respectively. Now in the scripts, instead of placing one of the individual female or male ActorBases like I did before, I place an EBCC_WorkshopNPCFemale or EBCC_WorkshopNPCMale depending on die roll. This results in a random male or female Actor, like before. But, unlike before, when I change this Actor's outfit using SetOutfit(), no other NPC is affected. I discovered all this through trial and error. It's certainly not documented. But using an ActorBase that is templated from that LeveledActor works as expected, I can change the outfits of individual NPCs without affecting the others. Oh - one other interesting and undocumented thing I discovered. Adding an item to an NPC using AddItem() will cause the NPC to refresh its outfit. So if you have an NPC with a Wastelander outfit, then you strip the NPC and EquipItem() some ropes on them, then you give them something via AddItem(), they revert to their Wastelander outfit. Ugh. Fortunately, now that I know about these behaviors, I can work around them. I wonder if the issue you figured out this work around for is the same one that keeps resetting vanilla npcs' outfits even in a vanilla game. Edited June 7, 2021 by Hiemfire
izzyknows Posted June 7, 2021 Posted June 7, 2021 46 minutes ago, Hiemfire said: I wonder if the issue you figured out this work around for is the same one that keeps resetting vanilla npcs' outfits even in a vanilla game. If I remember right... big if... that is supposed to happen as the player levels up. You can also see it with the vanilla caravan guards. As you reach higher levels they will have better armor. The settlers are pretty much the same as level is calculated from the player.
Tron91 Posted June 7, 2021 Posted June 7, 2021 @EgoBallistic How about not using the SetOutfit() or DefaultOutfit altogether. You can add a script to equip the outfit when the Captives are being spawned. Could be tricky as hell than as imagined in my mind. I have been using a Script for equipping outfits on Followers in Skyrim & Skyrim SE without utilizing the DefaultOutfit record so that there are no complications for changing outfits without using a Follower Framework. Was annoyed in seeing naked followers in Dragonsreach.
Tron91 Posted June 7, 2021 Posted June 7, 2021 (edited) @EgoBallistic Might be unwanted babbling, but is there a Papyrus or F4SE function to get an Object Reference from a dynamically spawned Actor? I mean I attach a script to the Actor Base but how can I get the Reference Object of the spawned Actor. Edit: Bummer, found out you cannot add an script to an NPC which is on a Leveled Actor List. The script section is simply ignored. Edited June 7, 2021 by Tron91 Update
High5Ghost Posted June 7, 2021 Posted June 7, 2021 Would it be possible to patch this to work with Real Name Settlers so the captives get randomly generated names?
EgoBallistic Posted June 7, 2021 Author Posted June 7, 2021 (edited) 1 hour ago, Tron91 said: @EgoBallistic How about not using the SetOutfit() or DefaultOutfit altogether. You can add a script to equip the outfit when the Captives are being spawned. Could be tricky as hell than as imagined in my mind. I have been using a Script for equipping outfits on Followers in Skyrim & Skyrim SE without utilizing the DefaultOutfit record so that there are no complications for changing outfits without using a Follower Framework. Was annoyed in seeing naked followers in Dragonsreach. Yes, that is also possible. I built a version of the mod that works like that. The Captives have no default outfit at all, and they get put in restraints by a script when they spawn. The problem with this approach is that any armor or clothing equipped by a script will be unequipped when the NPC is sent to a settlement. The only way they will keep their gear on is if the player manually equips it on them via the Trade menu. I prefer the Outfit approach because NPCs can automatically change into a Wastelander outfit when they are sent to a settlement, and they will actually stay in it unless the player changes it themselves. No more showing up at a settlement to be greeted by naked settlers. 53 minutes ago, Tron91 said: Might be unwanted babbling, but is there a Papyrus or F4SE function to get an Object Reference from a dynamically spawned Actor? I mean I attach a script to the Actor Base but how can I get the Reference Object of the spawned Actor. Actor akActor = PlayerRef.PlaceAtMe(MyActorBase) will spawns an instance of MyActorBase near the Player, and akActor is the Actor reference to that instance. Then you can call functions on the script, e.g. (akActor as MyActorScript).FunctionName() Edited June 7, 2021 by EgoBallistic
EgoBallistic Posted June 7, 2021 Author Posted June 7, 2021 44 minutes ago, Tron91 said: Edit: Bummer, found out you cannot add an script to an NPC which is on a Leveled Actor List. The script section is simply ignored. This is true, but there is a way around it. Make a new ActorBase, add your script to it, and make it use the Leveled Actor as its default Template. In the Template Actors tab, check all the boxes except for Script. When you spawn an instance of the ActorBase it will draw from the Leveled Actor List but the Actor will also have that script attached.
Tron91 Posted June 7, 2021 Posted June 7, 2021 (edited) 58 minutes ago, EgoBallistic said: The problem with this approach is that any armor or clothing equipped by a script will be unequipped when the NPC is sent to a settlement. The only way they will keep their gear on is if the player manually equips it on them via the Trade menu. You free them, their restraints are gone (assume you removed the ropes while you freed them) and they are naked. You give them something to wear, if you have any in your inventory. They keep wearing them while following you. After that from a safe location you send them to a Settlement. Does the WorkshopNPCScript give them a random outfit or they keep wearing the items you give them? Edit: Just checked the ConvertedSettlersScript in which you give them the WasteLander Outfit. I would say comment out the line. The PC knows while sending them to a Settlement that they are naked or dressed. So he/she should expect them to be either naked or dressed given the scenario in which they are sent to the settlement. I was finding it problematic as I always send them with a proper outfit, but when I find them on the way or in the settlement they are either in ropes or the wastelander outfit. Edited June 7, 2021 by Tron91 Update
Tron91 Posted June 7, 2021 Posted June 7, 2021 I modified both the CaptiveManager and ConvertedSettlersScript, One Function to equip the restraints as per the case and another function to unequip and remove the restraints when they are freed. Will comment out the Wasterlander Outfit line and see if they retain what I give them after I free them and then send to a Settlement. Keeping my fingers crossed for now. Just Trial and Error for me as I keep learning Papyrus lol
EgoBallistic Posted June 7, 2021 Author Posted June 7, 2021 3 hours ago, Tron91 said: Just checked the ConvertedSettlersScript in which you give them the WasteLander Outfit. I would say comment out the line. The PC knows while sending them to a Settlement that they are naked or dressed. So he/she should expect them to be either naked or dressed given the scenario in which they are sent to the settlement. I was finding it problematic as I always send them with a proper outfit, but when I find them on the way or in the settlement they are either in ropes or the wastelander outfit. The issue isn't the Wastelander outfit. The issue is putting another captive in the CollarAndShackles outfit, which causes every instance of that actor to get reset to that outfit, like I explained in the lengthy post above. The solution, as I also explained above, is either a) don't use outfits at all or b) make the captives an ActorBase templated on a leveled list.
hkheungL Posted June 7, 2021 Posted June 7, 2021 hello Ego I understood that you were solving the problem of your mod's clothes but I have a question is it normal that the captive, once sent to a colony, even if he is assigned to a job, does not have a weapon in his inventory?
EgoBallistic Posted June 7, 2021 Author Posted June 7, 2021 Just now, hkheungL said: I understood that you were solving the problem of your mod's clothes but I have a question is it normal that the captive, once sent to a colony, even if he is assigned to a job, does not have a weapon in his inventory? Yes. They will only have a weapon if you gave them one.
vaultbait Posted June 7, 2021 Posted June 7, 2021 (edited) 54 minutes ago, EgoBallistic said: 56 minutes ago, hkheungL said: I understood that you were solving the problem of your mod's clothes but I have a question is it normal that the captive, once sent to a colony, even if he is assigned to a job, does not have a weapon in his inventory? Yes. They will only have a weapon if you gave them one. Or if they grab one they find on the ground, looting an enemy corpse, in the workshop inventory, et cetera... which tends to happen the first time any hostiles wander into range of the settlement (as long as you're around to witness it, I think, so not including radiant "settlement is under attack" events if you don't visit the settlement when the attack happens). I never bother to give my settlers, even the relocated captives, weapons directly. They'll eventually pick some up to defend themselves anyway. For that matter, most of the time they've already found one or more weapons during combat while following me around, before I send them to work for me. Edited June 7, 2021 by vaultbait
SilentWanderer Posted June 7, 2021 Posted June 7, 2021 Ego, thanks again for Your work. I have a small question, is it possible to add option to send captive to custom location? Like "use this location", or something like that AFT has that option, but only for companions, "use current location". Thanks.
Tron91 Posted June 7, 2021 Posted June 7, 2021 2 minutes ago, SilentWanderer said: Ego, thanks again for Your work. I have a small question, is it possible to add option to send captive to custom location? Like "use this location", or something like that AFT has that option, but only for companions, "use current location". Thanks. Think Ego uses the same function which you use in WorkShop mode to move settlers to other settlements.
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