Jump to content

Script to use holotapes to access a terminal


Recommended Posts

I have to say that I am a total noob with scripting. I have no clue what I'm doing here.

 

Basically, I thought it would be cool to lock a bunker door that can only be unlocked via a terminal, but the terminal is locked too and will stay locked until the player has found the five holotapes I've hidden in the Wasteland. It sounded really neat, but then I tried finding the right scripting and I've hit like thirty brick walls.

 

I tried looking at similar locked doors in the base game that uses this system (like the voiceprint thing in Automatron), but I see the following message at the scripting:

 

;Failed to load code for fragment Fragment_Terminal_01

 

Now I'm not too worried with finding out what was on these terminals, because I'm too awful at scripting to understand it anyway. I was hoping someone could help me with this. Does anyone know how to make the terminal unlock when the player has found all five holotapes?

 

Thanks very much in advance!

Link to comment
Share on other sites

One of many possible approaches, which could be holotape or player focus is get the holotapes to count their container chnages to the player;

 

Create a GlobalVariable myHolotapeCounter

Attach a script to your 5 holotape forms and set the properties;

GlobalVariable  Property myHolotapeCounter Auto Const Mandatory
ObjectReference Property myTerminal        Auto Const Mandatory

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 If (akNewContainer == Game.GetPlayer())
   myHolotapeCounter.SetValue(myHolotapeCounter.GetValue() +=1)
   If (myHolotapeCounter.GetValue() >= 5)
    myTerminal.Unlock()
   EndIf
   GotoState("Done")  ;or Self.Disable() if the holotape is just a token and never used.  	 		
 Endif
EndEvent

State Done
 ;empty does not process OnContainerChanged
EndState
Edited by SKK50
Link to comment
Share on other sites

Thanks for the quick reply! I'm pretty sure that is exactly what I need.

 

Sorry if this is a dumb question, but I am absolutely s#*! with scripting, but how do I attach the bottom part of that script to my holotapes exactly? I've been able to define the two properties, but I'm not sure how to add the part of the script that manages the counter when the item is picked up.

Link to comment
Share on other sites

On your Holotape form press Scripts [Add] button, add new script with a name unique to your mod, paste all the stuff in, save/compile (or something I use a different editor), set properties.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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