Jump to content

How to get Terminal/Safe object reference


Recommended Posts

Im trying to create a mod where instead of the vanilla game's hacking and lockpicking minigame, the player can use caps, or some other currency to instantly unlock the terminal or safe.

 

I plan to use ObjectReference's GetLockLevel and Unlock functions to unlock the terminal/safe/chest. But the problem is getting the object reference in the first place. What is the best way to get the object reference of the terminal/safe? Is there some function I can call to get the objectreference of the object the player is looking at (mouseover)?

Link to comment
Share on other sites

You can add an activation option through a perk, on this activation option you can attach a script where you remove caps from the player and unlock the object. There's a vanilla perk that adds an activation button for Ashes (the cat at vault 81), you can check this perk as example.

Remember that you need to add the perk to the player, so you need to create a misc item or a potion that applies the perk, some bobbleheads apply a perk through a script, so you can check them as example. A quest script would also work for this end.

Link to comment
Share on other sites

Why don't you apply and internal script to these terminals.

And use ... self.unlock() in them

 

 

Then I would have to add the script to every terminal, every chest, lockbox, etc.

I'm looking for a solution that works for all things that are locked and require hacking or lockpicking.

Link to comment
Share on other sites

You can add an activation option through a perk, on this activation option you can attach a script where you remove caps from the player and unlock the object. There's a vanilla perk that adds an activation button for Ashes (the cat at vault 81), you can check this perk as example.

Remember that you need to add the perk to the player, so you need to create a misc item or a potion that applies the perk, some bobbleheads apply a perk through a script, so you can check them as example. A quest script would also work for this end.

 

Thanks! sounds promising.

 

I'm not in front of my computer right now, so I can't check. Is activation option the "E) Workshop R) Transfer" or "E) Take" menu you get when you mouseover an object? If so, if I were to add an activation option that triggers for terminals and chests, would it conflict with another mod that also adds activation options to the same objects? Or would the options just be appended?

Link to comment
Share on other sites

In my mods the max activation options I've got to work for the same object is 4, with 2 or 3 they show up horizontally, but when you have 4 it shows like dialogue options, but note that if you have 4 options and the extended dialogue interface is installed it will show the activation options as dialogue options in the extended dialogue interface.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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