VovaFreeman Posted September 2, 2015 Share Posted September 2, 2015 I'm working on a global mod and have managed to create a variety of items. However, for further advancement I need to create structures. At the forum I could not find these guides, which describe in detail the whole process and all you need to do this. Attempts to create a structure always ended unsuccessfully. I just need to know what to write in the configuration files specifically for structure, as well as the intricacies of animation. I would be grateful for any help. P.S. Sorry for my English :c Link to comment https://forums.kleientertainment.com/forums/topic/57587-help-what-it-is-necessary-to-create-structure-mod/ Share on other sites More sharing options...
Mobbstar Posted September 2, 2015 Share Posted September 2, 2015 (edited) you take a item and remove the item component. then you can add obstacle physicsor lootdropper & workable for hammeringand the tag "structure" so deerclops smashes it on purpose EDIT: honestly I don't see what you mean "configuration" and "animation". It's literally the same thing but without the item component. Everything else is up to you. Edited September 2, 2015 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/57587-help-what-it-is-necessary-to-create-structure-mod/#findComment-668866 Share on other sites More sharing options...
VovaFreeman Posted September 3, 2015 Author Share Posted September 3, 2015 you take a item and remove the item component. then you can add obstacle physicsor lootdropper & workable for hammeringand the tag "structure" so deerclops smashes it on purpose EDIT: honestly I don't see what you mean "configuration" and "animation". It's literally the same thing but without the item component. Everything else is up to you.About "configuration" and "animation" i mean, what is there of their conditions composes specifically for structures? Well, without which the structure itself will not work.I try to do as you say. I hope this time will work structure :с Link to comment https://forums.kleientertainment.com/forums/topic/57587-help-what-it-is-necessary-to-create-structure-mod/#findComment-669010 Share on other sites More sharing options...
Arkathorn Posted September 3, 2015 Share Posted September 3, 2015 Assuming that by "Structure" you mean a prefab in the world that is built from a crafting recipe, the process is fairly simple. Adding this line in your prefab's constructor will make a circular collision field around the prefab, with the specified radius: (You bump into it)MakeObstaclePhysics(inst, radius)On a side note, the radius is measured in world units, and for comparison the area dug by a pitchfork is 4x4 units. To make the prefab be placed in the world with the green tinted image upon crafting, you will need to do two things:First, after returning your prefab at the end of the file, add a comma, followed by: MakePlacer("yourprefab_placer", "animation_bank", "animation_build", "animation_name")In context: return Prefab("common/objects/yourprefab", fn, Assets, Prefabs), MakePlacer("yourprefab_placer", "animation_bank", "animation_build", "animation_name")The animation bank, build and name will need to be filled in manually. Usually, your bank and build will be the same, matching the name of your animation file, and the animation name will usually be "idle".The animation specified here will be the animation played in the green tinted image while placing the structure.Second, add "yourprefab_placer" as the fifth argument to your recipe: (In the example, your prefab is crafted using four pigskins and four twigs, in the magic tab, using the prestihatitator.AddRecipe("yourprefab", {Ingredient("pigskin", 4), Ingredient("twigs", 4)}, GLOBAL.RECIPETABS.MAGIC, GLOBAL.TECH.MAGIC_TWO, "your_placer", nil, nil, nil, nil, "images/yourprefab.xml", "yourprefab.tex")If you need more information on how to make simple prefabs and animations, I suggest Malacath's tutorial here. It is almost the same, except you will not need any of the swap animation things, and you will not need the "inventoryitem" or "equippable" components. Hopefully this answers your question, if not, please describe exactly the outcome in game that you are hoping to achieve. P.S. - The recipe tab labeled "Structures" is referenced by "GLOBAL.RECIPETABS.TOWN". The rest of the tabs can be found in "constants.lua" Link to comment https://forums.kleientertainment.com/forums/topic/57587-help-what-it-is-necessary-to-create-structure-mod/#findComment-669046 Share on other sites More sharing options...
VovaFreeman Posted September 3, 2015 Author Share Posted September 3, 2015 you take a item and remove the item component. then you can add obstacle physicsor lootdropper & workable for hammeringand the tag "structure" so deerclops smashes it on purpose EDIT: honestly I don't see what you mean "configuration" and "animation". It's literally the same thing but without the item component. Everything else is up to you.Hooray, I did it! But a couple of hours versed with the problem of the export of animation, but I decided it. Thank you! Link to comment https://forums.kleientertainment.com/forums/topic/57587-help-what-it-is-necessary-to-create-structure-mod/#findComment-669051 Share on other sites More sharing options...
VovaFreeman Posted September 3, 2015 Author Share Posted September 3, 2015 Assuming that by "Structure" you mean a prefab in the world that is built from a crafting recipe, the process is fairly simple. Adding this line in your prefab's constructor will make a circular collision field around the prefab, with the specified radius: (You bump into it)MakeObstaclePhysics(inst, radius)On a side note, the radius is measured in world units, and for comparison the area dug by a pitchfork is 4x4 units. To make the prefab be placed in the world with the green tinted image upon crafting, you will need to do two things:First, after returning your prefab at the end of the file, add a comma, followed by: MakePlacer("yourprefab_placer", "animation_bank", "animation_build", "animation_name")In context: return Prefab("common/objects/yourprefab", fn, Assets, Prefabs), MakePlacer("yourprefab_placer", "animation_bank", "animation_build", "animation_name")The animation bank, build and name will need to be filled in manually. Usually, your bank and build will be the same, matching the name of your animation file, and the animation name will usually be "idle".The animation specified here will be the animation played in the green tinted image while placing the structure.Second, add "yourprefab_placer" as the fifth argument to your recipe: (In the example, your prefab is crafted using four pigskins and four twigs, in the magic tab, using the prestihatitator.AddRecipe("yourprefab", {Ingredient("pigskin", 4), Ingredient("twigs", 4)}, GLOBAL.RECIPETABS.MAGIC, GLOBAL.TECH.MAGIC_TWO, "your_placer", nil, nil, nil, nil, "images/yourprefab.xml", "yourprefab.tex")If you need more information on how to make simple prefabs and animations, I suggest Malacath's tutorial here. It is almost the same, except you will not need any of the swap animation things, and you will not need the "inventoryitem" or "equippable" components. Hopefully this answers your question, if not, please describe exactly the outcome in game that you are hoping to achieve. P.S. - The recipe tab labeled "Structures" is referenced by "GLOBAL.RECIPETABS.TOWN". The rest of the tabs can be found in "constants.lua"This information is just what I need. Thank you!If I have questions, I'll ask them inapplicable :3 Link to comment https://forums.kleientertainment.com/forums/topic/57587-help-what-it-is-necessary-to-create-structure-mod/#findComment-669052 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