K1NGT1GER609

  • Content Count

    318
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Posts posted by K1NGT1GER609


  1. Looking at the last few messages (cause ill assume the previous page is solved) there's no variable called "WILLOW_WALK_ETC" or "WILLOW_HUNGER_RATE", so it crashes cause the game doesn't know what it is, so replace the sweetie.lua (the character file) with the one posted. There was also some code called function LocoMotor:WalkForward(direct) that's actually in the game and isn't necessary (or even in the right place if you really want to change it but that's advanced coding practice).

    sweetie.lua


  2. @Pinkamena11FazP The characterprefab.fdp is from the last link near the top of the guide (https://forums.kleientertainment.com/files/file/1829-character-custom-voice-tutorial-and-custom-item-sounds/), when you click on it there will be a download option to download the tool box and it'll have the fdp in the sound folder. The crashing on the other hand I don't know what exactly is the problem, your free to post you files/problems for don't starve together: https://forums.kleientertainment.com/forums/forum/79-dont-starve-together-mods-and-tools/ or for don't starve (https://forums.kleientertainment.com/forums/forum/26-dont-starve-mods-and-tools/). I could personally try to fix you mod if its simple but I think you'll get faster help in those forums.

     

     


  3. Its pretty easy just put lines of code in the speech_character.lua in the scripts folder:

    WOLFGANG =
            {
                GENERIC = "It's good to see you, %s!",
                ATTACKER = "Let's not start a fight with the strongman...",
                MURDERER = "Murderer! I can take you!",
                REVIVER = "%s is just a big teddy bear.",
                GHOST = "I told you you couldn't deadlift that boulder. The numbers were all wrong.",
                FIRESTARTER = "You can't actually \"fight\" fire, %s!",
            },

            RAKKY =
            {
                GENERIC = "Your the closest thing to a mechanic, come join our faction.",
                ATTACKER = "Your not welcomed on our territory now get out before we get angry.",
                MURDERER = "Eliminate him before he takes all down!",
                REVIVER = "A mechanic and medic, your welcomed on duty territory.",
                GHOST = "If we revive you can you make us some boomerangs?",

                FIRESTARTER =  %s is burning everything down!",
            },

    this is code from my mods identifying dragon wolf leo's character rakky. So all you have to do is just put the character's name in all caps and write your describes on certain reputations and states of the character.


  4. According to the error it says that a non-action handler is added to the actionhandler table so my only guess is that the lavaspit actionhandler is unknown to the game as its not familar with shipwrecked dlc, where these lua files originated from. My guess is the lavaspit actionhandler (maybe gohome will have problems as snake's home isn't known to dst as well) is unknown to dst so all I can suggest is either remove the lavaspit action handler or remap the event (advanced). The other suggestion is to possibly adapt or run the island adventures mod that seems to import most of shipwrecked data.


  5. think its like this:

    inst.components.inventoryitem.onputininventoryfn = function(inst, player)
        local owner = inst.components.inventoryitem:GetGrandOwner()
        if owner.components.inventory and owner.prefab ~= "star" then
            inst:DoTaskInTime(0.1, function()
            owner.components.inventory:DropItem(inst)
            owner.components.talker:Say("It seems to slip right out of my hands!")
            end)
        end
        end

    meaperroll.lua


  6. I use to implement that code into my mods but I later found out that it would crash the game if you put that item in a chest/chester and/or someone else tried to get it (or something like that). I could help you out with another way of achieving character specific items (and without the crash) but its a little complicated. If not i'd recommend changing the code to

    inst.components.inventoryitem.onputininventoryfn = function(inst, player)
        if not player:HasTag("wisia")  then
        inst:DoTaskInTime(0.1, function()
        player.components.inventory:DropItem(inst)
        player.components.talker:Say("It slips right out of my hands.")
        end)
        end
        end

    while having this in your character lua file:

    local common_postinit = function(inst) --PLEASE READ THIS NOTE, its reference on where it goes
        inst:AddTag("wisia")--add this line of code, its usually implemented on new character templates

    but you'll have that crash you'll encounter later on. Otherwise your call if you want to try the alternative route.


  7. There is a counter a while back that can be written to what you want (and I've used it for one of my mods):

    https://forums.kleientertainment.com/forums/topic/91008-solved-simple-counter/

    otherwise your free to check my mod:

    https://steamcommunity.com/sharedfiles/filedetails/?id=1440494809

    under whaler.lua to see how I adapted the code to count kills but it's messy to say the least (cause he's programmed heavily for upgrades). Its under the deathcount variable and killcount function. It is linked to leveling up mechanic (as its needed to save the count when you load the world) like wx-78 but hopefully you'll be able to see what I did. If you need some explaining on some parts, i'll try to clear it up the best I can.


  8. Its a problem on steam's end a lot of the time, i've heard of different solutions to the problem but I don't know which one solved this issue. One of them I think is launching the game-click play-go to mods- go to server mods (and maybe client as well)- and click the button at the bottom of the window/table that looks like the end of a broom labeled clean all- press ok. From there go back to the mods and let them download. The other solution is go to your steam library and right click don't starve together and click properties. From there go to local files and press verify integrity of game files... and see if that fixes it.


  9. Heh dam I was hoping that I'd get it right without testing it at this point but here this one works like you ate a glowberry (lasts 90 seconds):

    local prefabs = 
    {
    "wormlight_light",
    }

    local function playerlightcaster(inst, target)
        
        if target and not target:HasTag("player") then --players only, who know what happens to mobs?
        return
        end


        if target and target:HasTag("player")  then
    local light = SpawnPrefab("wormlight_light")
        light.components.spell:SetTarget(target)
        if light:IsValid() then
            if light.components.spell.target == nil then
                light:Remove()
            else
                light.components.spell:StartSpell()
            end
        end

        end
        
        local caster = inst.components.inventoryitem.owner or target
        if target == nil then
            target = caster
        end
        

        if caster ~= nil and caster.components.sanity ~= nil then
            caster.components.sanity:DoDelta(-40) --customizable number 
        end
    end

     


  10. The spell caster component is a bit demanding for a lack of better words but for the most part but ill give a example for how it should work:

    local function playerlightcaster(inst, target, lightprefab)
        
        if target and not target:HasTag("player") then --maybe an exception (players only) so you won't crash
        return
        end
        
        local caster = inst.components.inventoryitem.owner or target
        if target == nil then
            target = caster
        end

     -- if eater.wormlight ~= nil then --might be needed as its from wormlight lua
            -- if eater.wormlight.prefab == lightprefab then
                -- eater.wormlight.components.spell.lifetime = 0
                -- eater.wormlight.components.spell:ResumeSpell()
                -- return
            -- else
                -- eater.wormlight.components.spell:OnFinish()
            -- end
        -- end    


        if target and target:HasTag("player")  then
    local light = SpawnPrefab(lightprefab)
        light.components.spell:SetTarget(target)
        if light:IsValid() then
            if light.components.spell.target == nil then
                light:Remove()
            else
                light.components.spell:StartSpell()
            end
        end

        end
        
        if caster ~= nil and caster.components.sanity ~= nil then
            caster.components.sanity:DoDelta(-40)
        end
    end

     

    local function fnab()
        local inst = CreateEntity()
        inst.entity:AddTransform()
        inst.entity:AddAnimState()
        MakeInventoryPhysics(inst)
        inst.entity:AddNetwork()
        
        inst.AnimState:SetBank("pulltwo")
        inst.AnimState:SetBuild("pulltwo")
        inst.AnimState:PlayAnimation("idle")
        
        inst:AddComponent("reticule")
        inst.components.reticule.ease = true
        inst.entity:SetPristine()

        if not TheWorld.ismastersim then
            return inst
        end
        
        inst:AddComponent("inspectable")
            
        inst:AddComponent("inventoryitem")
        inst.components.inventoryitem.atlasname = "images/inventoryimages/pulltwo.xml"
        
        inst.fxcolour = {104/255,40/255,121/255}
        inst:AddComponent("spellcaster")
        inst.components.spellcaster:SetSpellFn(playerlightcaster)
        inst.components.spellcaster.canuseontargets = true
        inst.components.spellcaster.canusefrominventory = false
        inst.components.spellcaster.canonlyuseonlocomotors = true
        
        inst:AddComponent("equippable")
        inst.components.equippable:SetOnEquip( onequip )
        inst.components.equippable:SetOnUnequip( onunequip )
        
        return inst
    end

    whether it works or not it should give a decent idea of how to use the spell caster for a staff.


  11. you could do a periodic task or listen for event for what you want. Periodic task:

    local function giveitaname(inst)
        if inst.components.sanity:IsCrazy()  then
        inst.components.locomotor.walkspeed = 2--half normal speed
        inst.components.locomotor.runspeed = 4

        inst.components.health:DoDelta(-1)
        else 
        inst.components.locomotor.walkspeed = 4--regular speed
        inst.components.locomotor.runspeed = 6
    end
    end

    inst:DoPeriodicTask(5, giveitaname, nil, inst)--master_postinit, check every five seconds

    Listen for event:

    local function giveitaname(inst)
        if inst.components.sanity:IsCrazy()  then
        inst.components.locomotor.walkspeed = 2--half normal speed
        inst.components.locomotor.runspeed = 4

        inst.components.health:DoDelta(-1)
        else 
        inst.components.locomotor.walkspeed = 4--regular speed
        inst.components.locomotor.runspeed = 6
    end
    end

    inst:ListenForEvent("sanitydelta", giveitaname)--master_postinit, check everytime the player's sanity goes up or down

    Both should do the same thing but if for some reason it doesn't work you could replace the if requirement with inst.components.sanity:GetPercent() < 0.2 


  12. So heres a short summary of whats wrong: the ghost zip file is named ghost_esctemplate_build instead of ghost_gwen_build, the gwen lua file has a actionhandler that's suppose to be made for the modmain, and last the cook function you made is missing some stuff that I managed to trace down the source of where it came. If you don't know what I'm talking about exactly check out the modmain and gwen lua files I left and do a comparison on whats missing.

    modmain.lua

    gwen.lua


  13. Here's a recommendation, try putting your entire mod into a zip file instead of loading individual parts of the mod. It makes it a lot more faster to debug an entire mod than to proof read all individual parts and waste time seeing "if this is the source, no this is the source, no it has to do with one of the tex/zip files". Other than that your asking quite a bit in the specialties that's already been done before so ill link and summarize

    sanity near other players:

    https://forums.kleientertainment.com/forums/topic/78648-gain-sanity-near-other-players/

    sanity to other players:

    local function CalcSanityAura(inst)
        return TUNING.SANITYAURA_MED
    end

    inst:AddComponent("sanityaura")
    inst.components.sanityaura.aurafn = CalcSanityAura

    first tech level:

    inst.components.builder.science_bonus = 1

    Typical crafting formula:

    local Ingredient = GLOBAL.Ingredient
    local RECIPETABS = GLOBAL.RECIPETABS
    Recipe = GLOBAL.Recipe
    Ingredient = GLOBAL.Ingredient
    TECH = GLOBAL.TECH
    local TECH = GLOBAL.TECH

    AddRecipe("nightaxe", { Ingredient("goldnugget",4), Ingredient("silk",2), Ingredient("boards",1) }, RECIPETABS.MAGIC, TECH.MAGIC_THREE, nil, nil, nil, nil, nil, "images/inventoryimages/nightaxe.xml")

    emote every 15 seconds? well closes thing to that is this code and the link to forcing an emote:

    local function healowner(inst, data)

    local x,y,z = inst.Transform:GetWorldPosition()
    local contacts = TheSim:FindEntities(x,y,z, 5, nil, {"player"}, nil)
    local target = data and data.target
    target.components.health:DoDelta(1)
    inst.components.health:DoDelta(1)
    end

    inst.task = inst:DoPeriodicTask(15, healowner, nil, inst)

    https://forums.kleientertainment.com/forums/topic/69452-force-client-to-use-an-emote/

     

    Last few notes no durability is pretty easy just don't include durability code in your tools, walking cane is pretty easy to decrypt in this search path: Don't Starve Together\data\databundles\scripts.zip\scripts\prefabs\cane, sanity regen in items: inst.components.equippable.dapperness = TUNING.DAPPERNESS_MED, and cast spell I barely have any experience with so cant help there without devoting time (I have little at this point) to see how to make it work.


  14. Keyhandlers is a long order for what you want so here's a start.

     

    local function onattack_gun(inst, owner, target, data) 

    inst.SoundEmitter:PlaySound("dontstarve/ghost/bloodpump")

    if data.inst == ThePlayer then--make sure its a player

    if data.inst.HUD and (data.inst.HUD:IsChatInputScreenOpen() or data.inst.HUD:IsConsoleScreenOpen()) then return end --make sure not to trigger on chat or console

    if owner and owner.components.inventory and owner.components.inventory:Has("smgammo", 1) and data:IsKeyDown(KEY_R) then --or is it TheInput:IsKeyDown(KEY_R)

    inst.components.weapon:LaunchProjectile(inst, target)

    end

    end

    local function fn(Sim)

     

    if not TheWorld.ismastersim then return inst end --reference

    inst:AddComponent("keyhandler")

    The only main part thats missing is adding a additional component keyhandler by making a folder in: scripts-components-keyhandler.lua.

    other than that this code hasn't been tested and this material is still new to me.

    keyhandler.lua


  15. There were a couple lines of code that were wrong but the main error on why the portrait was missing was that you had to change the rchetype_none.xml element name to rchetype_none_oval.tex like so:

    <Atlas><Texture filename="rchetype_none.tex" /><Elements><Element name="rchetype_none_oval.tex" u1="0.0009765625" u2="0.9580078125" v1="0.30908203125" v2="0.99951171875" /></Elements></Atlas>

    otherwise I attached the zip of the mod fixed up.

    Rchetype.zip