CatalystWtrclr Posted July 3, 2015 Share Posted July 3, 2015 hey guys today i tried to create my first mod but i had a lot of problems with it. The idea is a creation of simple Log Storage (2 flint+1boars) for 5 stacks of log with dynamic texture (i can draw texture for each stack but now i have only empty storage and full storage. First problem: i couldn't understand how i can decompile anims.bin and build.bin using ktools. I have Win8, and I didn't understand process of decompilation cuz no one file in ktools directory i could use. Shall i use CMD or what? Sorry, if question is so stupid. Second problem: i don't know how my log storage can change texture when empty or has 1 full cell, 2 full cell etc. Maybe anybody can help with it? if you can help me please wrire me here or on steam:http://steamcommunity.com/id/watercolour-catalyst/ Link to comment Share on other sites More sharing options...
Mobbstar Posted July 3, 2015 Share Posted July 3, 2015 Yes, use the cmd window. First paste the path to krane (you can simply drag it in), then the arguments (source and destination path, can be identical). You could simply make a different animation for each one. Or you could bother with AnimState:Hide and AnimState:Show. Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 3, 2015 Author Share Posted July 3, 2015 Yes, use the cmd window. First paste the path to krane (you can simply drag it in), then the arguments (source and destination path, can be identical). hm. I almost never work with cmd...1."cd C:\Users\user\Desktop\MOD\ktools\src\krane" 2. "krane anim.bin build.bin C:\Users\user\Desktop\MOD\ktools\src\krane"right? Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 4, 2015 Author Share Posted July 4, 2015 Yes, use the cmd window. First paste the path to krane (you can simply drag it in), then the arguments (source and destination path, can be identical). You could simply make a different animation for each one. Or you could bother with AnimState:Hide and AnimState:Show. finally i understand how work with animation and compilation. (screenshot) But have problems with configs. I used config from mod Storm Cellar for testing 1. How i can make that player can store only logs.2. it's real to do that for 1 free cell in inventory of storage and 2 or 3 free cells play different animations? That code you posted helps me in this? Link to comment Share on other sites More sharing options...
Mobbstar Posted July 5, 2015 Share Posted July 5, 2015 How i can make that player can store only logs? The container component allows for test functions. Simply return ' item.prefab == "log" ' in the test function and you should be good to go. I'm not sure what you mean with the second question. You can either:Place all logs on the thing and keep them in all animations. Then you can show and hide the symbols as needed. Make a different idle animation for each count of logs. This is easier to do. Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 6, 2015 Author Share Posted July 6, 2015 I'm not sure what you mean with the second question. You can either: Sorry for my bad english, i'n russian, but it's hard when russian tutorials does not exist, need to read and translate, but i'm trying :3 I already made different animations for each count of logs. I mean: it must be 5 cells in inventory of my storage only for logs. When i place 1 stack in the first cell, animation must change to new, and when i place 2 stack, animation change to new 2. Maybe it will be like the analog - beebox, but player cannot see inventory of beebox, he can only take honey.Thank your for container Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 6, 2015 Author Share Posted July 6, 2015 animations Link to comment Share on other sites More sharing options...
Mobbstar Posted July 6, 2015 Share Posted July 6, 2015 @CatalystWtrclr local function UpdateAnim(inst) --make a function for this stuff! local numlogs= 0 --zero logs so far for _, item in pairs(inst.components.container.slots) do --for every tile... if item and item.prefab == "log" then --if that tile has logs numlogs = numlogs + 1 --add a log to the counter end end inst.AnimState:PlayAnimation("idle" .. numlogs) --assuming your animation names are "idle0", "idle1", etc.end [...] --this next bit goes to the main function "fn", you know the deal inst:ListenForEvent("itemlose", UpdateAnim) inst:ListenForEvent("itemget", UpdateAnim) Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 6, 2015 Author Share Posted July 6, 2015 @CatalystWtrclr local function UpdateAnim(inst) --make a function for this stuff! local numlogs= 0 --zero logs so far for _, item in pairs(inst.components.container.slots) do --for every tile... if item and item.prefab == "log" then --if that tile has logs numlogs = numlogs + 1 --add a log to the counter end end inst.AnimState:PlayAnimation("idle" .. numlogs) --assuming your animation names are "idle0", "idle1", etc.end [...] --this next bit goes to the main function "fn", you know the deal inst:ListenForEvent("itemlose", UpdateAnim) inst:ListenForEvent("itemget", UpdateAnim) i tried itWhen I place logs in container or take them sprite-storage disappears and arises again with default animation ("empty") Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 6, 2015 Author Share Posted July 6, 2015 oops. my mistake. I love you Mobbstar. Thank you, animation changes! Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 7, 2015 Author Share Posted July 7, 2015 scripts is ready.Last question for this mod:I made cells in prefab file (= 5), but how to create animation for background in Spriter? Link to comment Share on other sites More sharing options...
Mobbstar Posted July 7, 2015 Share Posted July 7, 2015 scripts is ready.Last question for this mod:I made cells in prefab file (= 5), but how to create animation for background in Spriter? You don't do that in spriter, you tell the game what image to use. Other containers do that too. (usually the images are called "something_1x5") Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 7, 2015 Author Share Posted July 7, 2015 You don't do that in spriter, you tell the game what image to use. Other containers do that too. (usually the images are called "something_1x5")so... build renamer?ui_chest_3x3 as example has anin and build. i tried to import texture with help of TexTools and Build Renamer, but in game it doesn't work Link to comment Share on other sites More sharing options...
Mobbstar Posted July 7, 2015 Share Posted July 7, 2015 so... build renamer?ui_chest_3x3 as example has anin and build. i tried to import texture with help of TexTools and Build Renamer, but in game it doesn't work As clearly seen by above statement, I have no idea what I'm even doing.The anim zip has an atlas-0.tex that can be edited using the tex tools. Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 7, 2015 Author Share Posted July 7, 2015 As clearly seen by above statement, I have no idea what I'm even doing.The anim zip has an atlas-0.tex that can be edited using the tex tools.yeah, i know it. I edited atlas, used build renamer, but game doesn't see my texture. I tried create zip using Spriter but result is the same. I'll try again, maybe i made mistake somewhere.Thank you Mobbstar for your help. Now prefabs for me is no dark forest Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 8, 2015 Author Share Posted July 8, 2015 Mod released. log_storage.zipSteam Workshop: http://steamcommunity.com/sharedfiles/filedetails/?id=477723360 New storage for your logs. Especially thanks Mobbstar from Klei forum for help. This storage ONLY for logs, you cannot store any items. The storage has 5 slots for 5 stacks of log. For every slot used different animation Recipe: 2 boards+1flint (need Science Machine). About ideas for this, bugs, crashes or mistakes please report in this topic or in comments Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 18, 2015 Author Share Posted July 18, 2015 How i can do less spaces between log storages? Chests builded too closely. i didn't find this value in prefab Link to comment Share on other sites More sharing options...
Kzisor Posted July 18, 2015 Share Posted July 18, 2015 @CatalystWtrclr, It's the sixth (6th) parameter you send to Recipe. Link to comment Share on other sites More sharing options...
CatalystWtrclr Posted July 18, 2015 Author Share Posted July 18, 2015 @CatalystWtrclr, It's the sixth (6th) parameter you send to Recipe.can you tell more about this? I have not seen parametr sixth hm. It's in modmain? PrefabFiles = {"log_storage",} Assets = {Asset("ATLAS", "images/inventoryimages/log_storage.xml"), Asset("ATLAS", "minimap/log_storage.xml" ), } STRINGS = GLOBAL.STRINGSRECIPETABS = GLOBAL.RECIPETABSRecipe = GLOBAL.RecipeTECH = GLOBAL.TECHIngredient = GLOBAL.Ingredient if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then GLOBAL.additionalstructuresDLC0001 = "enabled"elseGLOBAL.additionalstructuresDLC0001 = "disabled"end local log_storage = GLOBAL.Recipe("log_storage",{ Ingredient("boards", 1), }, RECIPETABS.TOWN, TECH.SCIENCE_ONE, "log_storage_placer" ) log_storage.atlas = "images/inventoryimages/log_storage.xml" AddMinimapAtlas("images/inventoryimages/log_storage.xml") Link to comment Share on other sites More sharing options...
Mobbstar Posted July 18, 2015 Share Posted July 18, 2015 can you tell more about this? I have not seen parametr sixth hm. It's in modmain? PrefabFiles = {"log_storage",} Assets = {Asset("ATLAS", "images/inventoryimages/log_storage.xml"), Asset("ATLAS", "minimap/log_storage.xml" ), } STRINGS = GLOBAL.STRINGSRECIPETABS = GLOBAL.RECIPETABSRecipe = GLOBAL.RecipeTECH = GLOBAL.TECHIngredient = GLOBAL.Ingredient if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then GLOBAL.additionalstructuresDLC0001 = "enabled"elseGLOBAL.additionalstructuresDLC0001 = "disabled"end local log_storage = GLOBAL.Recipe("log_storage",{ Ingredient("boards", 1), }, RECIPETABS.TOWN, TECH.SCIENCE_ONE, "log_storage_placer" ) log_storage.atlas = "images/inventoryimages/log_storage.xml" AddMinimapAtlas("images/inventoryimages/log_storage.xml") in data/scripts/recipe.lua it says: Recipe = Class(function(self, name, ingredients, tab, level, placer, min_spacing, nounlock, numtogive) min_spacing is the one you want (a ground tile is 4 wide) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.