BrownNOrange Posted November 25, 2012 Share Posted November 25, 2012 WHAT I PLAN TO DO I am trying to make a system wherein one can forge 'keys'. I want the forgeable keys to show up under miscelaneous, when using blacksmith forge. I would also like to be able to activate the keys in the forgeable list when a specific spell or power is used on a door which requires a key.This will not be for all doors, but will include many commoner NPC doors, and a few specials. HOW I HAVE IT SET UP SO FAR(and tried to do)I have created a 'keyword' to establish which keys are forgeable. I've added the keyword "MODForgeableKey" to all those keys which can be forged. I've added a spelleffect and spell with the given conditions I want, such as "Sneak 50", "Lockpicking is 50", "Illusion is 50", etc. I tried, but was unable to find a condition for the target which said 'IsLocked', which is strange because I found one that said "IsUnlocked" PUTTING IT TOGETHERSo, basically I require a way to track the applicable locks (doors) which the spell has been used on, further conditions for when the door is added to the list, and a way to add the appropriate doors to the list of forgeable keys. IN A NUTSHELL USE SPELL ON LOCKED DOOR, checks for door requiring key with keyword 'MODForgeableKey"checks for key in existing list; if found, nothing; if not = add it to the list If you have any questions about the system, let me know and I'll try to answer them. I've done some scripting with other languages, mostly Ruby, but Papyrus is foreign to me yet.Any help would be greatly appreciated.Haven't posted here (Ever I think), so if this is in the wrong place, you have my apologies. Link to comment Share on other sites More sharing options...
BrownNOrange Posted December 1, 2012 Author Share Posted December 1, 2012 I think I finally found the conditions for this. I have them set up like this in the "Magic Effects": GetObjectType DoorGetIsLocked == 1GetLockLevel == 6 The last condition I assume is used to suggest that the door can only be opened with a key.The one condition I'm still missing is how to check if the door requires a specific key. I'm thinking this part may require a script, so I will now set off to study scripts. This might take a while, so anyone with any advice or who can whip something up for me, let me know. Secondly, I've taken a look at the craftsmithing script and saw where it is basically just set up to smith weapons/armor. Now, I know in Hearthfire, you are able to craft nails and such, and I've seen a few other mods that can craft various things. So, I'm wondering how to add a script to smith items into the craftsmithing script. I'll be back if and when I can make progress on this. Link to comment Share on other sites More sharing options...
koyabr Posted December 1, 2012 Share Posted December 1, 2012 (edited) What is the difference among keys based on? FormID or lock-type of their corresponding doors? I mean, if door A and B have different IDs but same "Novice" locks, how many keys are needed for them, 1 or 2? Edited December 1, 2012 by koyabr Link to comment Share on other sites More sharing options...
BrownNOrange Posted December 1, 2012 Author Share Posted December 1, 2012 I assume that there is only one needed key for each lock. I chose '5' in the lock level condition to say that only doors which require a key will give the ability to forge the key when the spell is used on the given door. And then, only the keys who have the keyword "ForgeableKey" in the given keywords list. I did it this way to prevent the player from opening impossible doors, (such as buyable estates and such). Even though those doors require keys, they won't have the keyword, and thus you won't be able to forge them. What you said there opened up an entirely different problem, didn't it? Some doors can be opened with the proper key OR lockpicked. So, if I only use the "5", then doors that can be picked and have an associated key won't be able to be forged. I can fix this by making an "OR" condition I think. Sorry if I misunderstood you, Koyabr. Link to comment Share on other sites More sharing options...
steve40 Posted December 1, 2012 Share Posted December 1, 2012 I tried, but was unable to find a condition for the target which said 'IsLocked', which is strange because I found one that said "IsUnlocked" Well, IsLocked == FALSE is the same as IsUnlocked == TRUE, while IsLocked == TRUE is the same as IsUnlocked == FALSE :) Link to comment Share on other sites More sharing options...
steve40 Posted December 1, 2012 Share Posted December 1, 2012 (edited) GetLockLevel == 6 The last condition I assume is used to suggest that the door can only be opened with a key. GetLockLevel returns an integer representing the lock level of a locked door, container, or hinge trap. Possible values are: 0 = Novice25 = Apprentice50 = Adept75 = Expert100 = Master255 = Requires Key The one condition I'm still missing is how to check if the door requires a specific key.Condition: GetLockLevel == 255Papyrus: MyDoorOrChest.GetLockLevel() == 255 Edited December 1, 2012 by steve40 Link to comment Share on other sites More sharing options...
BrownNOrange Posted December 2, 2012 Author Share Posted December 2, 2012 Thanks steve40! I don't know why I assumed the integers were 0-5, guess I didn't think about the LockLevels in terms of Lockpicking skill. Thought it would be an entirely different variable altogether. Anyway, this definitely helped me. This is why the door I tested it on kept saying "Novice" and not "Required Key". As far as the Scripting part: MyDoorOrChest.GetLockLevel() == 255 This will indeed make a check to determine if the door requires a key. But you know how you can set which key opens which door in the "Lock" tab of the individual door's properties? You can tick the checkmark beside lock, set the first dropbox to "Requires Key" and then the last Dropbox selects the appropriate key. What I need is to be able to use the Papyrus script as you've placed above, and then follow it up with a comparison to determine whether or not the exact key for the door has the keyword "Forgeable Key". Then, a script of some sort, if this comparison is true, to add the key to the list of miscellaneous items at the blacksmith forge. Hope that makes some sort of sense. Anyway, I appreciate the assistance here. Link to comment Share on other sites More sharing options...
kryptopyr Posted December 3, 2012 Share Posted December 3, 2012 You might look at how the Wax Key perk functions. Somehow that perk checks the key for a given door or chest and then gives the player a copy of the correct key. It may not work for your purpose, but maybe it can be adapted. Link to comment Share on other sites More sharing options...
Recommended Posts