Jump to content

Search the Community

Showing results for tags 'coding help'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hot Lava
    • [Hot Lava] - General Discussion
    • [Hot Lava] - Suggestions and Feedback
    • [Hot Lava] - Bug Tracker
    • [Hot Lava] - Strats and Records
    • [Hot Lava] - Developer Log
    • Hot Lava Latest Update
  • Griftlands
    • [Griftlands] - General Discussion
    • [Griftlands] - Suggestions and Feedback
    • [Griftlands] - Mods and Tools
    • [Griftlands] - Localization
    • [Griftlands] - Bug Tracker
    • [Griftlands] - Developer log
  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included: Spaced Out!] - Bug Tracker
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
    • Oxygen Not Included DLC Alpha
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] Beta Branch
    • [Don't Starve Together] PlayStation
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Nintendo Switch
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [DS + DST] Art, Music and Lore
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Don't Starve
    • Don't Starve FAQ
    • [Don't Starve: Pocket Edition] iOS / Android
    • [Don't Starve] General Discussion
    • [Don't Starve] Mods and tools
    • [Don't Starve] Art, Music & Lore
    • [Don't Starve] Suggestions and Feedback
    • [Don't Starve] Videos
    • [Don't Starve] Bug Tracker
    • [Don't Starve] Trading
    • [Don't Starve] Testing Discussion (archive)
  • Klei Entertainment Games
    • Eets Munchies
    • [Invisible, Inc.] General Discussion and Strategies
    • Mark of the Ninja
    • Shank
  • Other Stuff
    • Other Klei Services

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out!
  • Griftlands
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: Beta Branch
  • [Don't Starve Together] Nintendo Switch
  • [Don't Starve Together] PlayStation
  • Don't Starve Together: Return of Them
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out!
  • Griftlands
  • Hot Lava
  • Don't Starve Together
  • [Nintendo Switch] Don't Starve Together
  • [PlayStation] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Hamlet
  • Don't Starve: Shipwrecked

Categories

  • Hot Lava - Bug Reports

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Biography


Location


Interests


Occupation


Favorite Game


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together


Oxygen Not Included

Found 10 results

  1. As the title says, I'm struggling finding a way to add entities (or objects? Mobs? That's how you know how little I know about working with these things.) to the game for my custom character. I already tried looking into the prefab files for some of the items that are similar to what I want to add, but trying to understand those just left me with more questions than answers. I know essentially nothing about working in Lua and truth be told I'm not that interested in learning Lua as much as I'm interested in learning how to work with Don't Starve Together as well as the original Don't Starve (though DST is my priority right now). One thing I'm trying to add is something I presume is a lot more simple; Adding a Chess Piece. I want the statue to be unique to this character, though as far as I'm aware that can be done by simply adding a recipe for it to the game tagged similarly to how any other character unique item would be so I'm not too worried about that part. Would adding a unique Chess Piece require somehow adding to the chesspieces.lua prefab, similar to how one can add strings of dialogue to a character's speech lua file from the modmain.lua? Even then, how could I make that added Chess Piece load custom sprites? If they aren't just the one image unlike trees, how do I even find how to put these sprites together? This next thing I want to add is more complex; a plant that can grow into various states of "bushiness", similar to how trees can grow taller. I don't want it to have a seed or be something that spawn naturally, I want it to be another thing that can only be crafted by the one character. I'm hoping I can give it animations much like how a bush goes from unfertilized to normal, and from there have it grow into various states of bushiness (no leaves, a bit bushy, then very bushy). This is the worst part, I want this bush to be something that can be targeted and attacked by mobs, with its bushiness determining how many hits it can take. I don't know if that means this bush would have to be a mob or if being something attack-able can be changed with a few lines of code or what. Maybe its bushiness is determined by its health, and it gains health overtime? I also want this to be something that can be shaved like beefalo, with the bushiness of this plant determining how much loot it drops. Maybe shaving sets its health to 1, so it starts growing all over again like how a sapling or a berry bush would after being picked. I know this post mostly seems like just me asking for someone to code these things for me and if I'm being honest that is essentially what it is but what I really want is some kind of direction for these, a way to know how these parts of the games work and how I can work with them. I don't just want the code that makes it happen, but I want to know how it works and why it works the way it does so I can hopefully figure out these sorts of things myself soon in the future and not resort to asking about them here. Maybe these are all insanely obvious and I'm just too stupid to figure it out, I don't know, but I would like to find out what it is I need to learn to make these happen for myself. Thank you for reading. If you want to message me directly about this, my Discord tag is Jonloo1#7228. I hope I can find the help I need here.
  2. I have trouble. My mod: https://steamcommunity.com/sharedfiles/filedetails/?id=2583221769 My mod changes the nubmer of slots for backpack and boxes. A bug appeared, when I change the slots of the backpack, then regardless of other backpacks, icepack changes the slots too. I create checker in console, my code change only backpack prefab, but slots icepack change too. Even if I assign my number of slots to it, it still changes the slots to the number of backpack slots. Other backpacks are not affected by this bug. My code: MODINFO: MODMAIN:
  3. Good day everyone. How to write correctly so that the value changes inside the "tuning" script? My code doesn't change the value inside this script. EXAMPLE: local MyTable = { {"tent", TUNING.TENT_USES, MyCustomTent}, {"siesta", TUNING.SIESTA_CANOPY_USES, MyCustomSiesta}, .......................................................................... } for i = 1, #MyTable, 1 do MyTable[i][2] = MyTable[i][3] end
  4. Please help! Any containers normal works! The problem appearsafter adding spicepack, if select 8, 10, 12 slots, after creating prefab spicepack crashed: [00:02:13]: [string "scripts/components/container.lua"]:104: assertion failed! LUA ERROR stack traceback: =[C]:-1 in (global) assert (C) <-1--1> scripts/components/container.lua:104 in (method) SetNumSlots (Lua) <103-106> ../mods/Configurate Storage(TEST)/modmain.lua:153 in (field) widgetsetup (Lua) <39-175> scripts/components/container.lua:69 in (method) WidgetSetup (Lua) <64-75> scripts/prefabs/spicepack.lua:93 in (field) fn (Lua) <53-107> scripts/mainfunctions.lua:300 in () ? (Lua) <289-331> =[C]:-1 in (method) SpawnPrefab (C) <-1--1> scripts/mainfunctions.lua:348 in (global) SpawnPrefab (Lua) <342-350> scripts/components/builder.lua:461 in () ? (Lua) <412-558> =(tail call):-1 in () (tail) <-1--1> scripts/bufferedaction.lua:25 in (method) Do (Lua) <21-35> scripts/entityscript.lua:1369 in (method) PerformBufferedAction (Lua) <1356-1379> scripts/stategraphs/SGwilson.lua:5313 in (field) ontimeout (Lua) <5306-5314> scripts/stategraph.lua:554 in (method) UpdateState (Lua) <540-584> scripts/stategraph.lua:611 in (method) Update (Lua) <603-631> scripts/stategraph.lua:128 in (method) Update (Lua) <109-153> scripts/update.lua:239 in () ? (Lua) <170-249> My script: Assets = { Asset("ATLAS", "images/container.xml"), Asset("ATLAS", "images/container_x20.xml"), Asset("ATLAS", "images/krampus_sack_bg.xml"), } --Make Global local require = GLOBAL.require local Vector3 = GLOBAL.Vector3 local net_entity = GLOBAL.net_entity --Require local containers = require("containers") --LOAD VALUE IN MODINFO containers.MAXITEMSLOTS = math.max(containers.MAXITEMSLOTS, 24) --Type Backpack local BackpackSlotMax = GetModConfigData("BackpackSlotMax") local PiggybackSlotMax = GetModConfigData("PiggybackSlotMax") local KrampussackSlotMax = GetModConfigData("KrampussackSlotMax") local IcepackSlotMax = GetModConfigData("IcepackSlotMax") --local SpicepackSlotMax = GetModConfigData("SpicepackSlotMax") --Type Chest local ChestSlotMax = GetModConfigData("ChestSlotMax") local IceboxSlotMax = GetModConfigData("IceboxSlotMax") local SaltboxSlotMax = GetModConfigData("SaltboxSlotMax") local DragonflychestSlotMax = GetModConfigData("DragonflychestSlotMax") local function addItemSlotNetvarsInContainer(inst) if(#inst._itemspool < containers.MAXITEMSLOTS) then for i = #inst._itemspool+1, containers.MAXITEMSLOTS do table.insert(inst._itemspool, net_entity(inst.GUID, "container._items["..tostring(i).."]", "items["..tostring(i).."]dirty")) end end end AddPrefabPostInit("container_classified", addItemSlotNetvarsInContainer) --Change size of Backpacks, Chests, Bundles, and Chester local widgetsetup_Base = containers.widgetsetup or function() return true end function containers.widgetsetup(container, prefab, data, ...) local tempPrefab = prefab or container.inst.prefab local result = widgetsetup_Base(container, prefab, data, ...) function NewCustomContainers(Type, SlotMax) if Type == "Backpack" then if SlotMax == 10 then container.widget.animbank = "ui_krampusbag_2x5" container.widget.animbuild = "ui_krampusbag_2x5" container.widget.pos = Vector3(-5, -70, 0) for y = 0, 4 do table.insert(container.widget.slotpos, Vector3(-162, -75 * y + 115, 0)) table.insert(container.widget.slotpos, Vector3(-162 + 75, -75 * y + 115, 0)) end elseif SlotMax == 12 then container.widget.animbank = "ui_piggyback_2x6" container.widget.animbuild = "ui_piggyback_2x6" container.widget.pos = Vector3(-5, -50, 0) for y = 0, 5 do table.insert(container.widget.slotpos, Vector3(-162, -75 * y + 170, 0)) table.insert(container.widget.slotpos, Vector3(-162 + 75, -75 * y + 170, 0)) end elseif SlotMax == 14 then container.widget.animbank = "ui_krampusbag_2x8" container.widget.animbuild = "ui_krampusbag_2x8" container.widget.pos = Vector3(-5, -120, 0) for y = 0, 6 do table.insert(container.widget.slotpos, Vector3(-162, -y*75 + 240 ,0)) table.insert(container.widget.slotpos, Vector3(-162 +75, -y*75 + 240 ,0)) end elseif SlotMax == 16 then container.widget.animbank = "ui_krampusbag_2x8" container.widget.animbuild = "ui_krampusbag_2x8" container.widget.pos = Vector3(-5, -50, 0) for y = 0, 7 do table.insert(container.widget.slotpos, Vector3(-162, -65 * y + 245, 0)) table.insert(container.widget.slotpos, Vector3(-162 + 75, -65 * y + 245, 0)) end elseif SlotMax == 18 then container.widget.animbank = nil container.widget.animbuild = nil container.widget.bgatlas = "images/krampus_sack_bg.xml" container.widget.bgimage = "krampus_sack_bg.tex" container.widget.pos = Vector3(-76,-70,0) for y = 0, 8 do table.insert(container.widget.slotpos, Vector3(-37, -y*75 + 300 ,0)) table.insert(container.widget.slotpos, Vector3(-37 +75, -y*75 + 300 ,0)) end end elseif Type == "Chest" then if SlotMax == 12 then container.widget.animbank = "ui_chester_shadow_3x4" container.widget.animbuild = "ui_chester_shadow_3x4" for y = 2.5, -0.5, -1 do for x = 0, 2 do table.insert(container.widget.slotpos, Vector3(75 * x - 75 * 2 + 75, 75 * y - 75 * 2 + 75, 0)) end end elseif SlotMax == 16 then container.widget.animbank = nil container.widget.animbuild = nil container.widget.bgatlas = "images/container.xml" container.widget.bgimage = "container.tex" container.widget.bgimagetint = {r=.82,g=.77,b=.7,a=1} for y = 3, 0, -1 do for x = 0, 3 do table.insert(container.widget.slotpos, Vector3(80*x-80*2+40, 80*y-80*2+40,0)) end end elseif SlotMax == 20 then container.widget.animbank = nil container.widget.animbuild = nil container.widget.bgatlas = "images/container_x20.xml" container.widget.bgimage = "container_x20.tex" container.widget.bgimagetint = {r=.82,g=.77,b=.7,a=1} for y = 3, 0, -1 do for x = 0, 4 do table.insert(container.widget.slotpos, Vector3(75*x-75*2+0, 75*y-75*2+40,0)) end end elseif SlotMax == 24 then container.widget.animbank = nil container.widget.animbuild = nil container.widget.bgatlas = "images/container_x20.xml" container.widget.bgimage = "container_x20.tex" container.widget.bgimagetint = {r=.82,g=.77,b=.7,a=1} for y = 3, 0, -1 do for x = 0, 5 do table.insert(container.widget.slotpos, Vector3(65*x-65*2-33, 80*y-80*2+38,0)) end end end end end --Type Backpack --Back Pack if(tempPrefab == "backpack" and BackpackSlotMax ~= 8) then container.widget.slotpos = {} NewCustomContainers("Backpack", BackpackSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif (tempPrefab == "piggyback" and PiggybackSlotMax ~= 12) then container.widget.slotpos = {} NewCustomContainers("Backpack", PiggybackSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif (tempPrefab == "krampus_sack" and KrampussackSlotMax ~= 14) then container.widget.slotpos = {} NewCustomContainers("Backpack", KrampussackSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif (tempPrefab == "icepack" and IcepackSlotMax ~= 8) then container.widget.slotpos = {} NewCustomContainers("Backpack", IcepackSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif (tempPrefab == "spicepack" and SpicepackSlotMax ~= 6) then container.widget.slotpos = {} NewCustomContainers("Backpack", SpicepackSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) --Type Chest --Chest elseif(tempPrefab == "treasurechest" and ChestSlotMax ~= 9) then container.widget.slotpos = {} NewCustomContainers("Chest", ChestSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif(tempPrefab == "icebox" and IceboxSlotMax ~= 9) then container.widget.slotpos = {} NewCustomContainers("Chest", IceboxSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif(tempPrefab == "saltbox" and SaltboxSlotMax ~= 9) then container.widget.slotpos = {} NewCustomContainers("Chest", SaltboxSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) elseif(tempPrefab == "dragonflychest" and DragonflychestSlotMax ~= 12) then container.widget.slotpos = {} NewCustomContainers("Chest", DragonflychestSlotMax) container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) end return result end
  5. Hopefully the title makes sense. What I'm trying to do with my mod character is make it so he breaks tools faster but he chops trees, mines rocks etc. faster as well because he is very strong and easily breaks man-made and organic materials. I took code from Wigfrid's durability Battlesong and tried to modify it to make it so that tools broke faster but trees fell and rocks broke with like half the uses, however I am getting crashes, the most recent crash being this: Now I understand that the "weapon" component isn't going to work, but I don't know what to change to make it work. The most recent crash happens when I unequip a tool, oddly. Plus I am not even getting the effect I want. Here is the code I currently have as well as my character's .lua file attached. local GARAMONDE_DURABILITY_MOD = 0.8 inst:ListenForEvent("equip", function(data) if data.eslot == EQUIPSLOTS.HANDS then inst.components.weapon.attackwearmultipliers:SetModifier(inst, TUNING.GARAMONDE_DURABILITY_MOD) end end) inst:ListenForEvent("unequip", function(target, data) if data.eslot == EQUIPSLOTS.HANDS then inst.components.weapon.attackwearmultipliers:RemoveModifier(inst, TUNING.GARAMONDE_DURABILITY_MOD) end end) Thanks in advance! garamonde.lua
  6. hello, i would like some help with coding a character for a friend i need help coding in sanity gain around other players and custom players/characters without crashing the game as well as giving people sanity a little wen they are near them as well, i have attempted this before but it just crashed the game wen another player walks near. any coding help is appreciated and i would really like help with this. also here's an image of what made it crash.
  7. So! I've been working on this for a while, but since this doesn't pertain to my other thread about this mod (it's far more specific), I'll make a separate thread for it. I'm trying to add some code to the Modmain.lua in order to have the existing characters in the game react in unique ways to my character (Different from the Player string in the speech_[character].lua file) and I pulled the code from an existing mod that had it. In my testing, it seemed characters like Wilson and Webber still used their default descriptors instead of the ones I modded in. Here's what the code looks like (Only posting a few as not to clutter this thread): My first thought was in the line "...DESCRIBE.warlock", warlock needed to be capitalized. I tried that, and it still didn't work properly. If anybody has any info I'd appreciate it! ---------------------- I tossed out using this code entirely, as nothing I tried worked and nobody seemed to have a fix for it. Instead, I ended up using a different code to use a custom speech file I made and added my character's prefab to the character interaction list. In case anybody else is looking for it, the code I used is this: GLOBAL.STRINGS.CHARACTERS.GENERIC = GLOBAL.require "speech_wils" This is for Wilson, because he uses the generic string. I took his speech file, renamed it to speech_wils so it wouldn't conflict with his existing speech file, and it worked like a dream. Hope this helps someone else!
  8. Hi! I'm trying to make a mod that reduces the quantity of slots on a backpack, however I'm unable to accomplish it. I would appreciate some help in how to reduce the quantity of slots, the backpack interface changes, but it continues with the same quantity of slots. My modmain will go attached here. I would appreciate any help! modmain.lua
  9. Hello to anyone who is reading that, so I don't even know where to start to be honest. I've looked trough prefabs and found amulet one, since I haven't looked in modding for years(and when I did it was basically change some values here and there), I have no idea how the file should look for like one custom amulet, the file has a few listed in there. Anyhow I was wondering if someone can help me with making custom amulet, the one that will lower sanity drain from dusk and night, I'll attach the original file I found. The other question I have is where exactly and how exactly do I get sprites of amulet(s) from the base game, so I can resprite over them and then pack it back together. Thanks for help beforehand. TL;DR How to make lua file for just a singe amulet and how to make proper anim set for it Dunno if what I've said is understandable but ask questions right away I'll do my best to answer, also sorry for my grammar, English is not my native language amulet.lua
  10. Howdy! I've decided to try my hand at modding once again. But, i'm not too certain as to how to code a few things. I'd like it if my character, Diti, could do night vision, and maybe buff her attack a little bit at night too? I've looked around in files, and honestly none of them are working?? I also wanted to do somethin' like having her passive with a ton of normally hostile mobs??
×
×
  • Create New...