IsharaMeradin Posted June 7, 2020 Share Posted June 7, 2020 Might have to use ForceRefTo() to ensure the alias is properly filled. Just be aware of the 'notes' listed on the page. Link to comment Share on other sites More sharing options...
Martimius Posted June 7, 2020 Author Share Posted June 7, 2020 (edited) So therefore I should just run this once, like EVENT onInit() when the SEQ quest is run? I was thinking though that we wouldn't have to force the alias to be filled necessarily, since it is filled on a new save (where the mod wasn't installed previously). I was thinking that the quest could be stopped, cleared, restarted in some way? That might mean having the quest restarted on the game startup each time. Â Edit: Fixed! Since the game had trouble filling aliases on a SEQ already run before, I just made a new quest and the alias filled properly Edited June 7, 2020 by Martimius Link to comment Share on other sites More sharing options...
Martimius Posted June 8, 2020 Author Share Posted June 8, 2020 (edited) As for the lockpicking issue, I've had some progress with troubleshooting, I guess. In the CK, I re-added/auto-filled all the script properties for both the init and magic spell script. So at least now 100% of the time in-game the lockpick detect spell shows up, along with the magic effect. Problem is, the lockpick dialogue scene fires at completely random times, even when I haven't lockpicked anything yet. The scene fires off once, and then never again. Â Â Scriptname SDA_LockpickMGEF extends activemagiceffect Actor Property PlayerRef Auto GlobalVariable Property LockPickDetectGV AutoScene Property SeranaDialogueAddonLockpickScene Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ;effect starts after player picks lock If akTarget.GetDistance(PlayerRef) < 2000 Utility.Wait(1) Debug.Notification("Lock Picked")SeranaDialogueAddonLockpickScene.Start() Endif Utility.Wait(1) LockPickDetectGV.SetValue(Game.QueryStat("Locks Picked")) ;this nullifies the effect, so it can start again after picking a lock.EndEvent @IshadaMeradin, I also may consider going with the SKSE route instead as it does seen at least somewhat simpler. With the RegisterForMenu command, the wiki says I have to register for a calling form. What's the best way to implement that? Edited June 8, 2020 by Martimius Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 8, 2020 Share Posted June 8, 2020 Whatever script you want to run the OnMenuOpen or OnMenuClose events will need to have the RegisterForMenu call. Typically, the RegisterForMenu call is put in the OnInit event for the script in question. But can be utilized in other locations on the same script depending upon need. Link to comment Share on other sites More sharing options...
Martimius Posted June 8, 2020 Author Share Posted June 8, 2020 (edited) So basically something like this? Â Â Event OnInit()RegisterForMenu("Lockpicking Menu")EndEvent Event OnMenuClose(String Lockpicking Menu)If MenuName == "Lockpicking Menu"SDA_LockpickingScene.Start()EndIfEndEvent Edited June 8, 2020 by Martimius Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 8, 2020 Share Posted June 8, 2020 In the most simplest form, yes. Except that you will need to change the parameter variable in the OnMenuClose event back to MenuName instead of Lockpicking Menu. Successful lockpicks for containers automatically open the container, so the scene wouldn't start until after exiting the container menu or it would get paused while in the container menu. Successful lockpicks on doors automatically open them too and transition the player. It may be beneficial to set a bool variable that indicates the lockpick menu has been opened, if that variable is still at that value after the container menu closes or the player finishes transitioning then do your thing. Otherwise register for a single update for a few seconds after the lockpick menu closes to reset the bool variable. The update wouldn't run till after the transition or the container menu closes thus allowing your thing to happen, else the bool variable resets for the next time. Furthermore if you are wanting to distinguish between container, trap and door lockpicks you may need to use GetCurrentCrosshairRef and check that it is a container or door. Also, it may be impossible to distinguish between a successful lockpick of a trap and a close of the lockpick menu due to running out of lockpicks or just exiting early. Link to comment Share on other sites More sharing options...
dylbill Posted June 9, 2020 Share Posted June 9, 2020 If you're going the SKSE route, I would do it something like this: Â Event OnInit() RegisterForMenu("Lockpicking Menu") EndEvent Event OnMenuClose(String menuName) ObjectReference LockRef = Game.GetCurrentCrosshairRef() If LockRef.IsLocked() == false Utility.Wait(1) Debug.Notification("Lock Picked") SDA_LockpickingScene.Start() EndIf EndEvent Sorry you couldn't get the other way working. Link to comment Share on other sites More sharing options...
Martimius Posted June 9, 2020 Author Share Posted June 9, 2020  If you're going the SKSE route, I would do it something like this:  Event OnInit() RegisterForMenu("Lockpicking Menu") EndEvent Event OnMenuClose(String menuName) ObjectReference LockRef = Game.GetCurrentCrosshairRef() If LockRef.IsLocked() == false Utility.Wait(1) Debug.Notification("Lock Picked") SDA_LockpickingScene.Start() EndIf EndEvent Sorry you couldn't get the other way working. This is just run on a standalone quest, right? No other aliases, magic effects? Link to comment Share on other sites More sharing options...
dylbill Posted June 9, 2020 Share Posted June 9, 2020 You can put that script on pretty much anything really. You can use it on a quest you already made. Keep in mind though that if the quest is already running in your save you have to stop and start it again, either with another script or a console command to get the OnInit event to fire. Link to comment Share on other sites More sharing options...
Martimius Posted June 9, 2020 Author Share Posted June 9, 2020 Ok, I might just use it with the quest I already made; I never saved with that quest active anyway. Link to comment Share on other sites More sharing options...
Recommended Posts