Zer000

  • Content Count

    31
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Posts posted by Zer000


  1. Greetings, everyone. Would like to have some assistance, please. I have a little problem: i cant use my item, (its supposed to spawn lightning at target location)on target(inst.components.spellcaster.canuseontargets = true), character says: i can't do this.

    I can cast spell at point(inst.components.spellcaster.canuseonpoint = true) but then spell doesn't work properly: lightning always hits only caster.

    My code is following: 

    local function lSpell(target, pos)
                               TheWorld:PushEvent("ms_sendlightningstrike", target:GetPosition())
                        end

     

    I tried alternative way:

    Spoiler

     

          local ents = TheSim:FindEntities(pos.x, pos.y, pos.z, 10, {"freezable"}, {"player"})
        for k, v in pairs(ents) do
            lightningSpell(inst, v)

    local function lightningSpell(inst, target)

    --local x, y, z = target:GetPosition()
                    local attacker = inst.components.inventoryitem.owner
                                            attacker.AnimState:PlayAnimation("atk_pre")
                attacker.AnimState:PushAnimation("atk", false)
                attacker.SoundEmitter:PlaySound("dontstarve/wilson/attack_whoosh")
        inst:DoTaskInTime(0.2, function() 
            attacker.components.sanity:DoDelta(-TUNING.SANITY_LARGE * 0.9 )
                                            attacker.AnimState:PlayAnimation("atk_pre")
                attacker.AnimState:PushAnimation("atk", false)
                attacker.SoundEmitter:PlaySound("dontstarve/wilson/attack_whoosh")
                        local max_tries = 4
                        for k = 1,max_tries do
                        local player2 = FindClosestPlayerToInst(inst, 10, true)
                            local pos = player2:GetPosition()
                                TheWorld:PushEvent("ms_sendlightningstrike", pos)
                        end
                                if target.prefab == "dragonfly" then
            target.components.health:DoDelta(-70)
        end
                end)

    end

     

    but then lightning hits every target in range. Any ideas how to make it work?


  2. Greetings everyone.So i have one question.Is it possible to create a code that won't allow some(or even any)broken tool or dressing to be used in craft as ingredient?(For example: a broken pickaxe can be used to make a thermal stone.)I created a weapon that requires tentacle spike in craft and i want to be sure that nobody will use broken spike to make this.
    I really tried a lot but didn't succeed.


  3. I can't figure out how to make a special sanity regen bonus only for cpecific character?For example, i wear bearger vest and gain +10 sanity/minute.
    I tried this, but it doesnt seem to work:
     

    Spoiler

    AddPrefabPostInit("beargervest", function(inst)
    local function onequip(inst, owner) 
        owner.AnimState:OverrideSymbol("swap_body", "torso_bearger", "swap_body")
        if owner.components.hunger then
            owner.components.hunger.burnrate = TUNING.ARMORBEARGER_SLOW_HUNGER
        end
        inst.components.fueled:StartConsuming()
            if owner:HasTag("nikmikwrithe") then
        inst.components.equippable.dapperness = TUNING.DAPPERNESS_HUGE * 3.5
        --owner.components.sanity.dapperness = TUNING.DAPPERNESS_HUGE * 2.5
    end
    end

        --inst.components.equippable:SetOnEquip( onequip )
    end)

     


  4. 24 minutes ago, Augustusc said:

    As for the second bit, should i replace the uses part with yours?

    No, this is just a way to configure uses..But it looks like you know how to change them already.Maybe you only need to add   inst.components.finiteuses:SetConsumption(ACTIONS.SLEEPIN, 1)

    As for sleeping function, you can check bedroll lua and add lines to your prefab_name.lua
    Just add lines about sleeping after assets

    Starting with local function wakeuptest(inst, phase)
    Ending with local function onuse_straw(inst, sleeper)
        sleeper.AnimState:OverrideSymbol("swap_bedroll", "swap_bedroll_straw", "bedroll_straw")
    end

    And don't forget to add

        inst:AddComponent("sleepingbag")
        inst.components.sleepingbag.onsleep = onsleep
        inst.components.sleepingbag.onwake = onwake

    after 

        inst.entity:SetPristine()

        if not TheWorld.ismastersim then
            return inst
        end

    Spoiler

    I don't really sure if it will help, but it should do something you want

     


  5.   local function onattack(inst)
        if inst ~= nil and inst.fire ~= nil and inst:IsValid() and inst.fire:IsValid() then
            local x, y, z = inst.fire.Transform:GetWorldPosition()
            SpawnPrefab("sparks").Transform:SetPosition(x, y - .5, z)
        end
    end

        inst:AddComponent("weapon")
        inst.components.weapon:SetDamage(666)
        inst.components.weapon:SetOnAttack(onattack)
        inst.components.weapon:SetElectric()

    It will probably work like  Morning Star

    Or you can use caster component actually


  6. I think in local function onsleeptick(inst, sleeper) you should remove

        if sleeper.components.hunger ~= nil then
            sleeper.components.hunger:DoDelta(TUNING.SLEEP_HUNGER_PER_TICK, true, true)
            isstarving = sleeper.components.hunger:IsStarving()
        end


    As for uses:

        inst:AddComponent("finiteuses")
        inst.components.finiteuses:SetConsumption(ACTIONS.SLEEPIN, 1)
        inst.components.finiteuses:SetMaxUses(20)
        inst.components.finiteuses:SetUses(20)

     


  7. On 28.08.2016 at 9:28 PM, Maris said:

    Thanks a lot! I think i did it! :)

    I made a lib for including in any mod. It's compatible to itself so the mods with the lib will be compatible to each other. :D

    How to use:

    
    modimport "custom_tech_tree.lua"
    AddNewTechTree("NEWTREE",2) --makes TECH.NEWTREE_ONE and TECH.NEWTREE_TWO

    http://pastebin.com/QjrbSzKE

    There was an error (crash on class.lua line 24), so I did it the other way. I'm not sure if it's really possible to make a proxy on tables in a component. Anyway thanks! I used your comment as a TODO list.

    Thx, everything works perfect)


  8. I'm still porting character in DST, and it's almost complete.Still, i have troubles with animations of custom items.Recently, they just didn't have their custom animations, but now arm and weapon dissapears on attack and appears again, when attack is finished.
    just like here, but that method didn't help me at all..

    So, i'll be very glad to read your suggestions.I could send you zip with character, if you were interested a bit.


  9. Greetings,
    I have a set of tools for custom character in  DS:RoG, but after transition in DS:Together they just stopped working at all, and character chops/mines with default animation(and if i had picked any tool before mine, like torch, etc. image remains in my hand).But it looks like i didn't miss something.Maybe i shoud add some extra lines in prefab or smthg?Or i'll just attach mod here to check what i did wrong.
    Also i have some problems with recipes, they work a bit incorrect.I've read about adding recipes alredy, but still no luck.
    Thanks
     

    Char.zip


  10. 9 minutes ago, Joachim said:

    I think the most important thing is to credit the original author and provide a link to the original mod. Be honest that you are merely porting it. Then things should be OK. If the author for some reason comes back and wants to do this themselves, you can always delete the mod afterwards.

    Yep, ofc i won't lie to anyone about ownership

    Also, i did some balance change, to make him more effective, but not too op
    Will attach changelog then..


  11. I don't know, if someone needs it today, but some time ago people asked to make mod

    Spoiler

     

    for DS:Together .As i like this char very much, i did it. Still some abilities work not so properly..(i'm working on it)
    So i dunno if i can actually upload him.

    Spoiler

    I cannot contact mod owner at all, and he is not going to port mod by himself in the nearest time.

     


  12. 22 hours ago, BlueSideWind said:

    while using your editing program or (lets just say photoshop) did you make sure to delete everything but the hair? Sometime when you try to delete the white background you miss some spots and it shows up on the character once you launch it in because in don't starve there is no such thing as a "transparant" image.

    Yep, i did everything well..Maybe it's something with Tex tool, because Ktech works fine, as it was mentioned before

    Anyway than you all for your replies :wilson_wink: