Search the Community

Showing results for tags 'scripting'.



More search options

  • 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 Early Access] - General Discussion
    • [Griftlands Early Access] - Suggestions and Feedback
    • [Griftlands Early Access] - Localization
    • [Griftlands Early Access] - Bug Tracker
    • [Griftlands Early Access] - Developer log
  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
  • 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] Return of Them
    • [Don't Starve Together] PS4
    • [Don't Starve Together] Xbox One
    • [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
  • Other Stuff

Categories

  • Don't Starve
    • Custom Character and Skins
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included
  • Griftlands - [Early Access]
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • 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] PS4
  • [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
  • Griftlands - [Early Access]
  • Hot Lava
  • Don't Starve Together
  • [PS4] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Hamlet
  • Don't Starve: Shipwrecked

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End



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

Found 9 results

  1. Hello, For the Athor dwarven mod the two brew (Ale and Tonic) are working well now thanks to DarkXero. I would actually like to add to badges that pop-up to show you how much time you have left after drinking ale or tonic. I copied files from the Moisture mete; edited their visuals and tried implementing some code to the best of my ailities. But as expected, it doesn't show up after drinking any of the ales as i don't know which codes I should implement and where I should. Has any one an idea how to implement this relatively easy to execute idea? The ales have a resttime that adds to the component when one or both are drunk by a player who has the component. -Eremus007
  2. Hello, here I have a part of the scripting of a dwarventonic edible prefab that makes the drinker/eater see in the dark. (There are other codes that make this work in the modmain) The problem is that I would like to make this also work when the character is in the caves. Right now it only works at night and switches off automatically. I would like to do something like this, but I don't know how to say that in LUA: I hope someone can give me the right condition
  3. I want to make a sword that will harm the player instead of the target if he/she chooses to attack an innocent creature (which I specified with PrefabPostinits in the modmain). And when you attack anything that is not "innocent" then the basedamage of 75 will be put in place. I have experimented a lot and this is what I currently have at the best of my abilities: Like this in the Prefab file: local function onattack(inst, owner, target) if owner.components.health and target:HasTag("innocent") then if math.random() < 1 then inst.components.weapon:SetDamage(0) owner.components.health:DoDelta(-50) else inst.components.weapon:SetDamage(75) end end end The thing is that after you hit an innocent creature the value of the damage only sets in AFTER the creature is already been hit, and thus being killed which we don't want. And when attacking a spider for example after having hit an innocent creature before, it doesn't even make a scratch. So the value is stuck at Damage = 0 intil reset. I want the values to change immediatly or even before I even hit the creature. Can someone make this happen for me? Many thanks in regards -Eremus
  4. Hello again, I am trying to make an edible prefab for an ale that doubles the amount of damage dealt by my character. Unfortunately it crashes when my character eats it. It says something like: Can't use math problems on a nil value. (at least that was what I understood). This is the 'problem' code: inst.components.edible.oneaten = function(inst, eater) if eater.prefab == "skyminer" then eater.components.hunger:DoDelta(7) eater.components.sanity:DoDelta(-5) eater.dwarvenaleresttime = 30 * 6.5 eater.components.sanity.dapperness = eater.components.sanity.dapperness - TUNING.DAPPERNESS_MED eater.components.combat.damagemultiplier = eater.components.combat.damagemultiplier + TUNING.WILSON_DAMAGE_MULT end if eater.components.inventory ~= nil then local item = SpawnPrefab("woodenmug") eater.components.inventory:GiveItem(item) inst:Remove() end end I tried changing the mult into something else but I keep the same problem. It's weird because the same code works fine within the Witcher Geralt mod. If someone could tell me what I am doing wrong, that would be very helpful again Many thanks.
  5. Hey, I've got a question. I've figured everything out with the dwarventonic prefab and it works fine. Then I tried to add a custom crafting recipe to make the prefab available in survival. ------------------------------------------ This works: local dwarventonic_recipe = AddRecipe("dwarventonic", { Ingredient("nitre", 1), Ingredient("carrot", 6)}, RECIPETABS.SURVIVAL, TECH.NONE, nil, nil, nil, nil, "dwarf", "images/inventoryimages/dwarventonic.xml" ) This doesn't work and crashes: local dwarventonic_recipe = AddRecipe("dwarventonic", { Ingredient("nitre", 1), Ingredient("carrot", 6), Ingredient("woodenmug", 1)}, RECIPETABS.SURVIVAL, TECH.NONE, nil, nil, nil, nil, "dwarf", "images/inventoryimages/dwarventonic.xml" ) The prefab "woodenmug" is a custom prefab that I added with the purpose of it being part of the recipe. Why can't I use a custom prefab in a recipe while I can debugspawn it sucessfully? How do I add a modded ingredient to the recipe? I couldn't find a solution anywhere on google. Many thanks! -Eremus
  6. Hello again, I am still breaking my head over how I make my custom prefab inflict nightvision for a specific amount of time when eaten. I was trying to copy the catpotion from the witcher mod, but I can't make it work. This is what I had in mind but doesn't work: local assets = { Asset("ANIM", "anim/dwarventonic.zip"), Asset("ATLAS", "images/inventoryimages/dwarventonic.xml") } local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() MakeInventoryPhysics(inst) inst.AnimState:SetBank("recycledpickaxe") inst.AnimState:SetBuild("dwarventonic") inst.AnimState:PlayAnimation("idle") inst.entity:AddNetwork() inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/dwarventonic.xml" inst:AddComponent("edible") inst.components.edible.oneaten = function(inst, eater) if eater.prefab == "skyminer" then eater.components.hunger:DoDelta(3) eater.components.sanity:DoDelta(-10) end if eater.components.inventory ~= nil then local item = SpawnPrefab("woodenmug") eater.components.inventory:GiveItem(item) inst:Remove() end end MakeHauntableLaunchAndIgnite(inst) return inst end return Prefab("common/inventory/dwarventonic", fn, assets) Can someone please point me in the right direction? Many thanks in advantage. -Eremus
  7. Hey, I am doing improvements to my custom dwarven character named Skyminer. I was trying to add three prefabs -Wooden mug [Done] (Plays role in the crafting recipe) -Dwarven tonic -Dwarven Ale I got stuck on the second one I was trying to make it so that when Skyminer ''eats'' the dwarven tonic that it will inflict him with nightvision for a specific amount of time and replaces the dwarven tonic with an empty wooden mug. That was the idea, It doesn't crash the game at the moment but I am not sure if the nightvision works but I am sure that the "Replacement" of the tonic isn't working. Here's the code: local function fn() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/dwarventonic.xml" inst:AddComponent("edible") inst.components.edible.oneaten = function(inst, eater) if eater.prefab == "skyminer" then eater.components.hunger:DoDelta(3) eater.components.sanity:DoDelta(-10) inst:AddTag("nightvision") inst:AddComponent("cooldown") inst.components.cooldown.cooldown_duration = TUNING.TOTAL_NIGHT_TIME if inst.components.cooldown:IsCharged() then inst:RemoveTag("nightvision") inst:RemoveTag("cooldown") end inst.components.edible.oneatenreplacement = "woodenmug" end end Can someone tell me what I am doing wrong so I can make it work? Many thanks in advantage.
  8. Hello fellow DST modders, I am in the progress of making a character mod and need some help with the scripting. My problem: One of the character perks is that items have a small chance to instantly break on use (regardless of remaining item durability). I just need a pointer on how to get the and item that the player is currently using and on how to change the durability of the item on use. Thanks a bunch in advance!
  9. What I'm trying to do: -Have the host choose some configurations and store the settings somewhere -Have the client download those settings and use them I'm a bit confused about where things are stored and retrieved from as well as just basic syntax. For example if in modmain.lua as a host I had: net_size = net_int(inst.GUID, "size", "size_dirty")net_size:set(1)Can the client get at it by doing: local size = net_size:value()And can this be done in the modmain.lua or would I have to go about it like in The Hunt mod and create a component with a class and hook it all in that way? Also, what -is- the proper syntax for creating the net variable, assigning a value, and retrieving a value if any of the above is off the mark?