CrypticGirl Posted January 3, 2019 Share Posted January 3, 2019 Okay, I'm trying to make a little modlet, but I'm unsure of how to do so. A lot of modlets I see are editing the properties of certain items, but what if you wanted to add a whole new property to an existing item? I'm not sure whether to do "append xpath" or "set xpath"... Link to comment Share on other sites More sharing options...
DukeW74 Posted January 3, 2019 Share Posted January 3, 2019 If you just wanted to add a property anywhere in the "item", use append. If you wanted to change a value or name you would use set xpath. Personally I use insertBefore xpath or insertAfter xpath because I am picky about where the property goes most times. Check the tutorial section for much more info on xpath Link to comment Share on other sites More sharing options...
CrypticGirl Posted January 4, 2019 Author Share Posted January 4, 2019 I keep getting an error: "XmlException: a name did not start with a legal character 60 (<) Line 5, position 4" Line 5 contains this: <append xpath="/items/item[@name=resourceCrushedSand]/property"> (I'm not sure exactly where "position 4" is, as I don't see a "position" on that little bar at the bottom of the window. Do I not need the /property after every item name? I've tried with and without, and still get the same error. Same with the </append> thing. Link to comment Share on other sites More sharing options...
FastBurst Posted January 4, 2019 Share Posted January 4, 2019 I keep getting an error: "XmlException: a name did not start with a legal character 60 (<) Line 5, position 4" Line 5 contains this: <append xpath="/items/item[@name=resourceCrushedSand]/property"> (I'm not sure exactly where "position 4" is, as I don't see a "position" on that little bar at the bottom of the window. Do I not need the /property after every item name? I've tried with and without, and still get the same error. Same with the </append> thing. Put the code you are trying to work on and I will take a look at it. Link to comment Share on other sites More sharing options...
Khelldon Posted January 4, 2019 Share Posted January 4, 2019 I keep getting an error: "XmlException: a name did not start with a legal character 60 (<) Line 5, position 4" Line 5 contains this: <append xpath="/items/item[@name=resourceCrushedSand]/property"> (I'm not sure exactly where "position 4" is, as I don't see a "position" on that little bar at the bottom of the window. Do I not need the /property after every item name? I've tried with and without, and still get the same error. Same with the </append> thing. The error itself is probably not on line 5, but before it. I assume you made a syntax error before line 5 and line 5 is where the game realized there was a problem. Check lines 1-4. And yes you wouldn't put property after the item name or you'll be appending to the wrong place. Just need to append to the item itself and not the property within that item. Link to comment Share on other sites More sharing options...
CrypticGirl Posted January 4, 2019 Author Share Posted January 4, 2019 Okay, here are lines 1-4. (I have more items with the same coding after it, but if I can find out what I did wrong here, the fix should be easy for the others, too... <configs> <!-- Reducing smelt time --> <append xpath="/items/item[@name='resourceRockSmall']"> <property name="MeltTimePerUnit" value="0.10"/> Link to comment Share on other sites More sharing options...
Khelldon Posted January 4, 2019 Share Posted January 4, 2019 Okay, here are lines 1-4. (I have more items with the same coding after it, but if I can find out what I did wrong here, the fix should be easy for the others, too... <configs> <!-- Reducing smelt time --> <append xpath="/items/item[@name='resourceRockSmall']"> <property name="MeltTimePerUnit" value="0.10"/> if line 5 is "<append xpath="/items/item[@name=resourceCrushedSand]/property">" then you forgot to close the appends before it. "</append>" Link to comment Share on other sites More sharing options...
CrypticGirl Posted January 4, 2019 Author Share Posted January 4, 2019 Okay, so we do need the </append> after each item. But I'm still getting the same error, except in Line 4 now (or before it?) "XmlException: a name did not start with a legal character 60 (<) Line 4, position 4." So here are the first five lines again... <configs> <!-- Reducing smelt time --> <append xpath="/items/item[@name='resourceRockSmall']" <property name="MeltTimePerUnit" value="0.10"/> </append> Link to comment Share on other sites More sharing options...
Khelldon Posted January 4, 2019 Share Posted January 4, 2019 Oh you are missing the ">" at the end of "<append xpath="/items/item[@name=resourceRockSmall]"" now Link to comment Share on other sites More sharing options...
CrypticGirl Posted January 4, 2019 Author Share Posted January 4, 2019 Ah, that was it, thank you! (I figured it had to be something small like that, but I've never had the eye for catching those things.) XD Thanks again. Link to comment Share on other sites More sharing options...
NattHrafn Posted January 4, 2019 Share Posted January 4, 2019 Those things are hard to catch, we all suffer from that. The only thing that really helps is an editor with good code highlighting... What editor are you using? (Just out of curiosity.) Link to comment Share on other sites More sharing options...
CrypticGirl Posted January 4, 2019 Author Share Posted January 4, 2019 I was using Notepad++. So yeah, I had the feeling something was off with the text colors... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.