smashly Posted April 21, 2018 Share Posted April 21, 2018 Hi and thank you for update 17, Is there any chance of modifying the AddKeywordToForm() fucntion with a 3rd optional param to remove an added keyword: AddKeywordToForm(Form akForm, Keyword akKeyword, Bool bAddKeyword = True) bAddKeyword = False to remove the keyword I added earlier. I use your AddKeywordToForm() function to add keywords to locations (LocTypeWorkshop/LocTypeWorkshopSettlement). I do it for dynamically placed workshops so I can pass the condition checks for Shops, Vendors, Brahmin Feed Troughs and a few other things. Your function is a god send as it saves me editing vanilla forms and dialogue conditions. But I would sometimes like to be able to remove the keywords I added without reloading the game. Mainly due to some of my own conditions also check the location keywords to know if a user is offered the option to drop a new settlement or other items. Since I can't remove the keywords I added the user can not drop a new settlement in the dissolved settlement location without exiting and reloading the game. I can change my script logic to work around it, but just thought I'd ask anyway. Thank you for taking the time to read my post. Link to comment
Struckur Posted April 21, 2018 Share Posted April 21, 2018 Thanks for the library! It has been a great help with my Clipboard mod back on Nexus. Is there any chance you guys plan to add some more functions for managing the config file? There are a few that would be god-sends for my purposes: ; Lets you set multiple key values in the file at once, using an array of keys and an array of values bool Function SetCustomConfigOptions(string fileName, string section, string[] keys, string[] values) ; Gets an array of all the keys in a section (Kept in the same order as 'GetCustomConfigOptionValues') string[] Function GetCustomConfigOptionKeys(string fileName, string section) ; Gets an array of all the values in a section (Kept in the same order as 'GetCustomConfigOptionKeys') string[] Function GetCustomConfigOptionValues(string fileName, string section) ; Gets an array of sections in the file string[] Function GetCustomConfigSections(string fileName) ; Removes all key/value pairs from a section of the file. bool Function ClearCustomConfigSection(string fileName, string section) ; Removes all sections and key/value pairs from of the file. bool Function ClearCustomConfigs(string fileName) In any case, thanks for the great tool! Link to comment
jaam Posted April 22, 2018 Author Share Posted April 22, 2018 I'll look at both those request but no promise on planning. I haven't found any time for modding in nearly two weeks. Link to comment
Struckur Posted April 22, 2018 Share Posted April 22, 2018 1 hour ago, jaam said: I'll look at both those request but no promise on planning. I haven't found any time for modding in nearly two weeks. Thanks, and thanks again for the library! Link to comment
smashly Posted May 5, 2018 Share Posted May 5, 2018 Hi again, Thank you for even taking the time to even look at my request. I think something funky is going on with OriginalPluginID() function as it never seems to return the form id for me. I thought it may have been something I was doing wrong, I had a look in the source of your plugin and it looks correct (but I'm no C/C++ writer). As a work around Ive been using the native papyrus GetFormID() wrapped in F4SE Math.LogicalAnd() to do similar eg: Int MyID = Math.LogicalAnd(MyForm.GetFormID(), 0xFFFFFF) Link to comment
jaam Posted May 24, 2018 Author Share Posted May 24, 2018 So I had the time to fix OriginalFormID and add DelKeywordFromForm. I will package it and upload it so people can use the last runtime, then I'll start debugging dagobaking issue. Given the time here I doubt this will be done today. Note: DelKeywordFromForm is untested at the moment, sorry. 1 Link to comment
jaam Posted May 24, 2018 Author Share Posted May 24, 2018 new in v18: compatible with runtime version v1.10.89 fixed OriginalFormID added DelKeywordFromForm (but it untested at the moment). 1 Link to comment
dagobaking Posted May 24, 2018 Share Posted May 24, 2018 42 minutes ago, jaam said: new in v18: compatible with runtime version v1.10.89 fixed OriginalFormID added DelKeywordFromForm (but it untested at the moment). It's not working for me. It loads the main menu. But, when loading a save game it freezes at the moment before revealing the game view. Link to comment
dagobaking Posted May 25, 2018 Share Posted May 25, 2018 1 hour ago, jaam said: new in v18: compatible with runtime version v1.10.89 fixed OriginalFormID added DelKeywordFromForm (but it untested at the moment). Never mind. It appears to be something wrong with F4SE. Link to comment
smashly Posted May 25, 2018 Share Posted May 25, 2018 Thank You jaam for the update. Will report back once i have tested the DelKeywordFromForm function. But atm in my stupidity I have a MCM dependency in my code on MCM and it has not updated, so I can't update my game to test your updated plugin function yet. Cheers Link to comment
fred200 Posted May 25, 2018 Share Posted May 25, 2018 12 hours ago, dagobaking said: It's not working for me. It loads the main menu. But, when loading a save game it freezes at the moment before revealing the game view. Same result here. Will follow this thread to know when it all works. Link to comment
jaam Posted May 25, 2018 Author Share Posted May 25, 2018 There is a patch for F4SE (0.6.9). Maybe that's the issue ? Link to comment
dagobaking Posted May 25, 2018 Share Posted May 25, 2018 4 hours ago, fred200 said: Same result here. Will follow this thread to know when it all works. 11 minutes ago, jaam said: There is a patch for F4SE (0.6.9). Maybe that's the issue ? Yes. 0.6.8 had an issue with UI.Load which AAF needs. So, getting the updated F4SE fixes it. Link to comment
fred200 Posted May 25, 2018 Share Posted May 25, 2018 2 hours ago, dagobaking said: Yes. 0.6.8 had an issue with UI.Load which AAF needs. So, getting the updated F4SE fixes it. Thanks all involved in fixing this! Looks good with 0.6.9. 1 Link to comment
smashly Posted May 26, 2018 Share Posted May 26, 2018 Hi again jaam, No success with the DelKeywordFromForm(). Function calls fine without error, but the keyword I added prior still exists after calling DelKeywordFromForm. I've only tried this on location forms so far as that's all I use it for. Thank you for even taking the time to try adding it all the same. I'm still super happy with the AddKeywordToForm regardless Link to comment
jaam Posted May 27, 2018 Author Share Posted May 27, 2018 ok, it was expected; my code never works right the first time Link to comment
jaam Posted May 30, 2018 Author Share Posted May 30, 2018 Ok, I just looked and there was a huge copy/paste error. Link to comment
jaam Posted May 30, 2018 Author Share Posted May 30, 2018 Today's update is solely for adventurous mod authir willing to test alpha code: added for test on 2018 05 30: fix for DelKeywordFromForm. TO BE TESTED ; Get all the keys and values contained in a section. Both at once to avoid discrepancies in the order. TO BE TESTED string[] Function GetCustomConfigOptions(string fileName, string section) native global ; Set a list of keys and values in a section. Any other existing key will be left alone. TO BE TESTED string[] Function SetCustomConfigOptions(string fileName, string section, string[] keys, string[] values) native global ; Reset all the keys and values contained in a section. TO BE TESTED ; Any exiting key value pair will be suppressed first, so providing none arrays will effectivly removes all keys from the section. string[] Function ResetCustomConfigOptions(string fileName, string section, string[] keys = None, string[] values = None) native global ; Get all the sections in a file. TO BE TESTED string[] Function GetCustomConfigSections(string fileName, string[] sections) native global ; For all array functions: ; The implementation as an arbitrary limitation of 32767 bytes buffer for all Keys, Values or sections involved. ; If needed because the limitation becomes a problem, another implementation can be done using memory allocation, though there will remain a limit imposed by Windows. ; When arrays for keys and values are provided, the count of elements in both arrays must be identical or the function fails on purpose. ; An empty value should be provided as a zero length string. TO BE TESTED ; ; CrossHair functions ; ==================== ; ; Returns the Reference that is currently under the CrossHair. Returns None if there isn't one currently. TO BE TESTED ObjectReference Function LastCrossHairRef() native global ; Returns the last Actor that is or was under the CrossHair. Returns None until there is one since the game was (re)started. TO BE TESTED Actor Function LastCrossHairActor() native global ; ; Collision functions ; =================== ; ; Set the collision state of a reference. Returns the previous state. TO BE TESTED _ currently fails. bool Function ObjectReferenceSetCollision(ObjectReference akObject, bool enable=True) native global ; Get the collision state of a reference. If akObject is None, return the global collision state (controlled by TCL). TO BE TESTED bool Function ObjectReferenceGetCollision(ObjectReference akObject) native global ; ; Misc functions ; ============== ; ; Prints a message to the debug console. Exposes the internal F4SE function Console_Print using the code found in Papyrutil in Skyrim. Function PrintConsole(String text) native global EDIT: I forgot to mention that in order to test, you should extract the F4SE and the Scripts folders from the latest Src-... archive. 1 Link to comment
jaam Posted May 30, 2018 Author Share Posted May 30, 2018 On 4/21/2018 at 5:16 PM, Struckur said: Thanks for the library! It has been a great help with my Clipboard mod back on Nexus. Is there any chance you guys plan to add some more functions for managing the config file? There are a few that would be god-sends for my purposes: ; Lets you set multiple key values in the file at once, using an array of keys and an array of values bool Function SetCustomConfigOptions(string fileName, string section, string[] keys, string[] values) ; Gets an array of all the keys in a section (Kept in the same order as 'GetCustomConfigOptionValues') string[] Function GetCustomConfigOptionKeys(string fileName, string section) ; Gets an array of all the values in a section (Kept in the same order as 'GetCustomConfigOptionKeys') string[] Function GetCustomConfigOptionValues(string fileName, string section) ; Gets an array of sections in the file string[] Function GetCustomConfigSections(string fileName) ; Removes all key/value pairs from a section of the file. bool Function ClearCustomConfigSection(string fileName, string section) ; Removes all sections and key/value pairs from of the file. bool Function ClearCustomConfigs(string fileName) In any case, thanks for the great tool! I implemented GetCustomConfigOptionKeys and GetCustomConfigOptionValues in a single function to force the synchronasiton of keys and values (but as I write that I think this won't return anything). I probably need to change the return value to an array of array containing both keys and values. For ClearCustomConfigSection , I implemented a function which replace all key/value pair in a section. Replacing with empty arrays should result into clearing the section. As for the last one, ClearCustomConfigs, there isn't a Win32 API function that does that, so the code would be equivalent to using a papyrus loop to erase each section one after the other. I might still add it later, but I should actually test what I wrote so far first :). Link to comment
dagobaking Posted May 30, 2018 Share Posted May 30, 2018 Awesome! Thank you for posting this update. I have been looking for that crosshair functionality for a while. Will test. Link to comment
jaam Posted June 1, 2018 Author Share Posted June 1, 2018 On 4/11/2018 at 10:15 PM, dagobaking said: Hello @jaam . In the tests I just did, with a simple chair and the player, this work: if GetFlyCam() SetFlyCam(False) endIf Game.ForceThirdPerson() targetActor.WaitFor3DLoad() targetActor.SnapIntoInteraction(targetLocationObject) Utility.Wait(1.0) SetFlyCam(True) You should probably also block player control at the beginning and restore them at the end because moving out of the furniture during the wait will break the fly cam again. Link to comment
dagobaking Posted June 1, 2018 Share Posted June 1, 2018 Thank you. I will test that pattern as a potential alternative locking method in AAF. Link to comment
jaam Posted June 6, 2018 Author Share Posted June 6, 2018 Am I blind or did I actually forgot to upload the previous test version ? Anyway I am packaging a new test version where the CustomOption functions are tested and corrected. That included a lot of changes to the interface which was very bad. EDIT: No, but it was directly in the post not in the files to download. I deleted it anyway and replaced it. 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now