Jump to content

Photo

Getting the game to recognize the Story Manager LockPick Event

skyrim mods creation kit ck lockpick storymanager dialogue scenes

  • Please log in to reply
43 replies to this topic

#1
Martimius

Martimius

    Virgin of Justice

  • Supporter
  • PipPipPipPip
  • 1,424 posts
Is there a proper way for the game to recognize when the player has just finished lock-picking a container, so that a follower would comment on it? I tried making a scene for a quest under the Story Manager Event "Lock Pick", and also added the respective quest node to Lock Pick SM Event Node. None of these resulted in the follower commenting whenever I would lockpick a container.
 
Help would be appreciated. 
 
 
 
 
 


#2
agerweb

agerweb

    Faithful poster

  • Premium Member
  • 1,980 posts

I use SM a lot, but not lock pick. But I did have a look at all the events a while ago to see what might be useful. The lock pick one seems to have most people beaten, largely because there is no vanilla game example. I expect you have googled all the baffled references!

I presumed from the way other events work you create two alias' in your quest one for actor  (From event -> actor) and one for a lock (From event Lock Pick -> Lock object), the problem then is how you get the SM to communicate info to the quest. Incidently I presume you need these to fill the OnStoryPickLock quest script which is run by a quest called from the Lock Pick event. 

On the SM node conditions the actor is easy its just GetISID on player set to run on event data (actor). Where I ran out of ideas was which condition to use for the Lock to run on event data (lock object). I gave up and never got onto the quest itself.

I hope this adds at least something to the general baffling nature of this SM event; but all my presumptions could be wrong!



#3
IsharaMeradin

IsharaMeradin

    The Pale Redguard

  • Members
  • PipPipPipPipPip
  • 8,761 posts

One possible solution:

Use SKSE, register for the "Lockpicking Menu". You can use a start game enabled quest or one that you start by some other means, so long as it is active for the duration that you want this to work.  When the menu is closed, register for a very small update and use GetCurrentCrosshairRef coupled with IsLocked to confirm whether the object is still locked or not.  If not, trigger your dialog. If you are afraid that the user might move the crosshair off of the container, you can try using GetCurrentCrosshairRef from inside the OnMenuClose event.  I am not certain what the result might be but it is worth testing, however.



#4
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,339 posts

IsharaMeradin's suggestion is a good one. If you don't want to use SKSE though, you could instead use RegisterForTrackedStatsEvent(). I assume your follower is one that you made, so you can put the script directly on the actor: 

 

Spoiler
 
If it's a vanilla follower, you could instead use a reference alias pointing at your follower: 
 
Spoiler
 
Name the script something more unique to your mod. Using SKSE as IsharaMeradin suggested would be better for performance though because OnTrackedStatsEvent fires for all stats, and there's a lot of them: https://www.creation...tOfTrackedStats

Edited by dylbill, 28 April 2020 - 06:28 PM.


#5
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,339 posts

Hey, I had another thought. To detect lock picking without using SKSE, you can make a new spell ability and a new Global Variable and compare GetPCMiscStat "Locks Picked" to the global variable. 

So, put the condition GetPCMiscStat Locks Picked != LockPickDetectGV  (Check the UseGlobal box and choose the Global Variable you made. I named it LockPickDetectGV ) 

Also put the condition GetDistance Player < 2000

On the spell ability

 

Put the spell ability on your follower

 

Then on the spell ability's magic effect, put this script: 

Spoiler
 
Edit: Actually its better to put the GetDistance condition in the script, rather than on the spell ability. 
 

Spoiler

Edited by dylbill, 28 April 2020 - 08:56 PM.


#6
Martimius

Martimius

    Virgin of Justice

  • Supporter
  • PipPipPipPip
  • 1,424 posts

Thank you all for the input and advice. Also yes @agerweb, there's not enough to go on for Lockpicking SM Nodes; I'm not even sure if anyone's even gotten it to work yet. Under my lockpick quest I did have two aliases, one for the player and one for the container target. 

 

I might just try both the RegisterforTrackedStatsEvent or Get Distance method for now, since I don't really have much experience scripting off of SKSE functions. 

 

Also if I didn't make it clear enough already, this is meant to be a radiant event, to occur at any time the player lockpicks, regardless of whichever container it is.


Edited by Martimius, 29 April 2020 - 07:46 AM.


#7
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,339 posts

I would use the Spell Ability option that I posted, rather than RegisterForTrackedStats, because it's better for performance. I tested it and the effect does start every time you pick a lock. If you need more detailed instructions let me know.



#8
Martimius

Martimius

    Virgin of Justice

  • Supporter
  • PipPipPipPip
  • 1,424 posts

I would use the Spell Ability option that I posted, rather than RegisterForTrackedStats, because it's better for performance. I tested it and the effect does start every time you pick a lock. If you need more detailed instructions let me know.

Hey there! Sorry if I took kind of long to reply. Was just implementing other things with my mod. May I clarify how I would apply that spell ability on the follower? She's a vanilla actor, Serana. 

 

Do I make a separate script with the ActorREF.Addspell() command, to be run once at game startup? 



#9
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,339 posts

Yes that's how I would do it. You can make a new start up quest, make sure Start Game Enabled is checked. Then use a script like this: 

 

Actor Property Serana Auto 
Spell Property LockPickDetectAbility Auto 

Event OnInit()
    Utility.Wait(1) 
    Serana.AddSpell(LockPickDetectAbility) 
    Utility.Wait(1) 
    Self.Stop() ;stops this quest
EndEvent 

Have your script extend quest.



#10
Martimius

Martimius

    Virgin of Justice

  • Supporter
  • PipPipPipPip
  • 1,424 posts

Ah alrighty. And just to be sure, it has to be an entirely new one right? I can't use the same one I'm using to track the lockpicking?


Edited by Martimius, 29 May 2020 - 05:52 AM.






Also tagged with one or more of these keywords: skyrim, mods, creation kit, ck, lockpick, storymanager, dialogue, scenes

Page loaded in: 1.120 seconds