Jump to content

Recommended Posts

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

you take a item and remove the item component.

 

then you can add obstacle physics

or lootdropper & workable for hammering

and 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 by Mobbstar

you take a item and remove the item component.

 

then you can add obstacle physics

or lootdropper & workable for hammering

and 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 :с 

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"

you take a item and remove the item component.

 

then you can add obstacle physics

or lootdropper & workable for hammering

and 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!

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 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...