harryluck Posted October 5, 2018 Share Posted October 5, 2018 (edited) I have looked all over the internet and i've come up empty so it's time to ask the community! :smile:I have a mod i was creating some time ago, i have since changed my computer and wanted to work on it again, however, a lot of my scripts for terminals, quests show failed to load code fragment. I've double checked everything i can think of, all the .ini files (invalidate etc. etc.) and it all seems correct, and it is finding some of the of the scripts, but not all. I tried recreating by copying the code from the fragments, deleting the fragment from the editor and then pasting in the line from the .psc and it won't compile either, unable to find store class. I'm entirely out of ideas, any help greatly appreciated, thank you. EDIT:When trying to fully recreate the script from scratch it's actually the properties that disappear and thus makes the compile fail and I can't find a way to re-add them without touching the script. Can I create a new script by adding the properties first? i can't seem to get the form list to work at all. Harry Luck. Edited October 5, 2018 by harryluck Link to comment Share on other sites More sharing options...
SKKmods Posted October 5, 2018 Share Posted October 5, 2018 Fragments are a PITA when they become lost or corrupt. You would think that simply [ delete fragment ] and create a new one would work, but not so much (for me). You need to provide an original source PSC and compiled PEX to allow edit or delete. ...\Fallout 4\Data\Scripts\Fragments\Quests\QF_*.pex...\Fallout 4\Data\Scripts\Source\User\Fragments\Quests\QF_*.psc Unless a better offer comes along, standby to re-create quests and terminals from scratch. The horror. Link to comment Share on other sites More sharing options...
harryluck Posted October 5, 2018 Author Share Posted October 5, 2018 So, the files I had were .PEX files, i decompiled them in order to get the .PSC files which i then moved to my user folder thinking everything would work fine... alas no. I have so many to recreate, there must be a way :) Should i put back the .PEX files to the scripts folder and then the .psc files in the source then? i'm sure i had that before and it still didn't work though. Thanks. Link to comment Share on other sites More sharing options...
SKKmods Posted October 5, 2018 Share Posted October 5, 2018 I would not expect decompiling fragment PEX to generate usable PSC as the fragment format is awkward. Tried with Champollion, Pexinspector and such. Have not tried hand formatting as there is probably some byte/offset gotcha, better invest the time on a proper do-over (whilst reflecting on backup and archive strategy). Link to comment Share on other sites More sharing options...
harryluck Posted October 5, 2018 Author Share Posted October 5, 2018 (edited) well, it was backed up :smile: not sure why it isn't happy with them being re-added exactly where they were... super frustrating. what i really don't understand is that even with deleting the fragment in the editor and the trying to re-add the code it still complains about missing properties, but won't let me edit the properties... i have no clue how to get around it. EDIT:i used champollion, seemed pretty good overall, not sure why i wouldn't just be getting potentially a compile error based on syntax rather a complete inability to see or load the fragments, that is what is the most frustrating. Edited October 5, 2018 by harryluck Link to comment Share on other sites More sharing options...
Evangela Posted October 5, 2018 Share Posted October 5, 2018 Terminal fragments are so notorious for this.. Link to comment Share on other sites More sharing options...
markyrocks Posted October 5, 2018 Share Posted October 5, 2018 Usually when I have issues like this I'll open the fragment Source file comment out the entire script, open the terminal, compile it which should overwrite the pex file ( you may want to backup the pex). Add in the missing properties, uncomment the .psc then compile again. You can't add properties if the entire psc wont compile. It's kinda a catch 22. You probably want to use an external editor to do this. I use visual studio which is free and fantastic. I haven't set it up with compiling built in but it's not necessary, you just save from vs and go into the ck and compile. Link to comment Share on other sites More sharing options...
harryluck Posted October 6, 2018 Author Share Posted October 6, 2018 Wow, okay, i think i've found a way thanks to your thoughts :) thank you @markyrocks. For anyone else who's had this problem... there is a solution! It's far from elegant, but it does work! :) 1. Backup and then delete your .pex of this same file2. Ensure your .psc is formatted exactly like a regular .psc (open one from base to check)3. Go into CK and load your plugin (if not already open) but don't open the associated object!4. Open the papyrus script manager (gameplay top menu) and compile the script5. Now, open the object, the fragment will still be 'failed to find' ... that's okay. (you should at this point be able click the properties button and see they are intact though)6. Next, make sure your script is open in your editor of choice and then in the papyrus advanced tab of the object script... Delete the fragment! :O7. Now compile and click okay (if your editor of choice wants to refresh, don't)8. Re-open the object and then from your still open script paste in the function 'code' section back into the papyrus fragment window.9. Press compile and cross your fingers.10. Check to see if it's made a new copy of the script, if so, delete your now old one and the pex, recompile and then happy happy joy joy. Like i said, it's weird and inelegant... but it's still a hell of a lot quicker than remaking all your terminals/characters/quests from scratch. Really hope this works for others too... it was driving me insane! :) Thanks for the clues and pointers. Harry. Link to comment Share on other sites More sharing options...
markyrocks Posted October 6, 2018 Share Posted October 6, 2018 Glad it worked out for you bro. Link to comment Share on other sites More sharing options...
SKKmods Posted October 6, 2018 Share Posted October 6, 2018 happy happy joy joy. related to LOG™ ? Link to comment Share on other sites More sharing options...
Recommended Posts