davethepak Posted October 13, 2020 Share Posted October 13, 2020 Hello everyone. Experienced skyrim modder here, coming dabbling into fallout 4.(yes, I have read the changes from the last version of the CK on the wiki). I want to have completing the quest Open Season add a perk to the player, but for maximum compatibility reasons, I don't want to edit that quest. I tried making a quest of my own, and put a condition on a stage to detect the other quest as complete, but I found I could not get that to work well (user error I am guessing). So any suggestions on how to add a perk once a quest is done? (again, without modifying the specific quest itself)? I had thought about adding a spell effect to the player, with a condition based on the quest (as spell effect checking seems more streamlined than perk requirements) that adds the perk, but was not sure. Ideas? thank you in advance,, Pak Link to comment Share on other sites More sharing options...
dylbill Posted October 13, 2020 Share Posted October 13, 2020 You could remove the conditions from your quest, and make it start game enabled so the perk is added as soon as the mod is installed. Then put the condition in your perk GetStageDone, so the perk is only active if the last stage of Open Season is done. Link to comment Share on other sites More sharing options...
SKKmods Posted October 13, 2020 Share Posted October 13, 2020 With the right case logic you should be able to catch any quest state you start up in. Something like this; Actor Property pPlayerREF Auto Const Mandatory Quest Property pDLC04RaiderKickout Auto Const Mandatory Perk Property pMyPerk Auto Const Mandatory Event OnQuestInit() ;this is my start game enabled quest If(pDLC04RaiderKickout.IsCompleted() == TRUE) Done() Else Self.RegisterForRemoteEvent(pDLC04RaiderKickout, "OnStageSet") EndIf EndEvent Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID) If (akSender == pDLC04RaiderKickout) && (auiStageID == 255) Done() EndIf EndEvent Function Done() pPlayerREF.AddPerk(pMyPerk) (Self as Quest).Stop() EndFunction Link to comment Share on other sites More sharing options...
davethepak Posted October 13, 2020 Author Share Posted October 13, 2020 You could remove the conditions from your quest, and make it start game enabled so the perk is added as soon as the mod is installed. Then put the condition in your perk GetStageDone, so the perk is only active if the last stage of Open Season is done. Thanks for that. I had thought of it, but then the player would get the perk as soon as they load the mod, event affects of the perk were not active. I had also thought of;* Adding non visible perk with condition* Have a script fragment that adds the final perk (which would be visible).* Have the script remove the first perk. Thanks for your input - I may give it a test. Link to comment Share on other sites More sharing options...
davethepak Posted October 13, 2020 Author Share Posted October 13, 2020 With the right case logic you should be able to catch any quest state you start up in. Something like this; Actor Property pPlayerREF Auto Const Mandatory Quest Property pDLC04RaiderKickout Auto Const Mandatory Perk Property pMyPerk Auto Const Mandatory Event OnQuestInit() ;this is my start game enabled quest If(pDLC04RaiderKickout.IsCompleted() == TRUE) Done() Else Self.RegisterForRemoteEvent(pDLC04RaiderKickout, "OnStageSet") EndIf EndEvent Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID) If (akSender == pDLC04RaiderKickout) && (auiStageID == 255) Done() EndIf EndEvent Function Done() pPlayerREF.AddPerk(pMyPerk) (Self as Quest).Stop() EndFunction Wow, thanks. I am familiar with events, but only in skyrim - so the remote event registration is certainly new for me in Fallout 4. Interesting - so the event watching ends when the (Self as Quest).Stop() is executed? Fascinating, have never used that. Will this leave it hanging in the Save if the quest if not complete, and the user removes the mod? Thank you very much for this code! Link to comment Share on other sites More sharing options...
SKKmods Posted October 13, 2020 Share Posted October 13, 2020 To be super clean add a Self.UnregisterForAllEvents() before stop as the scavening on quest attached scripts is not great. Once the quest is stopped it should be OK to remove without leaving hanging chad instances, but, there ain't no guarantees. Infact quest attached scripts will still happily run even after their parent quest has stopped (or Object Reference parent is unloaded/disabled/deleted). But thats a whole other heap of filth. Link to comment Share on other sites More sharing options...
Recommended Posts