Resources (Nuggets) - yozozchomutova/AstroModdingKit GitHub Wiki

Creating new resource

I'll be creating dirt resource as an example. It will be obtainable using Soil Centrifuge.

Create new blueprint using CanisterResource (there is also BoxedResource, I don't know what are differences, smelted/composited resources are using this parent).

You will need to create/import these files:

  • Resource Item Type (Dirt) - Uses .../ItemType/CanisterResource parent blueprint.
  • Resource icon (ui_icon_nug_dirt) - Use reference or create & import your 256x256 image (white/transparent only).
  • Resource Nugget Model (ResourceNugget_DirtMesh) - Use reference or create your own nugget mesh.
  • Resource Nugget Material (MI_Resource_Nugget_Build_Dirt) - Use reference or create new Material Instance using parent M_Nugget_DualColor_Gradient_Build.
  • Resource Physical Form (ResourceNugget_Dirt, this one is actually placed in .../Items/Nuggets/, not in my UE mod folder) - Currently there's no way to create this through new blueprint in UE, rather take already existing nugget resource. (in my case this was ".../Items/Nuggets/NewResourcesPlaceholder/ResourceNugget_Wolframite.uasset + .uexp", that I've copied into my mod folder inside /Content/Items/Nuggets/. I've also created blueprint in UE (using ResourceNuggetFlecks as parent) in the same path location to create reference to the resource).
For future me (or anyone else resolving this issue): There is issue in resource created through ResourceNuggetFlecks blueprint. Exported asset has Item/ItemComponent that has missing delegates (Onchanged, PostDrained, OnDrained), that's probably the reason why game is crashing.

Your files should look like that:

image

Open Dirt and as you can see It's completely as Item Type:

  • Is Unrepackeable: True
  • Pickkup Actor: Resource physical form. (In my case It's ResourceNugget_Dirt)
  • Catalog Data: Item Catalog Data

and other variables are up to you, you can take inspiration:

image

MI_Resource_Nugget_Build_Dirt is simple task aswell. You will just play with the values. (You should leave Fullness and Fill Offset on 1 by default)

image

Now probably the hardest part: ResourceNugget_Dirt Open that asset using UAssetGUI and you only need to edit values inside Name Map, nothing else.

image

  • 0 - Path to your mesh (In my case /Game/Mods/Yzch/DirtResource/ResourceNugget_DirtMesh)
  • 1 - Path to self/currently opened file (In my case /Game/Items/Nuggets/ResourceNugget_Dirt)
  • 5 - Path to nugget material instance (In my case /Game/Mods/Yzch/DirtResource/MI_Resource_Nugget_Build_Dirt)
  • 33 - Default + class of self/currently opened file (In my case Default__ResourceNugget_Dirt_C)
  • 55 - Material instance name (In my case MI_Resource_Nugget_Build_Dirt)
  • 73 - Mesh file name (In my case ResourceNugget_DirtMesh)
  • 74 - Class of self/currently opened file (In my case ResourceNugget_Dirt_C)

Don't forget to integrate your resource (Dirt into .../MasterItemList) to game and I recommend DEBUGX by GDutch to spawn your resource, if you don't have any other way.

image

Creating new resource (Gas)

TODO

Creating new ore deposit

NOTE: Currently there's no simple way for spawning deposits on your own locations with own settings. You can only replace already existing deposits.

TODO

Creating new nugget model

Model preparation

Using FModel export for example compound 3D model (located /Content/Items/Nuggets/Buildable/ResourcNugget08_static) as starting point. Then import it to the blender or any other program you are using for modelling. As material assign texture image - evo modern.

Go to edit mode and remove all compound nuggets/cells or separate them from slot vertices. (You can use compound nuggets to help you with sizing) Everything you make will be inside that slot mesh, don't create any new meshes.

image

And you're ready for creating new nuggets, but before that It's important to understand how nuggets work generally.

How nuggets works

Visibility of every single nugget is controlled by item Fullness item property (you can see that parameter in nugget material instance aswell). Fullness in material is something like vertical position of color/transparency border, 1 = full up/color/all nuggets visible, 0 = full down/transparency/all nuggets invisible. (Fullness of 0.8 will give bottom 80% of color and 20% in upper part will be transparency). All nuggets/cells have their own individual UV map and all of their vertices are flattened. They are sorted, so the top one is first bit (dssappears as first) and bottom is last bit (disappears as last).

image

Example: Once you put resource into Smelting Furnace, Fullness will gradually go down (from 1 to 0) and in texture transparency will go from top to bottom. Here's image of how Fullness of 0.8 would look like:

image

Assembling new nuggets

Now you make your first nugget shape (in my case It's cone) and once you're done, you generate UV maps, flatten It's UV vertices and place it somewhere at the bottom. (Also don't make it too wide, fit it inside the borders)

image

Duplicate nugget shape and always move their UV maps (make space between them by +0.01 for example) Repeat until you're done.

image

image

Now, last thing that needs to be done, is to take all UV maps from our nuggets and scale them on Y axis to cover whole fullness area.

image

If you are done like this, you can now export your model (for Blender users, select your mesh and then export as .FBX with Selected Only box checked) and import it to unreal engine.

You can use that to create resource or any other item as you wish.