Jump to content

Search the Community

Showing results for tags 'prefab'.

  • 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

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

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

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 20 results

  1. Hello, I am making a character mod again, and with help I was able to write custom quotes for when he gets hit, and even dies (as well as depending on who kills him). However, unlike my other character mod Garamonde, I am struggling to get his standard death quotes to work. I copied the working code from Garamonde's prefab file, and I even added a SetTaskInTime delay for the quote to show up, but still nothing. I've tried dying in multiple ways but nothing. Here's his prefab file if anyone can see what I may've done wrong! Thank you! kk.lua
  2. local function error(inst) inst.components.health:DoDelta(-15) end Code above is located inside custom item's prefab. How to make it work ? I have tried with player/owner instead of inst but it resulted in error anyway.
  3. Does anyone have an extensive prefab list? I'm mainly looking for spawners, like vulture/dragonfly spawners, but a full list is obviously much better
  4. Hi, i am currently developing a patch for a part of a no longer maintained mod. Ideally, i'd like to use AddPrefabPostInit to add something to a prefab of another mod. I also want to use AddClassPostConstruct to insert another asset for the prefab. I check for the mod and that it is enabled just fine. I also set the priority of my mod into a negative value to ensure that the other mod gets loaded before mine. if GLOBAL.KnownModIndex:IsModEnabled("workshop-XXX") then AddClassPostConstruct("prefabs/other_mod_prefab", function() table.insert(GLOBAL.Prefabs['other_mod_prefab'].assets, Asset("ANIM", "anim/new_asset.zip")) end) AddPrefabPostInit("other_mod_prefab", my_cool_post_init) end This way of adding assets to a prefab works just fine with prefabs from the main game. But when i use the code above it corrupts the network communication of my client and the dedicated server (it works fine if you're the host). By corruption i mean all stats are 100, you cannot craft anything, when you get hit a sandstrom starts and other crazy stuff (It's all on the client side, though). Any idea want i am doing wrong? Do i have to access mod prefabs in any other way? The function my_cool_post_init contains the following: inst:ListenForEvent("phasechanged", function(src, data) if data ~= "night" and data ~= "dusk" and not GLOBAL.TheWorld:HasTag("cave") then inst:DoTaskInTime(2, function() inst.AnimState:PlayAnimation("idle_off") inst.Light:Enable(false) end) else inst:DoTaskInTime(2, function() inst.AnimState:PlayAnimation("idle") inst.Light:Enable(true) end) end end,GLOBAL.TheWorld)
  5. Hi, I have been working on RGD-33 grenade. I have used Napsack prefab as my template and it has no error screen so far but when I throw it it won't do any damage. I don't get all those explosive functions so if anyone here could help me I will be happier person. Prefab here: local assets= { Asset("ANIM", "anim/rgd3_nade.zip"), Asset("ANIM", "anim/swap_rgd3_nade.zip"), Asset("ATLAS", "images/inventoryimages/rgd3_nade.xml"), Asset("IMAGE", "images/inventoryimages/rgd3_nade.tex"), } local prefabs = { } local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_rgd3_nade", "rgd3") 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 OnExplodeFn(inst) --nothing works SpawnPrefab("explode_small").Transform:SetPosition(x, y, z) end local function OnHit(inst, attacker, target) local x, y, z = inst.Transform:GetWorldPosition() inst:Remove() SpawnPrefab("explode_small").Transform:SetPosition(x, y, z) end local function OnThrown(inst) inst:AddTag("NOCLICK") inst.persists = false inst.AnimState:PlayAnimation("spin") inst.Physics:SetMass(1) inst.Physics:SetCapsule(0.2, 0.2) inst.Physics:SetFriction(0) inst.Physics:SetDamping(0) inst.Physics:SetCollisionGroup(COLLISION.CHARACTERS) inst.Physics:ClearCollisionMask() inst.Physics:CollidesWith(COLLISION.WORLD) inst.Physics:CollidesWith(COLLISION.OBSTACLES) inst.Physics:CollidesWith(COLLISION.ITEMS) end local function ReticuleTargetFn() local player = ThePlayer local ground = TheWorld.Map local pos = Vector3() --Attack range is 8, leave room for error --Min range was chosen to not hit yourself (2 is the hit range) for r = 6.5, 3.5, -.25 do pos.x, pos.y, pos.z = player.entity:LocalToWorldSpace(r, 0, 0) if ground:IsPassableAtPoint(pos:Get()) and not ground:IsGroundTargetBlocked(pos) then return pos end end return pos end ---------------------------------------------------- ---------------------------------------------------- ---------------------------------------------------- local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() inst.entity:AddSoundEmitter() MakeInventoryPhysics(inst) inst:AddTag("projectile") inst:AddTag("explosive") inst.AnimState:SetBank("rgd3") inst.AnimState:SetBuild("rgd3_nade") inst.AnimState:PlayAnimation("idle") if not TheWorld.ismastersim then return inst end inst.entity:SetPristine() inst:AddComponent("locomotor") inst:AddComponent("reticule") inst.components.reticule.targetfn = ReticuleTargetFn inst.components.reticule.ease = true local advancedtargeting = TheNet:GetServerGameMode() == "lavaarena" if advancedtargeting then inst.components.reticule.reticuleprefab = "reticuleaoe" inst.components.reticule.pingprefab = "reticuleaoeping" inst.components.reticule.mouseenabled = true inst:AddTag("nopunch") end inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "rgd3_nade" inst.components.inventoryitem.atlasname = "images/inventoryimages/rgd3_nade.xml" inst:AddComponent("inspectable") inst:AddComponent("equippable") MakeHauntableLaunch(inst) inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst:AddComponent("complexprojectile") inst.components.complexprojectile:SetHorizontalSpeed(15) inst.components.complexprojectile:SetGravity(-35) inst.components.complexprojectile:SetLaunchOffset(Vector3(.25, 1, 0)) inst.components.complexprojectile:SetOnLaunch(OnThrown) inst.components.complexprojectile:SetOnHit(OnHit) if not advancedtargeting then inst:AddComponent("weapon") inst.components.weapon:SetDamage(0) inst.components.weapon:SetRange(8, 10) end inst:AddComponent("explosive") inst.components.explosive:SetOnExplodeFn(OnExplodeFn) inst.components.explosive.explosivedamage = TUNING.GUNPOWDER_DAMAGE inst.components.explosive.explosiverange = 3 return inst end return Prefab("common/inventory/rgd3_nade", fn, assets, prefabs)
  6. Ok. I have finally got my stuff to work after a several month long hiatus. On to what I need to know and where to possibly find it if you are willing to help. I am making a wilson bot that will eventually become an interact-able npc. One that will act and work with you. It's like having actual friends but not really. The actual ai I have planned is a bit far in the future for how complicated I want to make it. What I have so far: I have a wilson that stands around doing nothing and has a third arm holding an invisible tool. What I plan on: An AI that will walk around randomly and do tasks based off what he sees. What I need help with: First is sight range. I have no way of measuring units on the screen and I don't know how much "sight" to give wilson so it seems realistic. What is the range of sight that is given to a player? High hopes for my first don't starve mod yes but taking it a step at a time will eventually get me to my goal. BTW sorry if this is confusing but I am still at the beginning and there's not much to ask for but I still need help for each step along the way. I made this a general ask because, I will be coming back here to ask more questions about this topic. I did a previous ask article but it was archived due to my long hiatus. I fixed my previous problem of stategraph basics now I am here. Join me along the ride as I make a mod that somehow has over 300 steam subscribers despite me blatantly saying it doesn't work. Also if you haven't already noticed I am a noob coder. Gotta start somewhere right?
  7. So I have a lightning prefab file and when I am looking at the code I don't see (and don't understand too) how lightning deals damage. I am at very beginning of my modding journey so this might seem so simple for others. Please help me if you are able to.
  8. So! Nearly everything on my mod is working correctly. For the last thing, I created a "cave spider egg sack" prefab that works just like the regular spider egg sack but spawns a Spider Hole instead of a Den once deployed. It works as it's meant to work, it's spawning the Spider Hole, but I'm having a few issues. 1- The graphics are mostly working. However, it's invisible when on the ground and also the "positioning ghost" for when the player is about to deploy it doesn't show up either. I edited the Spider Hole's graphics to make it on the size of an inventory item and I would like basically the same thing for when it's on the ground or being deployed. 2- When the player deploys it, they're pushed backward. This is probably due to the structure's size x deploying size(?). I don't know if there's a way of fixing this.
  9. I've added a hairfront_hat symbol to my character's build because their hairfront clips through hats normally. What I want to do now is override the OnEquip function in hats.lua. There's a problem though; it's a local function that's created inside of another local function (MakeHat(string)) so I don't think I can access it directly. The hats.lua file doesn't return an actual hats prefab; rather, it returns a whole bunch of hats made by MakeHat(string). I think this prevents me from adding a postinit to it because a hats prefab technically never gets made. Because of this, trying to modify components.equippable.onequipfn for hats didn't work. But I DID get it to work by modifing the onequipfn for the "tophat" prefab specifically. So here's what I want to know: is there a convenient way to do add a postinit for every prefab that MakeHat() can return, without overwriting the file? Or will I have to go through the list of return values in hats.lua and manually add the post init to every single one?
  10. Hi! I am currently making an item that spawn effect (in this case a prefab) on the item's owner when equipped and gone when unequipped. I understand how the equip and unequip works, What i want to ask is, how to make a prefab spawn and "attach" on another prefab? So, when the "attached" prefab is moving, the "attaching" prefab is moving too. A simple example is like aura thing (see attached image).
  11. I have looked all over this mod, checked each individual prefab reference, but still get a prefab error. Upon launch, when I hit "host game" and open a server with this mod (Michael+) it'll crash after a few seconds and instantly close. No whitescreen. The log gives no useful information other than the fact something is wrong with the prefabs (pasted below) I was just hoping some more experienced modders could decipher the issue as I am unable to. Thanks, Mikey99222 client_log.txt The mod.rar
  12. Hello! I have recently attempted to make a mod, a simple weapon/tool mod, and after some time I got it to eventually load with the game, only problem is: it doesn't display anything in hand or on the ground when dropped. Heres the anim file and modinfo and modmain: anim.zip modinfo.lua modmain.lua
  13. 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:
  14. I try this code in my modmain.lua: if GLOBAL.TheNet:GetIsServer() then local Prefabs = GLOBAL.Prefabs for k, v in pairs(Prefabs) do AddPrefabPostInit(v, function(inst) if not inst.components.tradable and inst.components.equippable ~= nil then inst:AddComponent("tradable") end end) end end But when I enter in the game, nothing happens... I'm done something wrong, or i can do it in other way? (my objective is add the component Tradable for all equippable itens (armors, tools, weapons, amulets, etc)
  15. Hey all, I'm trying to add an item to the ancient tab. While I have been able to do so, is there way to make the item not stay prototype-able? I want the recipe to be removed when I move away from the altar just like the normal ancient tab recipes are. I have no idea how to do ithat unfortunately. So far I've just managed to make the item craftable in the tab. I would really appreciate the help. This is what I've only been able to do so far: if GetModConfigData("ancientswordrecipe") then MakeRecipe("ancientsword", {Ingredient("greengem", 7), Ingredient("yellowgem", 7), Ingredient("orangegem", 7)}, RECIPETABS.ANCIENT, TECH.ANCIENT_FOUR, nil, nil, nil, nil, nil, "images/inventoryimages/ancientsword.xml", "ancientsword.tex") end
  16. Hello modders community! I've been working on a Light Potion and decided to add some configuration to it in the modinfo so I can choose the light color! I attempted to call in my prefab the data chosen on the config option screen. The problem is that the game do not pick the data from the modinfo and the light on the character remains unchanged, very normal. I saw this threat on the forum and tried to put what is proposed but it is not working. I just want to add several configuration options in my lightpotion.lua so the color fits the choice made in the configuration options. I will show you what's in my modinfo, in the top of my modmain and what's in the prefab so far, followed with the crash log. Ask anything if u need! Modinfo : Modmain : Lightpotion.lua : Crash log : There is something wrong in modmain/prefab but I can't figure what it is. I tried different schemes, without luck. Red only is written for testing purpose. Any help would be really appreciated, I'm sure I almost got it worked! Note : Potions are stackable. I tried to put the addlight(eater) function in the oneaten function, which worked. But, when dropping the potions on the ground, the character loses its light! The light entity was hold by the potions, not the character! D4rkh0bb1T
  17. Ok so, I made a character with custom items, however, once I tested it through a server, I realized that people becomes unable to connect or gets into a never ending loading screen. HOWEVER this started once I added the inst.entity:AddNetwork()and if not TheWorld.ismastersim then return inst end inst.entity:SetPristine()of course before the first line there the items would never appear, so, that explains why the connection problem was not happening, but still. Does anyone has any idea of what is happening? and anyone could give a hand?
  18. I am adding this AddPrefabPostinit to my modmain AddPrefabPostInit("diviningrod", function(inst)if GLOBAL.GetPlayer().prefab == "trent" then inst:AddTag("sharp") inst:AddComponent("weapon") inst.components.weapon:SetDamage(55)endend)and it gives me this error [00:01:20]: error calling PrefabPostInit: diviningrod in mod Trent - DST (Trent Character): [string "../mods/Trent - DST/modmain.lua"]:67: attempt to index a nil valueWhat am I doing wrong?
  19. It's been a while since I made a mod, almost a year. Currently I'm trying to do a very simple change to the firestaff that makes it do 34 damage instead of set things on fire. A mod I made a while back used AddComponentPostInit to successfully overwrite the ReleaseHound function in hounded.lua, so I assumed AddPrefabPostInit worked the same way and tried to duplicate... to no avail. I noticed that all the different staves seem to be stored in staff.lua, at least that's what it looks like to me. So I wrote a modmain.lua that looks like this... PrefabFiles = {}Assets = {}local function setDamage(prefab) prefab.onattack_red = function(inst, attacker, target, skipsanity) if target.components.burnable and not target.components.burnable:IsBurning() then if target.components.freezable and target.components.freezable:IsFrozen() then target.components.freezable:Unfreeze() end end if target.components.freezable then target.components.freezable:AddColdness(-1) --Does this break ice staff? if target.components.freezable:IsFrozen() then target.components.freezable:Unfreeze() end end if target.components.sleeper and target.components.sleeper:IsAsleep() then target.components.sleeper:WakeUp() end if target.components.combat then target.components.combat:SuggestTarget(attacker) if target.sg and target.sg.sg.states.hit and not target:HasTag("player") then target.sg:GoToState("hit") end end if attacker and attacker.components.sanity and not skipsanity then attacker.components.sanity:DoDelta(-TUNING.SANITY_SUPERTINY) end attacker.SoundEmitter:PlaySound("dontstarve/wilson/fireball_explo") target:PushEvent("attacked", {attacker = attacker, damage = 34}) endendAddPrefabPostInit("staff", setDamage)The only change I made to the original function was remove the call to ignite the target, and change the damage at the end from 0 to 34. The mod is completely nonfunctional. When I look at it in the mod list it always says the mod crashed. I clearly have no idea how to use AddPrefabPostInit, so can someone tell me?
  20. For some reason I can't upload any pictures or change my avatar, when I try to change my avatar it linked me to a page saying this: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@forums.kleientertainment.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Also, when I try to post a pic, it will make an error pop up or not do anything at all, just taking away the add picture gui with no pic on the post.
×
×
  • Create New...