TrabberShir Posted January 3, 2020 Share Posted January 3, 2020 I am a software engineer that is new to Oblivion modding and I have no experience with whatever script system TES4Edit uses. (It looks like Pascal Script for Delphi?) I have a script idea I want to implement and am hoping someone that is already familiar with the system might be so kind as to translate my pseudo-code into valid script syntax. node[] books = the nodes in the BOOK record group of the selected .esp foreach(var node in books) { if(node does not have an SCRI record) then { string bookEDID = the EDID record for the node string newSCTX = replace "%BookEDID%" with bookEDID in some hard coded text add a new node to the SCPT record group for the selected .esp with an EDID equal to Append("IBook", bookEDID) and an SCTX equal to newSCTX add an SCRI record to the current node set to the FormID of the new script. } } Basically, I am trying to make every book added or modified by the selected mod, which does not have a script already, behave the same as the books modified by Intelligence Overhaul Any help figuring out the syntax woudl be greatly appreciated. Link to comment Share on other sites More sharing options...
TrabberShir Posted January 3, 2020 Author Share Posted January 3, 2020 (edited) I can't seem to post the script part I have so far. I keep getting security errors when I try. So will just try to post more specific questions. How do I get the group records (IwbGroupRecord) for the selected esp file? How do I create a new IwbMainRecord for the script? I am assuming I add it with AddElement after populating all the EditValues. How do I check if an IwbMainRecord has an edit value? Specifically, once I get a BOOK node, I am trying to test that it does not have an SCRI record. Is it GetElementEditValues and compare the result to the empty string? Once I have script Text for a SCPT record's SCTX value, how can I compile it to get the rest of the values? I believe (but am probably wrong) that I have everything else figured out. Edited January 3, 2020 by TrabberShir Link to comment Share on other sites More sharing options...
zilav Posted January 3, 2020 Share Posted January 3, 2020 xEdit has discord (a button in the right upper corner) with a separate scripting channel for such discussions. Link to comment Share on other sites More sharing options...
TrabberShir Posted January 4, 2020 Author Share Posted January 4, 2020 Thank you Link to comment Share on other sites More sharing options...
Recommended Posts