RedxYeti Posted November 13, 2022 Share Posted November 13, 2022 Is there anyway in papyrus to find the players current objective or even the quest they have selected? Link to comment Share on other sites More sharing options...
DieFeM Posted November 13, 2022 Share Posted November 13, 2022 IsObjectiveDisplayed - Quest - Creation KitNote that you can have many displayed objectives in the Pip-Boy, if the objective is shown on the interface dependes if the quest is tracked or not, so that you need to check what quest is tracked (Active) with the following function:IsActive - Quest - Creation KitTake into account that many quests can be tracked at the same time. Link to comment Share on other sites More sharing options...
RedxYeti Posted November 14, 2022 Author Share Posted November 14, 2022 Thank you for the reply, but if I do it this way, id have to check it against every quest. Im trying to see what quests the player may have active at any given point. Looking like its not quite possible though. Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 14, 2022 Share Posted November 14, 2022 Thank you for the reply, but if I do it this way, id have to check it against every quest. Im trying to see what quests the player may have active at any given point. Looking like its not quite possible though. I actually spent some time looking for ways to solve this yesterday when realizing you will have to *know* which quest you are checking against and there's no Papyrus way of just getting a list of active/finished/marked etc quests. After a couple of dozen crashes trying to tap into the PipBoy menu via F4SE UI script additions (Get(), Invoke(), VarToVarArray()) I gave up. If anyone who's reading this has some experience with ActionScript or even Scaleform itself perhaps this could actually be resolved with your help. I've tried a slew of permutations of functions looking like this: ; cgf "Tools.GetQuests"Quest[] Function GetQuests() Global Var QuestVar = Get("Pipboy_DataPage", "Root1.QuestsTab_mc.QuestsList") Var[] QuestVarArray = VarToVarArray(QuestVar) ; Debug.Trace("Found: " QuestVarArray as Quest[]) <--- means of testing Return QuestVarArray as Quest[]EndFunction Crashing every time I try VarToVarArray (necessary since the AS3 function outputs an array). A "none" is returned otherwise. Link to comment Share on other sites More sharing options...
RedxYeti Posted November 14, 2022 Author Share Posted November 14, 2022 I actually spent some time looking for ways to solve this yesterday when realizing you will have to *know* which quest you are checking against and there's no Papyrus way of just getting a list of active/finished/marked etc quests. After a couple of dozen crashes trying to tap into the PipBoy menu via F4SE UI script additions (Get(), Invoke(), VarToVarArray()) I gave up. If anyone who's reading this has some experience with ActionScript or even Scaleform itself perhaps this could actually be resolved with your help. I've tried a slew of permutations of functions looking like this: ; cgf "Tools.GetQuests"Quest[] Function GetQuests() Global Var QuestVar = Get("Pipboy_DataPage", "Root1.QuestsTab_mc.QuestsList") Var[] QuestVarArray = VarToVarArray(QuestVar) ; Debug.Trace("Found: " QuestVarArray as Quest[]) <--- means of testing Return QuestVarArray as Quest[]EndFunction Crashing every time I try VarToVarArray (necessary since the AS3 function outputs an array). A "none" is returned otherwise. I dont know anything about actionscript, but thank you for trying. One annoying thing theres the command "ShowQuestTarget" which means the info is in memory somewhere, and it spits out all the info i need. it tried consoleutil but after the command, doing ConsoleUtil.ReadMessage() is an empty return Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 15, 2022 Share Posted November 15, 2022 ConsoleUtil is broken and the author is incommunicado. :/Are you trying to retrieve the last entry printed to the console?I have found ways of doing this but it requires having SUP_F4SE installed and it takes quite a bit of wrangling on the retrieved text because you get the whole block of text currently in the command history (it can be quite a lot). One way to make it easier is to clear the console before executing. That's: UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.ClearHistory") You would then execute some command:UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", arguments); arguments must be a Var[] (array), even if it's just one command and then import what's in the command history as string: UI.Get("Console", "root1.AnimHolder_mc.Menu_mc.CommandHistory.text") Finally you'll obviously need some way of programmatically sifting through this body of text and make sure you get what you're looking for. I recommend SUP-functions, it helps if you know some Regex (beware though, lookbehind expressions do not work).https://www.nexusmods.com/fallout4/mods/55419 Link to comment Share on other sites More sharing options...
RedxYeti Posted November 18, 2022 Author Share Posted November 18, 2022 ConsoleUtil is broken and the author is incommunicado. :/ Are you trying to retrieve the last entry printed to the console? I have found ways of doing this but it requires having SUP_F4SE installed and it takes quite a bit of wrangling on the retrieved text because you get the whole block of text currently in the command history (it can be quite a lot). One way to make it easier is to clear the console before executing. That's: UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.ClearHistory") You would then execute some command:UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", arguments); arguments must be a Var[] (array), even if it's just one command and then import what's in the command history as string: UI.Get("Console", "root1.AnimHolder_mc.Menu_mc.CommandHistory.text") Finally you'll obviously need some way of programmatically sifting through this body of text and make sure you get what you're looking for. I recommend SUP-functions, it helps if you know some Regex (beware though, lookbehind expressions do not work).https://www.nexusmods.com/fallout4/mods/55419 Finally had some time to try this way but im not sure where im going wrong. UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.ClearHistory") var[] command = new var[1] command[0] = "sqt" UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", command) WriteStringtoFile("TeleportTest.txt", UI.Get("Console", "root1.AnimHolder_mc.Menu_mc.CommandHistory.text"), 0) String id = ReadStringFromFile("TeleportTest.txt" , 5, 1) as string Debug.MessageBox(id)Everything works up until the string is defined, the debug message returns with nothing my logic is that the 5th line will always contain a formid, so i can use FUP to read and remove the extra text and im left with the formid Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 18, 2022 Share Posted November 18, 2022 I think the problem is that the file is not finished writing before you attempt to collect the line. Using Regex and keeping the string in memory instead works. Function Test() Global CloseConsole() UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.ClearHistory") var[] command = new var[1] command[0] = "sqt" UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", command) Var CommandHistory = UI.Get("Console", "root1.AnimHolder_mc.Menu_mc.CommandHistory.text") String Found = StringRegexSearch(CommandHistory as string, "[0-9a-fA-F]{8}", 1)[0] Debug.MessageBox(Found)EndFunction "[0-9a-fA-F]{8}" signifies a hex match that is 8 chars long. https://drive.google.com/file/d/1B_4uOyJn-Wr0ODD7hSbRWNRFUJ7lE3BG/view Next is the problem of converting the result into a form lookup, if that is what you want. Papyrus Int will not accept Strings that should be acceptable Hexes. (If you are willing to install BakaFramework as well I have a function dealing with that.) Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 18, 2022 Share Posted November 18, 2022 ;Convert hexadecimal to decimal, requires BakaUtil (porting StringUtil from Skyrim)int Function HxDc(String IN) Global String[] HXTBL = StringToArray("0123456789ABCDEF") String[] INARR = StringToArray(IN) Float SUM = 0.0 Int i = INARR.Length Int r = HXTBL.Length Int a = 0 While (i > 0 && a < INARR.Length) If (INARR[i-1] == HXTBL[r-1]) SUM = SUM + ((r-1) as float) * Math.pow(16.0, (a as float)) i -= 1 a += 1 r = HXTBL.Length Else r -=1 Endif EndWhile Return SUM as intEndFunction Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 18, 2022 Share Posted November 18, 2022 You can use this result as:Game.GetFormFromFile(SUM, "Fallout4.esm") EDIT: StringUtil won't be necessary if you loop this SUP function on Found string instead. string Function StringFindSubString(string StringOne, int iPosStart, int iPosEnd =-1) global native;/Returns substring from iPosStart to iPosEnd. Passing -1(default parameter) will return substring from iPosStart to the end of the string./; Link to comment Share on other sites More sharing options...
Recommended Posts