• Announcements

    • JoeW

      Support Email Error (Zendesk)   08/12/2019

      We are migrating to a new customer support ticketing system (desk.com) and unfortunately while moving over our old tickets the new system (Zendesk) sent an auto reply to "new users". We weren't aware this would happen and so and email was sent out in error. You do not need to create an account and you can ignore the email entirely. You can find more info about this over on our forums here: https://forums.kleientertainment.com/forums/topic/110413-zendesk/ Sorry for the confusion

Blueberrys

  • Content count

    737
  • Joined

  • Last visited

Community Reputation

172 Excellent

4 Followers

About Blueberrys

  • Rank
    Senior Member

Recent Profile Visitors

3,250 profile views
  1. Tree Drops

  2. Stack Repeater

    @Deilan I don't currently have the time for it, but I'll keep that in mind if I get back to DS modding. Thanks for the feedback!
  3. Help with simple coding?

    @SquareRoot In a place where the inst variable refers to your player instance. Usually, that's in your player file, inside the "fn" function.
  4. Help with simple coding?

    @SquareRoot inst:ListenForEvent("oneat", function(inst, data) -- When you eat something if data.food.components.edible.foodtype == "VEGGIE" then -- If it's a veggie inst.components.sanity:DoDelta(-10) -- Decrease sanity endend)
  5. You can't just cut out parts of the code to optimise space xD It has to make sense too. I see. First of all, fix the if statement. Either write them all out correctly, or use one of the shorter methods I suggested. The builditem event is still being used in DST through the builder component. The armor component still has a operational SetPercent function. I think the issue may be related to the networking aspect. Perhaps the code isn't executing because it's not running on the host. I suggest you post on the DST mod forums. Include your full code, logs, etc.
  6. You mean prefab name? Not sure what you're looking for, but that if statement won't work how you think. if data.item.prefab == "armorwood" or "armormarble" ...Means "if the name is 'armorwood', OR if 'armormarble exists..." Should be: if data.item.prefab == "armorwood" or data.item.prefab == "armormarble" ...- Alternately: if data.item.prefab:sub(1, 5) == "armor" ...for everything starting with "armor" Edit: More code. -- ending in hatif data.item.prefab:sub(-3) == "hat" ...-- containing armorif data.item.prefab:find("armor", 1, true) ...-- containing hatif data.item.prefab:find("hat", 1, true) ...
  7. @jimmosio See Mobbstar's solution above. Also.. where is armor_inst coming from? Are you doing something like "armor_inst = data.item"? If what you provided here is all you have in your event function, it should probably crash with "attempt to index armor_inst a nil value". Considering that isn't happening, there may be another issue. Testing the event myself to confirm. Edit: data.item contains the prefab name, not the instance of the item. armor_inst still needs to come from somewhere though. Edit 2: Nope, actually it is the instance. You would need to use data.item.prefab to check if you've got the right item. Testing to confirm. Edit 3: Works. inst:ListenForEvent("builditem", function(inst, data) if (data.item.prefab == "armorwood") then data.item.components.armor:SetPercent(1.35) endend)