SlicksGirl Posted March 26, 2019 Share Posted March 26, 2019 so i am getting this error 2019-03-25T23:13:02 62.173 ERR XML loader: Patching 'recipes.xml' from mod 'DW Mods - Dyes Mod' failed 2019-03-25T23:13:02 62.174 EXC XML.Patch (/append/recipe): Patch element does not have an 'xpath' attribute Exception: XML.Patch (/append/recipe): Patch element does not have an 'xpath' attribute at XmlPatcher.singlePatch (.XmlFile _targetFile, System.Xml.XmlElement _patchElement, System.String _patchName) [0x00000] in <filename unknown>:0 at XmlPatcher.PatchXml (.XmlFile _xmlFile, .XmlFile _patchXml, System.String _patchName) [0x00000] in <filename unknown>:0 at XmlPatcher.LoadAndPatchConfig (System.String _configName) [0x00000] in <filename unknown>:0 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) Logger:masterLogException(Exception) Logger:Exception(Exception) Log:Exception(Exception) XmlPatcher:LoadAndPatchConfig(String) <loadSingleXml>c__Iterator1:MoveNext() UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) and my code looks like this <?xml version="1.0" encoding="UTF-8" ?> <!--recipes--> <append xpath="/recipes"> blah blah blah </append> I copied and pasted the xpath code over from the items one for this mod and the items one has no errors. I've also ran the code through a validator, used ccleaner on my computer, validated the steam files, and started a brand new game. It still says the xpath file isnt coded. any ideas why? Link to comment Share on other sites More sharing options...
Guppycur Posted March 27, 2019 Share Posted March 27, 2019 What's that weird stuff at the top. Needs <recipes> and </recipes> Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 What's that weird stuff at the top. Needs <recipes> and </recipes> oddly, the others are all working fine without that. I'll try anything a t this point, because the code was working when manually pasted into the vanilla files. Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 still getting an error.... ERR XML loader: Patching 'item_modifiers.xml' from mod 'DW Mods - Dyes Mod' failed EXC XML.Patch (/append/item_modifiers): Patch element does not have an 'xpath' attribute Exception: XML.Patch (/append/item_modifiers): Patch element does not have an 'xpath' attribute <?xml version="1.0" encoding="UTF-8" ?> <!--items--> <append xpath="/items"> <!--itemmods--> <item_modifiers> .......... </item_modifiers> </append> ERR XML loader: Patching 'recipes.xml' from mod 'DW Mods - Dyes Mod' failed 161.705 EXC XML.Patch (/append/recipes): Patch element does not have an 'xpath' attribute Exception: XML.Patch (/append/recipes): Patch element does not have an 'xpath' attribute <?xml version="1.0" encoding="UTF-8" ?> <!--recipes--> <append xpath="/recipes"> <recipes> ...... </recipes> </append> Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 my other mod works perfectly without that start and end tag...<?xml version="1.0" encoding="utf-8"?> <DWModsAdminMod> <append xpath="/blocks"> <!--small admin bag--> <block name="openMeOne"> ......... </block> Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 so i added <item></item> <recipe></recipe> etc to all of the appropriate mod files and it literally broke the game. I removed it all and now.. all the mods work fine.. must have been a glitch Link to comment Share on other sites More sharing options...
Guppycur Posted March 27, 2019 Share Posted March 27, 2019 Ya gotta have something, but it has to surround the XML. Kill the first weird line. The do recipes, then your appends, then /recipes. Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 Sample I haven't used yet but works if that helps the thought process for recipes <append xpath="/recipes"> <recipe name="SteelWheel" count="1" craft_area="workbench"> <ingredient name="resourceForgedSteel" count="25" /> <ingredient name="resourceSpring" count="5" /> <ingredient name="resourceMechanicalParts" count="5" /> </recipe> </append> Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 Sample I haven't used yet but works if that helps the thought process for recipes <append xpath="/recipes"> <recipe name="SteelWheel" count="1" craft_area="workbench"> <ingredient name="resourceForgedSteel" count="25" /> <ingredient name="resourceSpring" count="5" /> <ingredient name="resourceMechanicalParts" count="5" /> </recipe> </append> yeah, my other mod worked fine with this exact code set up for xpath and i simply copied it over, put them in a new file, and changed the content for the next mod. and it kept failing. the content code had been tested directly pasted into the vanilla files and worked fine. even worked fine as part of the previous mod. I simply decided to make my mod into modlets to make it easier to edit things later on. and the second mod refused to work, despite having this same exact set up as you showed. Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 Ok so silly question as I am running out of ideas here but in each xml do you have a starting point and end point ? I always use my modlet name I dont see a start and end point in your recipes.xml or is that just not copied over for the forum ? <Ragsy_Wheels_Of_Steel> <append xpath="/recipes"> <recipe name="SteelWheel" count="1" craft_area="workbench"> <ingredient name="resourceForgedSteel" count="25" /> <ingredient name="resourceSpring" count="5" /> <ingredient name="resourceMechanicalParts" count="5" /> </recipe> </append> </Ragsy_Wheels_Of_Steel> On one the code quotes starts <DWModsAdminMod> for blocks.xml Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 Ok so silly question as I am running out of ideas here but in each xml do you have a starting point and end point ? I always use my modlet name I dont see a start and end point in your recipes.xml or is that just not copied over for the forum ? <Ragsy_Wheels_Of_Steel> <append xpath="/recipes"> <recipe name="SteelWheel" count="1" craft_area="workbench"> <ingredient name="resourceForgedSteel" count="25" /> <ingredient name="resourceSpring" count="5" /> <ingredient name="resourceMechanicalParts" count="5" /> </recipe> </append> </Ragsy_Wheels_Of_Steel> On one the code quotes starts <DWModsAdminMod> for blocks.xml simply not copied over. hard to forget to write it because notepadd++ automatically writes it after <anything> Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 Well I did say it's a silly question .. but hey now I know Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 I notice also in your item_modifiers.xml you have <append xpath="/items"> To be honest I wish I had started modding before A17 XML Modding for A16 and previous versions you decide what you want to do and put code in ...job done . Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 I notice also in your item_modifiers.xml you have <append xpath="/items"> To be honest I wish I had started modding before A17 XML Modding for A16 and previous versions you decide what you want to do and put code in ...job done . yea i saw that, fixed it, still got the eror.. before 17 modding wasnt as easy as this. yeah you pasted it in and every time you wanted a new mod.. you had to add in the code... and then hope you didnt mess something up. anytime you wiped a server, verified your game cache, or got an update to the game.. you had to manually ad all your mods back in. it was a tedious nightmare. although it seems like more of en effort to create mod files and use xpath, it will make readding those same mods each game, easier and easier. it also makes finding bugs easier, you have one short page of code to look in, instead of 6,000+ lines of code. Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 Ok well in that case probably best I didn't start there I would have pulled out whats left of my hair lol. The best way of learning xpath other than tutorials and vids posted in these forums is to just look at other modders work on how they coded stuff, many if not all modders here are quite ok if you take their code ideas and mould it to what you want and I am no exception. If you really want to get good advise on a one to one level then join Guppy's discord, there is live support on there too and a lot of us still learning the ways of xpath but people are very knowledgable and there seems to be always someone who knows or can point you in the right directions. Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 Ok well in that case probably best I didn't start there I would have pulled out whats left of my hair lol. The best way of learning xpath other than tutorials and vids posted in these forums is to just look at other modders work on how they coded stuff, many if not all modders here are quite ok if you take their code ideas and mould it to what you want and I am no exception. If you really want to get good advise on a one to one level then join Guppy's discord, there is live support on there too and a lot of us still learning the ways of xpath but people are very knowledgable and there seems to be always someone who knows or can point you in the right directions. yea, i joined his discord back on a15, I've been modding since a11 (and coding since around 1998). I've just not posted my stuff here much because when i do, there is this one forum guy that bullies me and admins have to take down my threads. so now, i just mainly keep to myself, except with i cannot get something to work after days of trying, like with xpath. Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 yea, i joined his discord back on a15, I've been modding since a11 (and coding since around 1998). I've just not posted my stuff here much because when i do, there is this one forum guy that bullies me and admins have to take down my threads. so now, i just mainly keep to myself, except with i cannot get something to work after days of trying, like with xpath. Thats a lot of experience on coding .... and I am sorry you have had the problems on the forums too. If I do think of something to help you out with this issue then I will let you know but for now I am out of idea's. Link to comment Share on other sites More sharing options...
SlicksGirl Posted March 27, 2019 Author Share Posted March 27, 2019 Thats a lot of experience on coding .... and I am sorry you have had the problems on the forums too. If I do think of something to help you out with this issue then I will let you know but for now I am out of idea's. no worries, i should buckle down and take a course and get certified. Coding is soo much like math that its easy for me to pick up. The error just radomly resolved itself. so somehow i fixed it and dont even know what i did. But i'm going to create a template file set so that all i have to do is fill the pages up with content. I'll probably release that as a mod on the forums with instructions on how to use it. Link to comment Share on other sites More sharing options...
stasis78 Posted March 27, 2019 Share Posted March 27, 2019 What's that weird stuff at the top. Needs <recipes> and </recipes> It’s the prolog. It’s metadata about the xml document. Optional but normally included in xml files. https://www.w3schools.com/xml/xml_syntax.asp Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted March 27, 2019 Share Posted March 27, 2019 Glad you sorted it out , I have had that situation where I fixed something and never knew how it's frustrating as you can learn from a mistake but not from an unknown variable. Look forward to seeing your work on the forum. Ragsy Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.