Jump to content

How to call on any terminal or lock being unlocked.


xJustAdam

Recommended Posts

I'm trying to make my custom companion speak when the player successfully picks any lock or hacks any terminal and I'm currently at a bit of a loss. I have no idea how to call on that in a script.

 

 

If MyCompanion.HasBeenHired != 1
Return
Elseif MyCompanionTalkedAboutHacking == 0 && ()
MyCompanion.SayTo MyCompanion MyCompanionHackingComment 1
Set MyCompanionTalkedAboutHacking to 1
Return
EndIf

 

I had a few ideas, like calling on when the player receives the specific XP amount for hacking (for example iXPRewardHackComputerEasy) or picking locks (for example iXPRewardPickLockAverage), but again, have no idea how to actually implement that.

 

Any ideas would be appreciated.

Edited by TheL0neW0nder
Link to comment
Share on other sites

Made a quick script for you. Set it to run every second and test it in game. There probably is a better way but this is what I came up with.

 

It looks for locked terminals that are currently around the player and places them in an array, once the script activates again it will check the array to see if any terminals have been hacked or have been failed to hack.

ScriptName aaTerminalScript

Array_Var Array001
Short TemporaryShort1
Short TemporaryShort2
Ref TemporaryRef

BEGIN GameMode

Set TemporaryShort1 To Ar_Size Array001
While -1 < (TemporaryShort1 -= 1)
    Let TemporaryRef := Array001[TemporaryShort1]
    If TemporaryRef.GetLocked == 0
        ;Output when terminal minigame has been won
    ElseIf TemporaryRef.GetLocked == 2
        ;Output when terminal minigame has been failed
    EndIf
Loop

Let Array001 := GetRefs 23, 1
Set TemporaryShort1 To Ar_Size Array001
While -1 < (TemporaryShort1 -= 1)
    Let TemporaryRef := Array001[TemporaryShort1]
    If TemporaryRef.GetLocked != 1
        Let TemporaryShort2 := Ar_Find TemporaryRef, Array001
        Ar_Erase Array001, TemporaryShort2
    EndIf
Loop

END
Edited by IntenseMute
Link to comment
Share on other sites

  • Recently Browsing   0 members

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