Jump to content
ℹ️ Intermittent Download History issues ×

Very basic question. How to assign a Key at runtime?


hereami

Recommended Posts

That's it. Wiki is somewhat shady "As with SetLockLevel in Skyrim, in Fallout, you can't specify the key if you choose 255 as the lock level.", which means that's doable somehow for any other level? Also, neither Lock() nor SetLockLevel() have such parameter.

Link to comment
Share on other sites

No, that's not what it means. Level 255 is the only one that requires a key and while you CAN set a lock level to 255 so that it requires a key, you cannot designate said key via script. This means you'll have made a door that cannot be unlocked without the console. You can only make keys in the CK or xedit

Link to comment
Share on other sites

AddKeyIfNeeded adds key to npc if door has assigned it already.

 

Well, pity. Not that it matters much but could be handy. Had something F3 in mind, where terminals could be locked out forever, but i wanted to provide a sort of master lockpick which needs finding. So much valuable ideas are stripped from game with each sequel.

Link to comment
Share on other sites

I think you can fake assign a key to a door: custom activate text, SetOpen(False), BlockActivation(), custom debug.notification ("Only X key can unlock this door."), OnActivate: if akActionRef has X Key, play sound, "unlock", open.

Edited by LarannKiar
Link to comment
Share on other sites

To fake assign I had to use an invisible ACTIVATOR in front of the actual door/terminal/container using the object name and unlock text to capture grab/activation focus that triggers an attached Player.GetItemCount logic based message/unlock script then disable self.

Link to comment
Share on other sites

I suppose broken locks mechanics is fully stripped. For Terminals there is lockout period still, but what is variable for default value then? Nothing relevant in Game Settings, only ModTerminalLockout Set 0 in perks.

Edited by hereami
Link to comment
Share on other sites

I suppose broken locks mechanics is fully stripped. For Terminals there is lockout period still, but what is variable for default value then? Nothing relevant in Game Settings, only ModTerminalLockout Set 0 in perks.

 

I think Fallout4.ini >> [Gameplay] >> iTerminalLockoutTime=10.

Link to comment
Share on other sites

 

Function AddKeyIfNeeded(ObjectReference ObjectWithNeededKey)
ObjectWithNeededKey: The reference that is locked with a key. It will create a key to this object and add it to the calling object if the calling object doesn't already have one.

 

?

 

I never tried this, but looks like the right approach.

Is there some reason not to use it, I mean, doesn't do what it's supposed to do?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...