Jump to content

Recommended Posts

Posted

So I've recently decided to jump head-first into papyrus..

 

 

Does anybody know the name/id of the default script that runs when a player activates a locked object?

 

I'm trying to piece together in my head an idea for a lock picking skill-based script, and thinking it would be a lot less work to extend of the normal script that runs.

 

Also, how would I go about preventing the normal lock-picking animation from playing?

 

What I'm trying to achieve is essentially:

Can this lock be picked?:

NO: Player does not have the required locksmith perk
Yes: Player has required perk

If yes:

Activate [skillbasedlockpicking script]


Many thanks,

 

Adzscott

Posted (edited)
There isn't one. It's a hardcoded thing. When the player activates a locked door the game immediately calls up the lockpicking screen. Edited by Reneer
Posted

There isn't one. It's a hardcoded thing. When the player activates a locked door the game immediately calls up the lockpicking screen.

I don't buy it. The game has to check if the player has the required perk to pick the lock, so there must be a script of sort that runs to verify this.

Posted (edited)

There is no Papyrus script that runs when the player activates a locked object. Each door / container reference has a Lock tab that corresponds to each of the Locksmith perk levels. If you don't have the requisite perk that corresponds to that door's lock level, the game won't let you pick that lock. So, again, no Papyrus / 'default' script is involved. It's all done through perks and perk entry points. And the perk entry points themselves are hardcoded.

Edited by Reneer
Posted

There is no Papyrus script that runs when the player activates a locked object. Each door / container reference has a Lock tab that corresponds to each of the Locksmith perk levels. If you don't have the requisite perk that corresponds to that door's lock level, the game won't let you pick that lock. So, again, no Papyrus / 'default' script is involved. It's all done through perks and perk entry points. And the perk entry points themselves are hardcoded.

Damn :/ I was hoping this would be simpler than it looked. Any advice on how to approach this?

 

Thanks for your help so far.

Posted (edited)

Actually, I do have an idea. There is a baseline perk for lockpicking in the CK. I'm pretty sure (though I have never tried this myself) you could modify that perk's entry point parameters to run a Papyrus script.

 

And if that doesn't work, there are other methods that would suffice, though they are much more complicated.

Edited by Reneer
Posted

Actually, I do have an idea. There is a baseline perk for lockpicking in the CK. I'm pretty sure (though I have never tried this myself) you could modify that perk's entry point parameters to run a Papyrus script.

 

And if that doesn't work, there are other methods that would suffice, though they are much more complicated.

You can

Posted (edited)

Alright so, progress!

 

I've set up a perk that comes into effect whenever a locked container or door is activated. The next step (I think?!) is to create a script that runs whenever this occurs. Unfortunately I can't get it compile :sad:

Scriptname LazyLocks extends ReferenceAlias
{Attached script **should** work out if the force-lock attempt is successful or not.}

ActorValue Property Perception Auto Const
ActorValue Property Luck Auto Const

int P = Game.GetPlayer().ActorValue Function GetPerceptionAV()
; Returns players perception skill as an integer value
    
int L = Game.GetPlayer().ActorValue Function GetLuckAV()
    ; Returns players luck skill as an integer value
    
Int Function GetLockLevel() native
;Returns lock level of target lock as an integer

Event OnActivate(ObjectReference akActionRef)

If locklevel == 25
Int RI = Utility.RandomInt(0, 25)
elseif locklevel == 50
Int RI = Utility.RandomInt(0, 50)
elseif locklevel == 75
Int RI = Utility.RandomInt(0, 75)
elseif locklevel == 100
Int RI = Utility.RandomInt(0, 100)
else Debug.Notification(This lock cannot be forced.)
end if
;Generates random number, with the available range based on lock-level.

End event
int PlayerSkill = L*P
;Defines playerSKill as the product of a players luck and perception.

Event OnActivate(ObjectReference akActionRef)
If PlayerSKill > RI
akTargetRef.Unlock()
Else
Debug.Notification(You fail to force the lock...)
end if
End event

The following errors were produced:

 

  1. C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\LAZYLOCKS.psc(7, :cool:: no viable alternative at input 'Game'
  2. C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\LAZYLOCKS.psc(7,12): required (...)+ loop did not match anything at input '.'
  3. C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\LAZYLOCKS.psc(7,4): Unknown user flag game

 

I'm guessing this is to do with not declaring something correctly, no?

Edited by adzscott
  • 2 months later...
  • Recently Browsing   0 members

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