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

Specific loot in prefab?

pipermac

Refugee
Is it possible and if so how, to create a prefab that has a loot container that always has the same items in it?  I tried creating one, put a container, put the items in the container but then when I went to it in game it was just random items in it. 

 
Is it possible and if so how, to create a prefab that has a loot container that always has the same items in it?  I tried creating one, put a container, put the items in the container but then when I went to it in game it was just random items in it. 
Create a container and add a loot group with the items you want in it. Link the loot group to the container and add a count="all" next to the lootgroup name . 

Ie: <lootgroup name="container1" count="all">

Then  your items go here.

 
Create a container and add a loot group with the items you want in it. Link the loot group to the container and add a count="all" next to the lootgroup name . 

Ie: <lootgroup name="container1" count="all">

Then  your items go here.
Ahh.. So a brand new container and just use the model of an existing one... I got it! Thanks

 
Ahh.. So a brand new container and just use the model of an existing one... I got it! Thanks
Yeh pretty much copy a existing container  and its loot group and change the container name and lootgroup values in loot.xml of the copied container and in the block itself to link the loot.xml one  localizarion to if you wanted to go that far 

 
Yeh pretty much copy a existing container  and its loot group and change the container name and lootgroup values in loot.xml of the copied container and in the block itself to link the loot.xml one  localizarion to if you wanted to go that far 
thanks...still having bit of trouble.. this is the code I used for loot.xml:

<insertAfter xpath="/lootcontainers/lootgroup[@name='groupBirdNestMain']">
<lootgroup name="StarterItems" count="all">
                <item name="meleeToolPickT3Auger"/>
                <item name="gunHandgunT1Pistol"/>
                <item name="ammo9mmBulletBall" count="200"/>
                <item name="resourceRepairKit" Count="5"/>
                <item name="meleeToolSalvageT1Wrench"/>
</lootgroup>
    </insertAfter>    
<append xpath="/lootcontainers" >    
    <lootcontainer id="225" count="1" size="10,9" destroy_on_close="true" sound_open="SupplyDrops/open_supply_crate" sound_close="SupplyDrops/close_supply_crate" >
 <item group="StarterItems" />
    
      </lootcontainer>    
    </append>  

when I go and open one of the containers  I got a level 5 Pistol and 100 9mm rounds...and thats it.
Any ideas?

 
thanks...still having bit of trouble.. this is the code I used for loot.xml:

<insertAfter xpath="/lootcontainers/lootgroup[@name='groupBirdNestMain']">
<lootgroup name="StarterItems" count="all">
                <item name="meleeToolPickT3Auger"/>
                <item name="gunHandgunT1Pistol"/>
                <item name="ammo9mmBulletBall" count="200"/>
                <item name="resourceRepairKit" Count="5"/>
                <item name="meleeToolSalvageT1Wrench"/>
</lootgroup>
    </insertAfter>    
<append xpath="/lootcontainers" >    
    <lootcontainer id="225" count="1" size="10,9" destroy_on_close="true" sound_open="SupplyDrops/open_supply_crate" sound_close="SupplyDrops/close_supply_crate" >
 <item group="StarterItems" />
    
      </lootcontainer>    
    </append>  

when I go and open one of the containers  I got a level 5 Pistol and 100 9mm rounds...and thats it.
Any ideas?
Did you make a loot group as well in the loot.xml with a lootcontainer id not used by other containers/lootable objects then put that value in the container. 

 
ya its the first part  used "225"

<insertAfter xpath="/lootcontainers/lootgroup[@name='groupBirdNestMain']"><lootgroup name="StarterItems" count="all">                <item name="meleeToolPickT3Auger"/>                <item name="gunHandgunT1Pistol"/>                <item name="ammo9mmBulletBall" count="200"/>                <item name="resourceRepairKit" Count="5"/>                <item name="meleeToolSalvageT1Wrench"/></lootgroup>    </insertAfter>

If I change the Item in the group I definitely get the different items but the the amount  of items or which items is not accurate

Also...I when I test it multiple time I will get different combinations of loot.  Its as if the "all" is not working and the "count" in the items is being ignored.

second try it gave me 3 repair kits and 100 rounds of 9mm

 
I Figured out the problem!  The Game was set for 50% Loot Abundance!  throwing everything off...once it was set to 100% it worked perfectly

 
Back
Top