Aasmodeusss Posted January 21, 2023 Share Posted January 21, 2023 Hey all, I've been playing modded Bethesda since Morrowind but have only recently started playing around with Xedit making my own patches and simple mod tweaks. I was hoping someone could give me some tips or point me towards a tutorial that would show me how to add equipment conditions to an action. There are so many tutorials out there and I don't know where to start. I want to make a mod that restricts you from picking locks or hacking in power armor to add a little danger to a survival mode play(having to get out of your PA or direct your companion to hack/lockpick for you), maybe eventually adding some hacking and lockpicking PA mods to the workbench once I figure things out a little better. Thanks Link to comment Share on other sites More sharing options...
hereami Posted January 22, 2023 Share Posted January 22, 2023 (edited) Might look here https://forums.nexusmods.com/index.php?/topic/11461408-prevent-some-armors-from-being-worn . Can add similar "replace default" activation perk to player while in Power Armor, by whatever means, set proper conditions for Target, like GetLocked, GetIsObjectType(Terminal/Container/Door). Method is least invasive and most simple, though has a chance of perk conflicts. Edited January 22, 2023 by hereami Link to comment Share on other sites More sharing options...
PJMail Posted January 22, 2023 Share Posted January 22, 2023 What Hereami said - and I would add - there are a number of ways to detect wearing Power Armor but the safest is "WornHasKeyword" with keyword "ispowerarmorframe" (Either in scripts or Conditions). Using the "hasperk" check is problematic. Link to comment Share on other sites More sharing options...
hereami Posted January 23, 2023 Share Posted January 23, 2023 Why not GetIsRace(PowerArmorRace)? Link to comment Share on other sites More sharing options...
Aasmodeusss Posted January 24, 2023 Author Share Posted January 24, 2023 Thank you, from your comments I think I might have been close when I gave up on trying to figure it out on my own. I think this idea might be slightly beyond my skill level at the moment. Like I understand the basics of what you're talking about but I don't quite get how to do it yet. I really need to check out some more tutorials but am the type of person who always seems to wind up learning s#*! the hard way as I go. These ideas should give me a place to start when I'm feeling like tackling it again but if you have any recommendations on a tutorial covering the general subject of what I would need to do I would greatly appreciate it. I live off grid and my online time is somewhat limited so going through the whole list isn't really practical for me right now. Thanks. Link to comment Share on other sites More sharing options...
hereami Posted January 25, 2023 Share Posted January 25, 2023 (edited) I don't know such a video show, but would like to mention Creation Kit , can't bypass it. And let's say this, for example Perk Entry Point - Creation Kit , and this Condition Functions - Creation Kit Possibly, a similar mod exists. Can take and research. If not, then a short guide:1) Add a new EntryPoint to PowerArmorPerk: Type is Activation, Func is AddActivateChoice, Flag is ReplaceDefault, Label - whatever. Conditions for Target: GetLocked()==1, <GetLockLevel() - optional> <i think, GetIsObjectType() series would be redundant for now>. Better be done in CreationKit, unless able to specify PerkConditions etc. blocks knowingly.SetFilterActivation entry looks curious, but meself not familiar with how it functions. That is basically all :smile: General route for perks applications, if neccessary: 1.1) Create a new Perk as above, NumRanks=1;1.2) PerkEntry needs Condition for Owner: GetIsRace(PowerArmorRace) or similar; 2) Need a MagicEffect to deliver the Perk, Script/Constant/Self, specify PerkToApply; 3) Need an Enchantment (ObjectEffect) or Ability/Spell to deliver our MagicEffect, Constant/Self.3.1) Or a Potion, then MagicEffect must be FireForget/Self, Duration - something longer than zero.3.1.1) Need a crafting recipe to deliver Potion.3.1.2) Drink me.Although in this case, a potion would fit better, if designed to suppress the antihack perk instead, then should have just a dummy Effect and the Perk should have Owner Condition HasMagicEffect(MySuppressEffect)==0. 4) Here depends.4.1) A suitable Armor to deliver Enchantment, may be traditional Wedding ring without armor slots and new ArmorAddon with PowerArmorRace and no slots.4.2) Whatever else to deliver Ability/Spell, may be a dummy Quest for Ability, StartGameEnabled, with a single Alias==Player. Everything up to 1.2 may be omitted and self-stopping StartGame/RunOnce quest can have a two-line script for Game.GetPlayer().AddPerk() / Stop(). End-user variant for a permanent perk application. 5) Can use Terminals (Holotapes) to manage perks directly by Add/RemovePerk(), but need to find an existing script (there is one) or create a new. Debug and expand the doing as the learning goes. To track usage of perk entry points to find examples, can use XEdit script "List perk entry points usage". Better should be run directly on Perks branch. Edited January 25, 2023 by hereami Link to comment Share on other sites More sharing options...
LarannKiar Posted January 25, 2023 Share Posted January 25, 2023 (edited) I think the only way to completely hide the activate button (e.g., 'Unlock => '') is to call BlockActivation(abHideActivateText = True) on the activatable object reference. A script that loops through the area near the player and sets/unsets this flag accordingly on the references would be needed. Finding valid objects can be done by a reference collection alias or a script populated array (latter would be much slower). Another approach is to replace (override) the original activate button as suggested above. It should be working but be mindful of mod conflicts: the interface can get confused pretty easly by mutiple overriding rules. Edited January 25, 2023 by LarannKiar Link to comment Share on other sites More sharing options...
Aasmodeusss Posted January 26, 2023 Author Share Posted January 26, 2023 I don't know such a video show, but would like to mention Creation Kit , can't bypass it. And let's say this, for example Perk Entry Point - Creation Kit , and this Condition Functions - Creation Kit Possibly, a similar mod exists. Can take and research. If not, then a short guide:1) Add a new EntryPoint to PowerArmorPerk: Type is Activation, Func is AddActivateChoice, Flag is ReplaceDefault, Label - whatever. Conditions for Target: GetLocked()==1, <GetLockLevel() - optional> <i think, GetIsObjectType() series would be redundant for now>. Better be done in CreationKit, unless able to specify PerkConditions etc. blocks knowingly.SetFilterActivation entry looks curious, but meself not familiar with how it functions. That is basically all :smile: General route for perks applications, if neccessary: 1.1) Create a new Perk as above, NumRanks=1;1.2) PerkEntry needs Condition for Owner: GetIsRace(PowerArmorRace) or similar; 2) Need a MagicEffect to deliver the Perk, Script/Constant/Self, specify PerkToApply; 3) Need an Enchantment (ObjectEffect) or Ability/Spell to deliver our MagicEffect, Constant/Self.3.1) Or a Potion, then MagicEffect must be FireForget/Self, Duration - something longer than zero.3.1.1) Need a crafting recipe to deliver Potion.3.1.2) Drink me.Although in this case, a potion would fit better, if designed to suppress the antihack perk instead, then should have just a dummy Effect and the Perk should have Owner Condition HasMagicEffect(MySuppressEffect)==0. 4) Here depends.4.1) A suitable Armor to deliver Enchantment, may be traditional Wedding ring without armor slots and new ArmorAddon with PowerArmorRace and no slots.4.2) Whatever else to deliver Ability/Spell, may be a dummy Quest for Ability, StartGameEnabled, with a single Alias==Player. Everything up to 1.2 may be omitted and self-stopping StartGame/RunOnce quest can have a two-line script for Game.GetPlayer().AddPerk() / Stop(). End-user variant for a permanent perk application. 5) Can use Terminals (Holotapes) to manage perks directly by Add/RemovePerk(), but need to find an existing script (there is one) or create a new. Debug and expand the doing as the learning goes. To track usage of perk entry points to find examples, can use XEdit script "List perk entry points usage". Better should be run directly on Perks branch.Thanks this was a big help pretty much exactly what I needed to give me somewhere to start. Using existing mods and tweaking them for my own use has been how I've been learning. I couldn't find anything that looked similar to what I was looking for which surprised me because it seems like a pretty simple idea that someone would have already come up with. Link to comment Share on other sites More sharing options...
Aasmodeusss Posted January 26, 2023 Author Share Posted January 26, 2023 I think the only way to completely hide the activate button (e.g., 'Unlock => '') is to call BlockActivation(abHideActivateText = True) on the activatable object reference. A script that loops through the area near the player and sets/unsets this flag accordingly on the references would be needed. Finding valid objects can be done by a reference collection alias or a script populated array (latter would be much slower). Another approach is to replace (override) the original activate button as suggested above. It should be working but be mindful of mod conflicts: the interface can get confused pretty easly by mutiple overriding rules.I'm not actually looking to hide the activate button completely. Just a message saying "you can't do this in power armor" like when you're trying to craft or use some terminals in power armor would be perfect. I honestly thought it would be a really easy thing to set up which is why I was surprised no one had already made a mod that does this. I'm quickly starting to learn that with modding just because something seems like it would be really simple to set up doesn't mean it is, lol. Link to comment Share on other sites More sharing options...
hereami Posted January 27, 2023 Share Posted January 27, 2023 (edited) Objects scan is an interesting alternative, a solid plan B for higher skills and if something is insufficient. Message can be shown in both methods, if something. This task starts to entertain me. Chance of a realistic conflict is overestimated, i think now. Looking at base game, none of perks deals with locked things and only one Runs Immediately, if Player has a specific companion (CIS_PlayerActivateEventSender_Perk), but it shouldn't conflict with button, i suppose? Most likely, mods that offer extensions to lockpicking, will add extra choices, while if try to provide instant unlock or something, then appear as diametrical by idea and shouldn't be used in same gameplay, probably, but in either case could be reconciled by an overlapping patch, if worth it. Might look through major DLCs and see, if have potentially problematic entries and if can be avoided by a reasonable number of conditions. PS. None there. Edited January 27, 2023 by hereami Link to comment Share on other sites More sharing options...
Recommended Posts