Jump to content

How to add new property?


CrypticGirl

Recommended Posts

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

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

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...