tehMugwump Posted June 17, 2013 Share Posted June 17, 2013 (edited) I got some screenshots.Was this ever resolved? I've got the same issue:(only thing I did was tint the .tex file and reconvert (from swap Krampus anim file).Ah, (Don't forget to check premultiply and generate mips!) seems to be the key! Edited June 17, 2013 by tehMugwump Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209450 Share on other sites More sharing options...
Developer Ipsquiggle Posted June 17, 2013 Author Developer Share Posted June 17, 2013 I have questions about anim.bin found in the animation zip files.Do they require build rennamer?I tried to create a new equipable item and it doesn't show up on the ground.Edit: It also doesn't show up in hand. Only inventory image.anim.bin shouldn't require the build renamer, only build.bin.Here's all the steps I can think of, see if any of these got missed maybe?[*]Get an item .zip from the base game, such as data/anim/axe.zip, copy it to your mod folder.[*]Extract the files from it.[*]Convert atlas-0.tex to a PNG, fill it with your artwork, and convert it back to a .tex.[*]Use buildrenamer to give the build.bin a new ID, e.g. 'myitem'. (Note: it still needs to be called build.bin, the renamer just edits a name stored inside the file)[*]Pack the anim.bin, build.bin, and atlas-0.tex into a zip, and give it the same name that you gave to buildrenamer, e.g. 'myitem.zip'[*]Add a line to your assets list in either the prefab definition or modmain, i.e. Asset("ANIM", "anim/myitem.zip")[*]In the prefab, do anim:SetBank("myitem") and anim:SetBuild("myitem")If that all seems to be correct, check My Documents\Klei\DoNotStarve\log.txt for any errors or warnings. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209453 Share on other sites More sharing options...
infernalthing Posted June 17, 2013 Share Posted June 17, 2013 anim.bin shouldn't require the build renamer, only build.bin.Here's all the steps I can think of, see if any of these got missed maybe?[*]Get an item .zip from the base game, such as data/anim/axe.zip, copy it to your mod folder.[*]Extract the files from it.[*]Convert atlas-0.tex to a PNG, fill it with your artwork, and convert it back to a .tex.[*]Use buildrenamer to give the build.bin a new ID, e.g. 'myitem'. (Note: it still needs to be called build.bin, the renamer just edits a name stored inside the file)[*]Pack the anim.bin, build.bin, and atlas-0.tex into a zip, and give it the same name that you gave to buildrenamer, e.g. 'myitem.zip'[*]Add a line to your assets list in either the prefab definition or modmain, i.e. Asset("ANIM", "anim/myitem.zip")[*]In the prefab, do anim:SetBank("myitem") and anim:SetBuild("myitem")If that all seems to be correct, check My Documents\Klei\DoNotStarve\log.txt for any errors or warnings.Isn't SetBank the sound? I had to leave it as it was before making it work. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209460 Share on other sites More sharing options...
Developer Ipsquiggle Posted June 17, 2013 Author Developer Share Posted June 17, 2013 I just ran through all this myself and it seems I've let you astray...So bank and build are both animation terms in this case. "build" is the name of the art assets you are loading (e.g. "myitem") which you created art for and buildrenamed. "bank" is the collection of animations you are loading the build onto (that is, bank = movement, build = images).It turns out that when you modify an existing anim as I suggested, the collection name doesn't change. So if you took axe.zip and created your anim from that, then the bank it uses is still "axe". So you would have:anim:SetBank("axe") -- because this was originally axe.zipanim:SetBuild("myitem") -- because our new art is in myitem.zip, buildrenamed to myitem.But wait! There's more! Because of on of our optimization steps, there will also be chunks missing from the image. So here's a template item for you to build off of which won't have this issue.(Template and instructions in next post) Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209595 Share on other sites More sharing options...
simplex Posted June 17, 2013 Share Posted June 17, 2013 Ipsquiggle, could you please clarify my question on mods and copyright? Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209605 Share on other sites More sharing options...
Developer Ipsquiggle Posted June 17, 2013 Author Developer Share Posted June 17, 2013 Alright, [MENTION=17097]infernalthing[/MENTION], instructions are here: http://forums.kleientertainment.com/showthread.php?21896-Creating-an-anim-for-items-on-the-ground&p=210101#post210101 [MENTION=44092]simplex[/MENTION] Aah, cool, I'll jump over there. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209673 Share on other sites More sharing options...
gamer.toukotsu Posted June 17, 2013 Share Posted June 17, 2013 IPsquiggle,Would you do a quick tutorial on a simple fx animation file as well, example: fire/freeze? I've implemented mine, but I believe something is completely wonkers because they are not showing up correctly. Could the .tex format be incorrectly pushed for the animation? Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209704 Share on other sites More sharing options...
Developer Ipsquiggle Posted June 17, 2013 Author Developer Share Posted June 17, 2013 Would you do a quick tutorial on a simple fx animation file as well, example: fire/freeze? I've implemented mine, but I believe something is completely wonkers because they are not showing up correctly. Could the .tex format be incorrectly pushed for the animation?What kind of problems are you having? Do you have a thread going where we could hash this out? There's lots of little things that can go wrong for sure and I'd like to get lots of tutorials up eventually, but I actually prefer to just help you with your problem directly, so that I know what kinds of things future tutorials need to be about! Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209744 Share on other sites More sharing options...
gamer.toukotsu Posted June 17, 2013 Share Posted June 17, 2013 Well I was hoping not to have to post, but I posted and hopefully someone can help me with this issue.Post here: Click Here.... Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-209759 Share on other sites More sharing options...
Lexicroft Posted June 18, 2013 Share Posted June 18, 2013 [MENTION=55]Ipsquiggle[/MENTION] , or any mod experts, please help meI just want to apply area damage to my weapon, I can apply it to character unarmed (using combat components)but it wont working to weapon (because it use weapon components obviously)already try to copy code from combat to weapon, but it doesn't work.it involve vector, target, and i just meet deadend, can you give a code/function for weapon area damage? Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210011 Share on other sites More sharing options...
gamer.toukotsu Posted June 18, 2013 Share Posted June 18, 2013 [MENTION=55]Ipsquiggle[/MENTION] , or any mod experts, please help meI just want to apply area damage to my weapon, I can apply it to character unarmed (using combat components)but it wont working to weapon (because it use weapon components obviously)already try to copy code from combat to weapon, but it doesn't work.it involve vector, target, and i just meet deadend, can you give a code/function for weapon area damage?Check out the aura.lua file to learn how to do area of attack damage, which you will need to override the onattack function of your weapon to be able to use it. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210408 Share on other sites More sharing options...
no_signal Posted June 18, 2013 Share Posted June 18, 2013 [MENTION=55]Ipsquiggle[/MENTION] , or any mod experts, please help meI just want to apply area damage to my weapon, I can apply it to character unarmed (using combat components)but it wont working to weapon (because it use weapon components obviously)already try to copy code from combat to weapon, but it doesn't work.it involve vector, target, and i just meet deadend, can you give a code/function for weapon area damage?When you set combat.areahitrangeit will make unarmed and weapons hit an area Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210462 Share on other sites More sharing options...
Lexicroft Posted June 18, 2013 Share Posted June 18, 2013 Check out the aura.lua file to learn how to do area of attack damage, which you will need to override the onattack function of your weapon to be able to use it.A thousand thanks to you! IT WORKS! Hahahaha :joyous:but now , after testing the "Leek Baton" I just think, it's too powerful (I test fight with 10 spiders, all dead perma-stunned)When you set combat.areahitrangeit will make unarmed and weapons hit an areaI will try it, how to set it? OnAttack, or just insert to function fn(Sim)? Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210474 Share on other sites More sharing options...
gamer.toukotsu Posted June 18, 2013 Share Posted June 18, 2013 A thousand thanks to you! IT WORKS! Hahahaha :joyous:but now , after testing the "Leek Baton" I just think, it's too powerful (I test fight with 10 spiders, all dead perma-stunned)I will try it, how to set it? OnAttack, or just insert to function fn(Sim)?If you think the item is too powerful, reduce the amount of damage it does on each hit. Classify it as an area of effect weapon and let people whine and complain that its not powerful against a single creature. Compromise has to be made when looking at Area of Effect skills vs Single Target skills. An area of effect weapon/skill should always do less damage to a single target, because it has the ability to hit mulitple targets increasing it's damage ten fold.function Weapon:SetDamage(dmg) self.damage = dmgendfunction Weapon:SetRange(attack, hit) self.attackrange = attack self.hitrange = hit or self.attackrangeendThis code is from the weapon.lua it should help you. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210478 Share on other sites More sharing options...
Lexicroft Posted June 18, 2013 Share Posted June 18, 2013 (edited) If you think the item is too powerful, reduce the amount of damage it does on each hit. Classify it as an area of effect weapon and let people whine and complain that its not powerful against a single creature. Compromise has to be made when looking at Area of Effect skills vs Single Target skills. An area of effect weapon/skill should always do less damage to a single target, because it has the ability to hit mulitple targets increasing it's damage ten fold.function Weapon:SetDamage(dmg) self.damage = dmgendfunction Weapon:SetRange(attack, hit) self.attackrange = attack self.hitrange = hit or self.attackrangeendThis code is from the weapon.lua it should help you.The weapon itself only over power against small creature (especially spiders in group) and the area damage is using Abigail_area_damage which is 20 , The Leek Baton itself has 30 damage, and if I change the area damage, the game just crashedI want to change it to 2~5 area damage, but the game wont allow it :(So the option Is I change Baton damage to 10 --> 10+20 = 30 Damage single target, 20 area damage~EDIT~Solved, I manage to change it to 5 area damage Edited June 18, 2013 by Lexicroft Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210496 Share on other sites More sharing options...
gamer.toukotsu Posted June 18, 2013 Share Posted June 18, 2013 The weapon itself only over power against small creature (especially spiders in group) and the area damage is using Abigail_area_damage which is 20 , The Leek Baton itself has 30 damage, and if I change the area damage, the game just crashedI want to change it to 2~5 area damage, but the game wont allow it :(So the option Is I change Baton damage to 10 --> 10+20 = 30 Damage single target, 20 area damageI would have to see the actual code to see what is happening. Show me how you are changing the damage and I will help you. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210503 Share on other sites More sharing options...
Developer Ipsquiggle Posted June 18, 2013 Author Developer Share Posted June 18, 2013 [MENTION=23254]Lexicroft[/MENTION] It depends on exactly what you're looking for, but I think [MENTION=53767]gamer.toukotsu[/MENTION] is on the right path.You can look at the auras, or Combat:DoAreaAttack() for how to apply damage over an area.You can then hook into Weapon:SetOnAttack(fn) to apply your area attack.So I'd handle it something like this:In your weapon prefab, define: local function special_area_damage(inst, attacker, target) .... do stuff .... endThen on the weapon in fn(Sim), inst.components.weapon:SetOnAttack(special_area_damage)Then every time the weapon hits an enemy, it should AOE as well. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210509 Share on other sites More sharing options...
gamer.toukotsu Posted June 18, 2013 Share Posted June 18, 2013 [MENTION=55]Ipsquiggle[/MENTION] Here is a brain-teaser for you, how do you set an animation to play in the background rather than on the foreground?Example, most programming languages allow you to use a function like SendToBack to send a graphical item to the back of the field. Is this possible? Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210514 Share on other sites More sharing options...
Lexicroft Posted June 18, 2013 Share Posted June 18, 2013 Here is the code, it works perfectlyThe weapon itself give whack a lot experience, you know, spamming your spacebar like crazy local function onattack(inst, owner, target) inst.components.aura:OnTick() endinst:AddComponent("weapon") inst.components.weapon:SetDamage(20) inst.components.weapon:SetOnAttack(onattack) inst:AddComponent("combat") inst.components.combat.defaultdamage = 5 inst.components.combat.playerdamagepercent = 0, inst:AddComponent("aura") inst.components.aura.tickperiod = TUNING.ABIGAIL_DMG_PERIOD inst.components.aura.radius = 3 Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210517 Share on other sites More sharing options...
no_signal Posted June 18, 2013 Share Posted June 18, 2013 (edited) When you set combat.areahitrangeit will make unarmed and weapons hit an areaI will try it, how to set it? OnAttack, or just insert to function fn(Sim)?add this to the onequip functionlocal com = owner.components.combatinst.ownerAreaHitRange = com.areahitrangeinst.ownerAreaHitDamagePercent = com.areahitdamagepercentcom.areahitrange = 3 -- area of effectcom.areahitdamagepercent = 1 -- area damage percentthen add this too the onunequip functionlocal com = owner.components.combatcom.areahitrange = inst.ownerAreaHitRangecom.areahitdamagepercent = inst.ownerAreaHitDamagePercent Edited June 18, 2013 by no_signal 1 Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210530 Share on other sites More sharing options...
Lexicroft Posted June 18, 2013 Share Posted June 18, 2013 add this to the onequip functionlocal com = owner.components.combatinst.ownerAreaHitRange = com.areahitrangeinst.ownerAreaHitDamagePercent = com.areahitdamagepercentcom.areahitrange = 3 -- area of effectcom.areahitdamagepercent = 1 -- area damage percentthen add this too the onunequip functionlocal com = owner.components.combatcom.areahitrange = inst.ownerAreaHitRangecom.areahitdamagepercent = inst.ownerAreaHitDamagePercentIt works! I'm gonna use this, somehow easier to edit and understandThanks a lot ^_^I'm gonna credit you and gamer.toukotsu in my modNow the handgun... Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210539 Share on other sites More sharing options...
no_signal Posted June 18, 2013 Share Posted June 18, 2013 (edited) It works! I'm gonna use this, somehow easier to edit and understandThanks a lot ^_^You can also changecom.areahitdamagepercent = 1to com.areahitdamagepercent = 0.5and it will do normal damage to the enemy you hitand half the damage to the surrounding enemies. Edited June 18, 2013 by no_signal Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210544 Share on other sites More sharing options...
Plospo Posted June 18, 2013 Share Posted June 18, 2013 I'm having a bit of a problem...After playing some Lights out, I'm trying to make the player auto-equip another torch in the inventory instead of accumulating torches with 1-4% durability in the inventory.I can easily make the player equip another torch automagically by adding owner:PushEvent("toolbroke", {tool = inst}) to the torch script, which makes it act like an axe when out of durability. The problem is that the player stagger, like when a tool breaks, which makes it dark for a little while, letting some sanity slip away.I've tried searching for what happen when the event "toolbroke" is pushed by searching for 'ListenForEvent("toolbroke' through all components, all prefabs, etc, by adding them all into my Notepad++ and using the "search through all opened files" method. I can't find it anywhere. Thus, I can't see how the game makes tool automagically equip new tools, and I can't modify that script to prevent the player from staggering when a torch is depleted....Anyone knows where I can find where the "toolbroke" event is listened for, or any other method of making this work?Also, if there's already a mod as this one I'm planning to make, let me know.Thanks in advance. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210555 Share on other sites More sharing options...
gamer.toukotsu Posted June 18, 2013 Share Posted June 18, 2013 (edited) I'm having a bit of a problem...After playing some Lights out, I'm trying to make the player auto-equip another torch in the inventory instead of accumulating torches with 1-4% durability in the inventory.I can easily make the player equip another torch automagically by adding owner:PushEvent("toolbroke", {tool = inst}) to the torch script, which makes it act like an axe when out of durability. The problem is that the player stagger, like when a tool breaks, which makes it dark for a little while, letting some sanity slip away.I've tried searching for what happen when the event "toolbroke" is pushed by searching for 'ListenForEvent("toolbroke' through all components, all prefabs, etc, by adding them all into my Notepad++ and using the "search through all opened files" method. I can't find it anywhere. Thus, I can't see how the game makes tool automagically equip new tools, and I can't modify that script to prevent the player from staggering when a torch is depleted....Anyone knows where I can find where the "toolbroke" event is listened for, or any other method of making this work?Also, if there's already a mod as this one I'm planning to make, let me know.Thanks in advance.SGwilson.luaEventHandler("toolbroke", function(inst, data) inst.sg:GoToState("toolbroke", data.tool) end),tool.lualocal function PercentChanged(inst, data) if inst.components.tool and data.percent and data.percent <= 0 and inst.components.inventoryitem and inst.components.inventoryitem.owner then inst.components.inventoryitem.owner:PushEvent("toolbroke", {tool = inst}) endendApparently I over looked one in my searches, see below post for an additional section of it. Edited June 18, 2013 by gamer.toukotsu Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210561 Share on other sites More sharing options...
no_signal Posted June 18, 2013 Share Posted June 18, 2013 I'm having a bit of a problem...After playing some Lights out, I'm trying to make the player auto-equip another torch in the inventory instead of accumulating torches with 1-4% durability in the inventory.I can easily make the player equip another torch automagically by adding owner:PushEvent("toolbroke", {tool = inst}) to the torch script, which makes it act like an axe when out of durability. The problem is that the player stagger, like when a tool breaks, which makes it dark for a little while, letting some sanity slip away.I've tried searching for what happen when the event "toolbroke" is pushed by searching for 'ListenForEvent("toolbroke' through all components, all prefabs, etc, by adding them all into my Notepad++ and using the "search through all opened files" method. I can't find it anywhere. Thus, I can't see how the game makes tool automagically equip new tools, and I can't modify that script to prevent the player from staggering when a torch is depleted....Anyone knows where I can find where the "toolbroke" event is listened for, or any other method of making this work?Also, if there's already a mod as this one I'm planning to make, let me know.Thanks in advance.SGwilson.luaState{ name = "toolbroke", tags = {"busy"}, onenter = function(inst, tool) inst.AnimState:PlayAnimation("hit") inst.SoundEmitter:PlaySound("dontstarve/wilson/use_break") inst.AnimState:Hide("ARM_carry") inst.AnimState:Show("ARM_normal") local brokentool = SpawnPrefab("brokentool") brokentool.Transform:SetPosition(inst.Transform:GetWorldPosition() ) inst.sg.statemem.tool = tool end, onexit = function(inst) local sameTool = inst.components.inventory:FindItem(function(item) return item.prefab == inst.sg.statemem.tool.prefab end) if sameTool then inst.components.inventory:Equip(sameTool) end if inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) then inst.AnimState:Show("ARM_carry") inst.AnimState:Hide("ARM_normal") end end, events= { EventHandler("animover", function(inst) inst.sg:GoToState("idle") end ), }, }, Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/11/#findComment-210570 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now