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

removing objects/items from loot table

Dark Wun

Refugee
Hi all,

Is it possible, and fairly simple, for someone new to modding, to outright remove something from the loot table so it never shows up randomly in loot containers? e.g., cotton

 
yes

<remove xpath ="//item[@name='resourceCropCottonPlant']"/>




That will remove all instances of cotton in the loot file

 
nice, thank you.

So just stick this line right at the end in loot.xml in a particular save game and cotton in random loot is gone from that point on?
No you need to create a new file for mods, grab a small one example but your mod loot file would look something like

Code:
<config>
<remove xpath=“//item[@name=‘resourceCropCottonPlant’]”/>
</config>
 
Last edited by a moderator:
No you need to create a new file for mods, grab a small one example but your mod loot file would look something like


Alright, thanks, so I've got the directory structure worked out for my small mod and I think I can figure out what to put in the ModInfo.xml no problem:

NoCotton
\config
\loot.xml
\ModInfo.xml



Code:
So now I  make the loot.xml file:
Code:
<config>
<remove xpath=“//item[@name=‘resourceCropCottonPlant’]”/>
</config>

Just those three lines and my mod is complete? Or is there some code I need to tell it to call the default loot.xml file and then modify it with xpath?

 
Nope that should work for you.  If it doesn't give a shout and I will help you troubleshoot it


No dice on the first try. I think there's a syntax error. I got this message in the console in red letters:

ERR XML loader: Loading XML patch file 'loot.xml' from mod 'Noloot' failed:

EXC "" is an unexpected token. The expected token is "" or "", Line 2, position 15.

Is there a way I can copy feedback from the console, I had to manually type that and may have got some of the " symbols wrong?

 
No dice on the first try. I think there's a syntax error. I got this message in the console in red letters:

ERR XML loader: Loading XML patch file 'loot.xml' from mod 'Noloot' failed:

EXC "" is an unexpected token. The expected token is "" or "", Line 2, position 15.

Is there a way I can copy feedback from the console, I had to manually type that and may have got some of the " symbols wrong?


My code works for me.

Line 2, position 15 would be the first character after the = sign.  Make sure that is a double quotation mark not a single apostrophe twice

If you copy it from here, the text also might get messed up.  So I would type it in manually.

 
If you copy it from here, the text also might get messed up


yep, you're spot on; some of the characters copied directly from here don't get properly recognized in the text editor. I changed that and everything seems to be working as planned.

First step of my modding complete, cheers!

 
Back
Top