RockeyWerewolf Posted March 30, 2023 Share Posted March 30, 2023 (edited) Hello there! I am new to this forum and skyrim scripting itself and just was funning around to get some stuff work. So, lets come to my issueI was trying to use MiscUtil.WriteToFile() method and for some odd reason this method is not creating any file. I dont see any errors during compiling and i'm sure that papyrus util is installed.There is a code: Scriptname coolDebug extends Quest Hidden Event OnInit() Debug.Notification("OnInit() called") MiscUtil.WriteToFile("CoolDebug.txt", "Debug") EndEvent Also want to mention that "OnInit() called" notification comes on loading the save game. Its all information i can provide. Thanks in advance! Edited March 30, 2023 by RockeyWerewolf Link to comment Share on other sites More sharing options...
dylbill Posted March 30, 2023 Share Posted March 30, 2023 Looks like that should be working. Make sure you're looking in the right folder for the file. I don't remember where the default folder is for WriteToFile, but It's either the Skyrim root folder or the Data folder. If you can't find it, try first creating an empty CoolDebug.txt file first before running the code and see if that helps. Link to comment Share on other sites More sharing options...
RockeyWerewolf Posted March 31, 2023 Author Share Posted March 31, 2023 (edited) Looks like that should be working. Make sure you're looking in the right folder for the file. I don't remember where the default folder is for WriteToFile, but It's either the Skyrim root folder or the Data folder. If you can't find it, try first creating an empty CoolDebug.txt file first before running the code and see if that helps. Thanks for your response, but unfortunately creating file by mysef both in Skyrim root and Data doesn't help. Is there a way to debug if the function is running or some error has occurred?In general, initially I tried to read something from an already created file using the ReadFromFile function, but also to no avail. This idea of trying to write a file came about as a test to see if any function from MiscUtil works.I also had an idea that maybe the game doesn't have file management permissions, but the game is running as administrator so that's probably not an option either.And do you know any other community where i can get help? Forums, Discord servers, idk. Edited March 31, 2023 by RockeyWerewolf Link to comment Share on other sites More sharing options...
dylbill Posted March 31, 2023 Share Posted March 31, 2023 No problem. I do know that miscUtil.writetofile does work, as I've used it in some of my mods. Off the top of my head, My mod MCM Creator comes to mind: https://www.nexusmods.com/skyrimspecialedition/mods/45647 Source code is provided. If your script is compiling it should work. Make sure you also have all requirements installed as well. SKSE and Address Library if you're working with Skyrim Special Edition. Link to comment Share on other sites More sharing options...
RockeyWerewolf Posted March 31, 2023 Author Share Posted March 31, 2023 No problem. I do know that miscUtil.writetofile does work, as I've used it in some of my mods. Off the top of my head, My mod MCM Creator comes to mind: https://www.nexusmods.com/skyrimspecialedition/mods/45647 Source code is provided. If your script is compiling it should work. Make sure you also have all requirements installed as well. SKSE and Address Library if you're working with Skyrim Special Edition.Thank you! I found where my problem was. I was using versions of Adress Library and Papyrus Util for AE, not for SE.... Link to comment Share on other sites More sharing options...
dylbill Posted March 31, 2023 Share Posted March 31, 2023 No worries, glad you found the problem! Link to comment Share on other sites More sharing options...
RockeyWerewolf Posted April 8, 2023 Author Share Posted April 8, 2023 (edited) No worries, glad you found the problem!Hi again, do you know of any way to find out what an object is from a form id? I mean is it an item, just an object or an NPC(e.g cheese, chair, werewolf)? I really don't know how to explain this more clearly, I hope you get my question. Edited April 8, 2023 by RockeyWerewolf Link to comment Share on other sites More sharing options...
Sphered Posted April 8, 2023 Share Posted April 8, 2023 If you need to resolve the form, aka you only have the ID for whatever reason, you can call GetFormEx Once you have a Form, run a GetType() call to determine what it is Form Something = Game.GetFormEx(TheProvidedFormID) Int Kind = Something.GetType() Bool ItsARef = Kind == 61; 62 is also a ref, but just actor, and always is 43 Base Type If ItsARef Int DNA = (Something as ObjectReference).GetBaseObject().GetFormID() Bool ItsAnActivator = DNA == 24 Bool ItsAMiscObject = !ItsAnActivator && DNA == 32 ; Etc EndIfAbove is just native SKSE capabilities. There might be something more steamlined available from PUtil to do it too Link to comment Share on other sites More sharing options...
Recommended Posts