LastTugBoat243 Posted November 18, 2022 Share Posted November 18, 2022 (edited) <config> <append xpath="/lootcontainers/"> <lootgroup name="soldierGunParts" prob="1"> <item name="partsPistol_barrel" prob="1"/> <item name="partsPistol_grip" prob="1"/> <item name="partsPistol_parts" prob="1"/> <item name="partsPistol_receiver" prob="1"/> </lootgroup> <append xpath="/lootcontainers/lootgroup[@name='zombieSoldier']"> <lootgroup name="soldierGunParts"/> </append> </append> </config> Edited November 18, 2022 by LastTugBoat243 misspelling (see edit history) Link to comment Share on other sites More sharing options...
LastTugBoat243 Posted November 18, 2022 Author Share Posted November 18, 2022 Link to comment Share on other sites More sharing options...
BFT2020 Posted November 18, 2022 Share Posted November 18, 2022 You are saying you are doing something wrong, but not explaining what is happening in game for you. Somethings I noticed: your first bit of code is adding a new lootgroup, but the way it is coded, it is being added to the end of the loot file which is after lootcontainer. Change <append xpath="/lootcontainers/"> to <append xpath="/lootcontainers/lootgroup[@name='groupCaskets']"> That should add it after the last lootgroup in the vanilla xml file. But based on your coding, you are modding a mod, so maybe check that one out to ensure you are putting it inside the lootgroup areas. Second, your </append> structure is wrong. After the first append (but before the second append), you need to close it out with its own </append> . So your code should look something like this: <config> <append xpath="/lootcontainers/lootgroup[@name='groupCaskets']"> <lootgroup name="soldierGunParts" prob="1"> <item name="partsPistol_barrel" prob="1"/> <item name="partsPistol_grip" prob="1"/> <item name="partsPistol_parts" prob="1"/> <item name="partsPistol_receiver" prob="1"/> </lootgroup> </append> <append xpath="/lootcontainers/lootgroup[@name='zombieSoldier']"> <lootgroup name="soldierGunParts"/> </append> </config> 2 Link to comment Share on other sites More sharing options...
LastTugBoat243 Posted November 18, 2022 Author Share Posted November 18, 2022 I'm sorry. I get that error in the screenshot just before loading into the game. Once in the game I try to kill some zombies and check their loot to see if the code worked. But when I see the error I usually just figure it didn't work. Link to comment Share on other sites More sharing options...
LastTugBoat243 Posted November 18, 2022 Author Share Posted November 18, 2022 I tried the code but its saying that the xml patch did not apply Link to comment Share on other sites More sharing options...
khzmusik Posted November 19, 2022 Share Posted November 19, 2022 (edited) 13 hours ago, LastTugBoat243 said: I tried the code but its saying that the xml patch did not apply In the vanilla game, there is no loot group called "zombieSoldier". In vanilla, the entity that is dropped when a zombie dies, is determined by its "LootDropEntityClass" property in its entity class (in entityclasses.xml). That is in the "zombieTemplateMale" entity and is inherited by other zombies. Unless the individual zombie entity class overrides it, it will be the "EntityLootContainerRegular" entity. That is the case for most soldier zombies. The exception is radiated soldier zombies, and that is overridden so they drop "EntityLootContainerStrong" loot bag entities. Those loot container entities, in turn, use different loot containers, as determined by their "LootListOnDeath" values. "EntityLootContainerRegular" uses the "zPackReg" loot container. "EntityLootContainerStrong" uses the "zPackStrong" loot container. The "zPackReg" loot container uses the "groupZpackReg" loot group, and the "zPackStrong" loot container uses the "groupZpackStrong" loot group. So if you want to make soldier zombies - and only soldier zombies - drop gun parts, you will need to do this: In loot.xml, create a new loot group for soldier zombies (or loot groups plural, if you want to follow the vanilla game and have radiated zombies drop better loot) In loot.xml, create new loot container(s) that uses the new loot group(s) In entityclasses.xml, create a new loot container entity (or entities) that uses that new loot container In entityclasses.xml, make the soldiers drop the entity container(s) by overriding or replacing the value of the soldier zombies' "LootDropEntityClass" properties Good luck! Edited November 19, 2022 by khzmusik (see edit history) 1 Link to comment Share on other sites More sharing options...
LastTugBoat243 Posted November 19, 2022 Author Share Posted November 19, 2022 (edited) Well I got to work . <config> <append xpath="//lootcontainers"> <lootgroup name="soldierGunParts" count="3" prob="1"> <item name="partsPistol_barrel" /> <item name="partsPistol_grip" /> <item name="partsPistol_parts" /> <item name="partsPistol_receiver" /> </lootgroup> </append> <append xpath="//lootcontainer[@id='281']"> <lootgroup name="soldierGunParts"/> </append> </config> Edited November 19, 2022 by LastTugBoat243 misspelling (see edit history) 1 Link to comment Share on other sites More sharing options...
khzmusik Posted November 19, 2022 Share Posted November 19, 2022 I am glad you got it to work. But, from your screenshots, you are using one or more mods. Vanilla (non-modded) 7D2D is different from that mod: Players can not loot the bodies of zombies. (Zombies drop loot bags, players can only loot those.) There is no loot container with the ID of 281. There are no pistol barrels, grips, parts, or receivers. Since you didn't tell us you are using a mod, none of us had any way to know about those differences. In the future, you need to tell people those details when you ask for help. Otherwise you will only confuse people, and get advice that won't help you. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now