Jump to content

[LE] How to change the number of lockpicks when Player gets in jail?


Recommended Posts

Idea is

 

to give more lockpicks to the player when he\she gets in jail.

 

I tried to find a global var, a game setting, but worthless.

I think the best way is to use papyrus, 'cause I didn't find any vars in CK.

I don't know how to get the value of lockpicks when in jail except making a trigger and run a script on it.

I can get the current value of player's lockpicks using

 

 

if Game.GetPlayer().GetItemCount(lockpicks) ==1

geme.getplayer().additem(lockpick, a number)

but it requires a trigger in jail, and it is not a solution 'cause I don't want to change every location.

 

 

I suppose there must be another way to solve this so please, help me out.

Edited by alexalexalex11314
Link to comment
Share on other sites

You don't need an actual trigger in each jail, the story manager has a jail node that triggers when you get into jail.

 

Basically the process is:

- make a quest

- set it's start event to the one you want (jail in this case)

- setup a story manager node (do remember to tick "shares event" to not mess up the trigger for other mods or vanilla quests.)

- Add a stage to your quest with a fragment script like this:

game.getplayer().additem(lockpick, 1) ;add lockpick
Stop() ;so the quest can start again the next time we go to jail

More info on how to setup the story manager here:

https://www.creationkit.com/index.php?title=Bethesda_Tutorial_Story_Manager

Edited by FrankFamily
Link to comment
Share on other sites

https://www.nexusmods.com/skyrimspecialedition/mods/18483/

 

Its made for Special Edition, but I imagine it could be used with Oldrim using all but the weapon/armor pieces that require my mesh files.

There's actually 3 spells that affect locks, 2 that use magic to directly unlock or lock them, or 1 that summons a lockpick to use.

 

Mind you my spells are attached to my whole current mod, so there's roughly 49 spells in total atm, but the whole thing is still a WIP.

Link to comment
Share on other sites

  • 2 months later...

You don't need an actual trigger in each jail, the story manager has a jail node that triggers when you get into jail.

 

Basically the process is:

- make a quest

- set it's start event to the one you want (jail in this case)

- setup a story manager node (do remember to tick "shares event" to not mess up the trigger for other mods or vanilla quests.)

- Add a stage to your quest with a fragment script like this:

game.getplayer().additem(lockpick, 1) ;add lockpick
Stop() ;so the quest can start again the next time we go to jail

More info on how to setup the story manager here:

https://www.creationkit.com/index.php?title=Bethesda_Tutorial_Story_Manager

 

Papyrus compiler says variable lockpick is undefined. I don't know where I am suppose to define it. Should I create an aliase or what?

If the var defines in that papyrus fragment box it gives an error so I suppose it works in another way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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