• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Struggling with Append Command

Scyth

Refugee
I'm working on a mod to debuff building and mining on our server - mostly so the molemen don't need to feel bad about hopping on grinding out while they are on a business meeting.

Unfortunately, I can't seem to get PlayerExpGain to work as an Append. If I edit the XML directly, it works just fine. If I try to do it properly, it doesn't work.
 

Code:
<!--Test Case Eliminate XP-->
<append xpath="items/item[starts-with(@name, 'meleeToolRepair']/effect_group[starts-with(@name, 'meleetoolRepair')]">
<effect_group>
	<passive_effect name="PlayerExpGain" operation="perc_add" value="-1" />
</effect_group>
</append>
 
Last edited by a moderator:
Are you trying to add it as an effect_group within the existing effect_group? Because that's how the code reads. If it's just a single passive_effect you want to stick into the existing effect_group, remove the <effect_group> and </effect_group> lines.

My apologies if things have changed drastically in items.xml in alpha 20. I'm at work and only have the a19 configs to look at.

 
I had tried that earlier, and it didn't work, and I saw a suggestion somewhere about using a second effect group, so I figured I'd try it and see if any of the spaghetti stuck to the wall.

 
Okay, here's an idea: try making the second effect_group independent of the first, rather than nested inside it. To do that, I'd change your "append xpath" to "insertAfter xpath" in the code and see if that works. I do see instances in the vanilla configs of items with a second un-named effect_group after the first.

 
Also look into your configdump folder (located in the saves folder) to see how the game is editing the xml code based on your modlet

 
Back
Top