Results 1 to 6 of 6

Thread: Loot Table Issues (Newbie)

  1. #1
    Refugee
    Join Date
    Sep 2016
    Posts
    6
    Rep Power
    0

    Loot Table Issues (Newbie)

    I just started into trying to mod my own server so I'm sure i'm doing something wrong but basically I'm trying to create a Survival Box that I can give to new accounts on the server. The idea being that they get some basic supplies to start off with. I grabbed the Survivor Pack Starting Gear mod and basically whenever I spawn the item in creative mode, it's empty.. So I've spent the better part of this morning learning and trying and still having trouble. Here is the code I'm using, can anyone tell me what I'm doing wrong?

    This is in my block.xml and I basically just stole the cardboard box and gave it a new name and loot table.
    <block id="2002" name="Survival Box">
    <property name="CustomIcon" value="cntCardboardBox" />
    <property name="Class" value="Loot" />
    <property name="Material" value="cardboard" />
    <property name="Texture" value="276,270,270,270,270,270" />
    <property name="LootList" value="216" />
    <drop event="Destroy" count="0" />
    </block>

    and then loot.xml

    <lootcontainer id="216" count="2" size="4,4" destroy_on_close="true" sound_open="UseActions/open_corpse" sound_close="UseActions/close_corpse">
    <item name="wornBoots"/>
    <item name="miningHelmet"/>
    </lootcontainer>

    I know the container is right because if I change the size in loot, it changes in game and even the sound changes if I change the lootcontainer settings. However, no matter what I put in the container, it's always empty in game. I can open the box and then it just destroys itself like it's supposed to. What stupid thing am i missing?


    Thanks in advance.

  2. #2
    Colony Founder Haidrgna's Avatar
    Join Date
    May 2016
    Location
    The Netherlands
    Posts
    1,117
    Rep Power
    1
    What you need to do before this will work is create another block called something like Closed Survivor Box or something. This would be exactly the same but will have to have the downgrade property and set it to downgrade to the Survival Box block you made. It should not be a loot containers, so remove the Class: loot from it.

    Then a player that gets it, can place it and smash it open (may want to make it weak) and then when he smashes the box open it degrades into your box and then it becomes a loot container filled with loot.

    This is the exact same method that the Gun Crates in gunstores use for example, check out the code for those if you want to see how it is done.

    Otherwise any lootcontainer placed by players are always empty by default.

  3. #3
    Scavenger Kurziel's Avatar
    Join Date
    Apr 2016
    Location
    R'lyeh
    Posts
    52
    Rep Power
    0
    If I understand your problem correctly you're able to place the box, but there is no loot? If that's correct your issue is that player created blocks can't spawn loot. What you have to do is something like this:

    Code:
        <block id="2035" name="SurvivalBox">
            <property name="Material" value="glass" />
            <property name="Shape" value="Ext3dModel" />
            <property name="Mesh" value="models" />
            <property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
            <property name="Place" value="TowardsPlacer" />
            <property name="CustomIcon" value="cntSuitcase" />
            <property name="CanPickup" value="true" />
            <property name="DescriptionKey" value="suppliesDesc"/>
            <property class="UpgradeBlock">
                <property name="ToBlock" value="SurvivalSupplies" />
                <property name="Item" value="ProfessionKey" />
                <property name="ItemCount" value="1" />
                <property name="UpgradeHitCount" value="1" />
            </property>
            <property name="Group" value="Basics" />
            <drop event="Destroy" count="0" />
            <property name="DowngradeBlock" value="SurvivalSupplies" />
        </block>
    
    
        <block id="2036" name="SurvivalSupplies">
        <property name="Class" value="Loot" />
        <property name="Material" value="cloth" />
        <property name="StabilitySupport" value="false" />
        <property name="Shape" value="Ext3dModel" />
        <property name="Mesh" value="models" />
        <property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
        <property name="LootList" value="249" />
            <property name="CustomIcon" value="cntSuitcase" />
        <drop event="Destroy" count="0" />
        </block>
    So, what you end up with is the player crafts and places "survialbox". Then they destroy or upgrade it, so it's converted into "survivalsupplies" which they will be able to open and obtain your defined loot.

    Edit: Haidrgna types faster than I do apparently. But heres a code sample for you, may need some tweaking to work with your specific situation.
    Last edited by Kurziel; 11-03-2016 at 06:05 PM.

  4. #4
    Refugee
    Join Date
    Sep 2016
    Posts
    6
    Rep Power
    0
    Ya'll are awesome. That fixed it. I feel like that's something I should have probably known from somewhere but didn't know where to find it. Is there a good central resource for understanding all this stuff or is it all just scattered around the web and in the brains of people like yourselves?

    Thanks again!

  5. #5
    Colony Founder Haidrgna's Avatar
    Join Date
    May 2016
    Location
    The Netherlands
    Posts
    1,117
    Rep Power
    1
    Mainly trial and error my friend. But asking around here is always a good shortcut if you just cannot find what your problem is or if something is possible to do.

  6. #6
    Survivor
    Join Date
    Mar 2016
    Posts
    88
    Rep Power
    0
    This is better:
    Code:
    	<block id="1935" name="My Emergency Package">
    		<property name="Extends" value="cntSuitcase" />
    		<property name="IsDeveloper" value="true" />
    		<property name="CustomIcon" value="cntSuitcase" />
    		<property name="Class" value="PlantGrowing" />
    		<property name="PlantGrowing.FertileLevel" value="0" />
    		<property name="PlantGrowing.Next" value="Emergency Suitcase" />
    		<property name="PlantGrowing.GrowthRate" value="0.01" />
    		<property name="PlantGrowing.IsRandom" value="false" />
    		<property name="PlantGrowing.LightLevelStay" value="0" />
    	</block>
    	<block id="1936" name="Emergency Suitcase">
    		<property name="Extends" value="My Emergency Package" />
    		<property name="Class" value="Loot" />
    		<property name="LootList" value="90" />
    	</block>
    No breaking or other tinkering required.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •