Jump to content

Recommended Posts

Yep, you can either go into the game's files or go to this github link to more easily search for certain files.

However, it seems all the game's hats are put into a singular file, so it's a little trickier. Looking at the custom item template's hat file though, it seems to have everything you need for your helmet.

If you want, I can show you how I make items (Including how I made a bag/armor slot item), and how some components work to make your hat do what you want it to do.

  • Thanks 1
2 hours ago, kyupita said:

Yep, you can either go into the game's files or go to this github link to more easily search for certain files.

However, it seems all the game's hats are put into a singular file, so it's a little trickier. Looking at the custom item template's hat file though, it seems to have everything you need for your helmet.

If you want, I can show you how I make items (Including how I made a bag/armor slot item), and how some components work to make your hat do what you want it to do.

image.png.04568496f3f09df1b3e93e569ee646ba.png

image.png.e8959d2c20aefb93eddfaf109bfb43ec.png


ok....ok...spriter works now it seems there was something i messed up earlyer where the items dit not show up so i redit everything of deleting everything from the anim folder and deleting every single instance of tex and xml file...still not so sure what to do with these zip folders that have the same immages as the other ones where i know to replace art inside...then went into the ++ places to replace every template name instance with either "brohammer" or "brohat" exchept for the string one that one i gave a differend name because i think thats the one name that will actualy show up in the playable area...for the hat i even removed the component of it being under the "DRESS" tab with the "WAR" tab and the whole part of it loosing durability when worn and being repairable with sewing kit i think so, only other thing was give the weapon a differend damage number, durability on use i dit not see that probably been in the armour file that i deleted completly...probably just get a new one and look in body armour template about durability and do the rest of helmet art asets

but thats for tomorrow as i got tired out from this....brain excersise you could say haha...and thank you again for everything you cant immagine how much this means to me

allright then, not much for today, i dit the rest of the helmet art
image.png.36a4095edb14d73524ca33a3d2eae4a8.png

and i think i gave the armour helmet like durability aswell with the weapon one

image.png.897784cc2b4813e461ba2c1d8a2c93b8.png image.png.c0d260bac9e91930150e29f5f5740ca8.png

zip folder still confuses me what to do with it and i wonder if i can just simply put the item folder into the same folder as the character just as it is

Did the zip files come with the template? If so, you can delete those and they'll be remade with the autocompiler. The item's scripts go into the prefabs folder, but if you're talking about the sprites keep them in the exported folder separate from your character's sprites.

  • Thanks 1
14 minutes ago, kyupita said:

Copy and paste the code or screenshot the blueprint.lua file where it shows line 68

modmain
"images/inventoryimages/brohat.xml")

brohammer
inst.components.inventoryitem.atlasname = "images/inventoryimages/brohammer.xml"

brohat
image.png.38b8cb2e98c562bfad311683dc853f37.png 
wait....is it because its an empty space? wow realy? if so i dit not expect nothing be the reason of not workin

removing the line 68 is not changing anything then


image.jpeg.7aade611619ee5306de5f0f3ac677cfc.jpeg

29 minutes ago, kyupita said:

Can you show the whole file?

The empty spaces don't really do anything as they're ignored by the game, they're more so used to make it easier to read code.

sorry its probably something realy stupid and easy the solution but i am not sure maybe i accitendaly deleted something or not noticed something?

mod main
 

PrefabFiles = {
    "brohat",
    "brohammer",
}

-- Load in some assets globally
Assets = {
    Asset("ATLAS", "images/inventoryimages/brohat.xml"),
    Asset("IMAGE", "images/inventoryimages/brohat.tex"),
    
    Asset("ATLAS", "images/inventoryimages/brohammer.xml"),
    Asset("IMAGE", "images/inventoryimages/brohammer.tex"),
}

-- Load our item icon XMLs into the Minimap!
AddMinimapAtlas("images/inventoryimages/brohat.xml")
AddMinimapAtlas("images/inventoryimages/brohammer.xml")

-- Declare global variables
local require = GLOBAL.require
local STRINGS = GLOBAL.STRINGS
local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
local TECH = GLOBAL.TECH 

-- Custom strings!
STRINGS.NAMES.CUSTOM_HAT = "Hammer bro helmet"
STRINGS.RECIPE_DESC.CUSTOM_HAT = "Sadly not ressistance to jumps"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.CUSTOM_HAT = "That's one scientific hat."

STRINGS.NAMES.CUSTOM_HANDITEM = "Hammer bro hammer"
STRINGS.RECIPE_DESC.CUSTOM_HANDITEM = "Throw one throw two throw many!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.CUSTOM_HANDITEM = "That's one scientific item."

-- Custom recipes!
--[[
Default recipetabs:
RECIPETABS.TOOLS
RECIPETABS.LIGHT
RECIPETABS.SURVIVAL
RECIPETABS.FARM
RECIPETABS.SCIENCE
RECIPETABS.WAR
RECIPETABS.TOWN
RECIPETABS.SEAFARING
RECIPETABS.REFINE
RECIPETABS.MAGIC
RECIPETABS.DRESS

Default tech levels (science level you need to craft the item):
TECH.NONE
TECH.SCIENCE_ONE
TECH.SCIENCE_TWO
TECH.SCIENCE_THREE
TECH.MAGIC_TWO
TECH.MAGIC_THREE
]]

AddRecipe("brohat",
{ Ingredient("rope", 1), Ingredient("pigskin", 1) },
RECIPETABS.WAR,
TECH.NONE,
nil,
nil,
nil,
nil,
nil, -- <- Custom character tag would go here if you wanted only that character to craft your item
"images/inventoryimages/brohat.xml")

AddRecipe("brohammer",
{ Ingredient("rocks", 3), Ingredient("twigs", 2)}, Ingredient("rope", 1),
RECIPETABS.WAR,
TECH.NONE,
nil,
nil,
nil,
nil,
nil, -- <- Custom character tag would go here if you wanted only that character to craft your item
"images/inventoryimages/brohammer.xml")

brohammer

local Assets = { 
    -- Animation files for the item (showing it on the ground and swap symbols for the players).
    Asset("ANIM", "anim/brohammer.zip"),
    Asset("ANIM", "anim/brohammer_ground.zip"),

    -- Inventory image and atlas file used for the item.
    Asset("ATLAS", "images/inventoryimages/brohammer.xml"),
    Asset("IMAGE", "images/inventoryimages/brohammer.tex"),
}

local function OnEquip(inst, owner)
    -- This will override symbol "swap_body" of the equipping player with your custom build symbol.
    -- Here's what this function is overriding:
    -- owner.AnimState:OverrideSymbol(Player's_symbol, Your_build(*.zip_filename), Symbol_from_your_build(name_of_subfolder_with_art)
    owner.AnimState:OverrideSymbol("swap_object", "brohammer", "swap_object")
    
    -- Players have 2 left arms - one of them is hidden when we are not holding an item and vice versa.
    -- Since we want to show an item on equip - hide ARM_normal and show ARM_carry.
    owner.AnimState:Show("ARM_carry")
    owner.AnimState:Hide("ARM_normal")
end

local function OnUnequip(inst, owner) 
    owner.AnimState:Hide("ARM_carry") 
    owner.AnimState:Show("ARM_normal") 
end

local function MainFunction()
    -- Functions which are performed both on Client and Server start here.
    local inst = CreateEntity()
    
    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddNetwork()
    inst.entity:AddSoundEmitter()
    
    MakeInventoryPhysics(inst)
    
    -- Add minimap icon. Remember about its XML in modmain.lua!
    local minimap = inst.entity:AddMiniMapEntity()
    minimap:SetIcon("brohammer.tex")
    
    --[[ ANIMSTATE ]]--
    -- This is the name visible on the top of hierarchy in Spriter.
    inst.AnimState:SetBank("brohammer_ground")
    -- This is the name of your compiled*.zip file.
    inst.AnimState:SetBuild("brohammer_ground")
    -- This is the animation name while item is on the ground.
    inst.AnimState:PlayAnimation("anim")

    --[[ TAGS ]]--
    inst:AddTag("brohammer")

    MakeInventoryFloatable(inst, "small", 0.05, {1.2, 0.75, 1.2})

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        -- If we're not the host - stop performing further functions.
        -- Only server functions below.
        return inst
    end

    inst:AddComponent("inspectable")

    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.imagename = "brohammer"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/brohammer.xml"
    
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip(OnEquip)
    inst.components.equippable:SetOnUnequip(OnUnequip)

    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(40)
    inst.components.armor:InitCondition(250)

    MakeHauntableLaunch(inst)

    return inst
end

return  Prefab("common/inventory/brohammer", MainFunction, Assets)



brohat
 

local Assets = {
    Asset("ANIM", "anim/brohat.zip"),
    
    Asset("ATLAS", "images/inventoryimages/brohat.xml"),
    Asset("IMAGE", "images/inventoryimages/brohat.tex"),
}

local function OnEquip(inst, owner)
    -- This will override symbol "swap_body" of the equipping player with your custom build symbol.
    -- Here's what this function is overriding:
    -- owner.AnimState:OverrideSymbol(Player's_symbol, Your_build(*.zip_filename), Symbol_from_your_build(name_of_subfolder_with_art)
    owner.AnimState:OverrideSymbol("swap_hat", "brohat", "swap_hat")
    
    -- Show/Hide some of the layers of the character while equipping the hat.
    owner.AnimState:Show("HAT")
    owner.AnimState:Show("HAIR_HAT")
    owner.AnimState:Hide("HAIR_NOHAT")
    owner.AnimState:Hide("HAIR")
    
    -- If the equipping guy is the player, do some additional stuff.
    if owner:HasTag("player") then
        owner.AnimState:Hide("HEAD")
        owner.AnimState:Show("HEAD_HAT")
    end
    
    -- If we should lose usage percent over time while wearing the hat - start dropping the percentage when we're equipping the hat.
    if inst.components.fueled ~= nil then
        inst.components.fueled:StartConsuming()
    end
end

local function OnUnequip(inst, owner) 
    -- Clear the hat symbol from wearer's head.
    owner.AnimState:ClearOverrideSymbol("swap_hat")
    
    -- Show/Hide some of the layers of the character while unequipping the hat.
    owner.AnimState:Hide("HAT")
    owner.AnimState:Hide("HAIR_HAT")
    owner.AnimState:Show("HAIR_NOHAT")
    owner.AnimState:Show("HAIR")

    -- If the unequipping guy is the player, do some additional stuff.
    if owner:HasTag("player") then
        owner.AnimState:Show("HEAD")
        owner.AnimState:Hide("HEAD_HAT")
    end
    
    -- Stop consuming usage percent if the hat is not equipped.
    if inst.components.fueled ~= nil then
        inst.components.fueled:StopConsuming()
    end
end

local function MainFunction()
    -- Functions which are performed both on Client and Server start here.
    local inst = CreateEntity()
    
    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddNetwork()
    inst.entity:AddSoundEmitter()

    MakeInventoryPhysics(inst)

    -- Add minimap icon. Remember about its XML in modmain.lua!
    local minimap = inst.entity:AddMiniMapEntity()
    minimap:SetIcon("brohat.tex")
    --[[ ANIMSTATE ]]--
    -- This is the name visible on the top of hierarchy in Spriter.
    inst.AnimState:SetBank("brohat")
    -- This is the name of your compiled*.zip file.
    inst.AnimState:SetBuild("brohat")
    -- This is the animation name while item is on the ground.
    inst.AnimState:PlayAnimation("anim")

    --[[ TAGS ]]--
    inst:AddTag("brohat")
    -- Waterproofer (from waterproofer component) - this tag can be removed, but it's here just in case, to make the game run better.
    inst:AddTag("waterproofer")
    
    MakeInventoryFloatable(inst, "small", 0.1, 1.12)
    
    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        -- If we're not the host - stop performing further functions.
        -- Only server functions below.
        return inst
    end
    
    inst:AddComponent("inspectable")

    -- Allow "trading" the hat - used for giving the hat to Pigmen.
    inst:AddComponent("tradable")

    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.imagename = "brohat"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/brohat.xml"
    
    inst:AddComponent("equippable")
    inst.components.equippable.equipslot = EQUIPSLOTS.HEAD
    inst.components.equippable:SetOnEquip(OnEquip)
    inst.components.equippable:SetOnUnequip(OnUnequip)

inst:AddComponent("armor")
    -- Durability = 320, resistance to damage = 80%
    inst.components.armor:InitCondition(320, 0.8)    

    inst:AddComponent("waterproofer")
    -- Our hat shall grant 20% water resistance to the wearer!
    inst.components.waterproofer:SetEffectiveness(0.2)

    MakeHauntableLaunch(inst)

    return inst
end

return  Prefab("common/inventory/brohat", MainFunction, Assets)

blueprint lua? i dont see any blueprints

actualy....these taps are kind of out dated or not? could it be something regarding this? being in tab "WAR" despite it maybe have been changes all these tabs?

image.png.d8397fca095274594b13cc7002d5e7d5.png

wait...could not that it the wilson folders that are inside can it?

image.png.975ff66bbb66d9b36c1729bae588625d.png

progress, a friend helped with makin the items work, so now i put them into the same folder and copy paste the mod main of the items into the same mod main of the character
and some other crashing shehanigans happens and so on where it dont even show me text


and then i worked around with it a bit and then i am not sure what to do anymore what they mean they could not load it? its in the files and all or not?
image.png.d21028067c80ccf003286d4fc587d632.png

Sorry, I was really busy today. Are you able to show a crash log? (In case you don't know where they're located, it's "Documents/Klei/DoNotStarveTogether" and then send the client_log.txt)

From the most recent screenshot you sent, I can only guess a file/asset is missing or can't be found by the game due to an error or something.

  • Like 1
54 minutes ago, kyupita said:

Sorry, I was really busy today. Are you able to show a crash log? (In case you don't know where they're located, it's "Documents/Klei/DoNotStarveTogether" and then send the client_log.txt)

From the most recent screenshot you sent, I can only guess a file/asset is missing or can't be found by the game due to an error or something.

dont worry you have your own life to look after too but heres the files for now

server_log.txt

the current state right now is: i can activate the mod, but somehow the character is not shown

Bild

Bild

and if i click on go i get locked into a white screen that i have to ALTF4 to get out off

wait big update


hammer bro.zip


its...starting to work together now, the forward look with helm is good....the back one is ok...the side one...i dit try to change but nothing works trying to change the immages like its not even generating new anim files and all that anymore but at least its there.......what i do wish how ever...scroll down to see

image.jpeg.b3a6ef0a4c8324c8d5ccb739a7b5f018.jpegimage.jpeg.e32adc0c1c1d3b57f4359fc7a1c05787.jpegimage.jpeg.42b85944c1a505dc2efeedc37b367845.jpegimage.jpeg.8901c18532f4e4bf2607c9d3d7016c7a.jpeg



SCROLL HERE

and you can see that...you cant see the items be on the ground anymore wich uhm...where i hold the grass they would be there but....well i dont understand why its not there i litteraly have all the png files and all made and replaced and all that stuff so i am not sure what i missed

image.jpeg.8a2442fddf22e89781d7d79a250123c0.jpeg



then another thing but that seems to crash is trying to make it so only this character can make the items by just adding the word "hammerbro" like the prefab name in this location

image.png.7593354f92504a515cdce9a39afdb70f.png directly after the blue text and the ,  but i guess i need to add a custom line of code there somewhere

hammer bro.zip

Should be fixed now. They weren't showing up on the ground since they still had the template's name in the scml file and weren't renamed (the bottom right area where it lists animation layers), and I found out the "blueprint.lua" error was because AddRecipe isn't used anymore, so I replaced the recipe code in your modmain to AddCharacterRecipe.

hammer bro.zip

  • Thanks 1
5 hours ago, kyupita said:

Should be fixed now. They weren't showing up on the ground since they still had the template's name in the scml file and weren't renamed (the bottom right area where it lists animation layers), and I found out the "blueprint.lua" error was because AddRecipe isn't used anymore, so I replaced the recipe code in your modmain to AddCharacterRecipe.

hammer bro.zip 6.95 MB · 0 downloads

thank you!!!!

there on the ground now, noticed you alsol gave the crafting items the builder tag so only he can build it

  image.png.70001411e8af875a947276194171a750.png


but the character got no builder tag so cant make it

image.jpeg.c485a513399c6f221458b62da6db899b.jpeg


so i added in this line here thinkin it would work

image.png.871a8a5f687e4da0a5a852ad94579510.png

exchept it seems there was some error in this...i feel like i had the right idea but maybe the words are differend or placed differendly

image.jpeg.aee8a5e76ef38ad0af432216a70a8416.jpeg

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...