Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ asciidoc:
attributes:
# Increase max table of content nesting levels from 2 to 3 https://docs.antora.org/antora/latest/page/page-attributes/#access-attributes-from-ui-template
page-toclevels: 3@
# Non-breaking space to avoid being split across lines
non-breaking-space:  
# Zero-width joiner (U+200D) to avoid being split across lines
zero-width-join: ‍
# Uses zero-width joiner (U+200D) to avoid being split across lines
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"adoc",
"afgitemdescriptor",
"alpak",
"Alpaking",
"Alpakit",
"Anthor",
"antora",
Expand Down
1 change: 1 addition & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exclude = [
"https://dev.epicgames.com/",
"^https://www.unrealengine.com/en-US/blog/.*",
"^https://www.epicgames.com/help/.*",
"https://www.audiokinetic.com/en/",
# Times out despite being valid
"https://www.adobe.com/learn/substance-3d-designer/web/the-pbr-guide-part-1",
# Pages often time out and Shouldn't™ ever get deleted anyways
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/CommunityResources/AcronymVault.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ https://github.com/satisfactorymodding/SMEI[here].
Simple Construction Script is Unreal Engine's solution for building actor component trees.
You can find it in the top left corner of the blueprint editor, looking like a tree of the components.

SML provides hooks for adding modded components to the Simple Construction Scripts of the base game blueprints.
SML provides hooks for adding modded components to the construction scripts of the base game blueprints.
Documentation on the hooking system can be found
xref:Development/ModLoader/SimpleConstructionScript.adoc[here].
xref:Development/ModLoader/ActorMixins.adoc[on the Actor Mixins page].

=== Frequently Asked Questions (FAQ)

Expand Down
27 changes: 14 additions & 13 deletions modules/ROOT/pages/Development/BeginnersGuide/SimpleMod/item.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It will look like a flatscreen television.

== Creating a Folder for our Item

Items (and fluids) in Satisfactory are described by
Items (and fluids) in Satisfactory are defined by
xref:/Development/Satisfactory/Inventory.adoc#_item_descriptor_ufgitemdescriptor[FGItemDescriptor]s,
which contain information on their appearance and properties.
They often also come with textures (to define their icons), meshes, and materials (to define their in-world appearance).
Expand Down Expand Up @@ -42,13 +42,13 @@ You can hover over the left side of a field to get a tooltip describing its purp
M Display Name::
The item's name in game, which appears in its tooltip and what it is called in the Codex.
{blank} +
We'll set this to "Doc Item".
We'll set this to `Doc Item`.
* {blank}
+
M Description::
A description of the item, which appears in its tooltip and the Codex.
{blank} +
In our case, we can use the text "This is the starter item of the Doc mod."
In our case, we can use the text `This is the starter item of the Doc mod.`
* {blank}
+
M Abbreviated Display Name::
Expand All @@ -58,7 +58,7 @@ M Abbreviated Display Name::
In the base game, this is usually only set for items that are difficult to distinguish,
for example, raw ores and ingots.
{blank} +
We can leave this blank, or use "DocI".
We can leave this blank, or use `DocI`.
* {blank}
+
M Stack Size::
Expand Down Expand Up @@ -88,21 +88,21 @@ M Energy Value::
You can find the fuel values of vanilla items on the https://satisfactory.wiki.gg/wiki/Category:Fuels[wiki].
Note that if you want your item to qualify as a biofuel for the Biomass Burner, you should subclass `FGItemDescriptorBiomass` instead.
{blank} +
Our Doc Item won't be a fuel item, so it shouldn't be able to get burned in any generators, so we'll use 0.0 for that value.
Our Doc Item won't be a fuel item, so it shouldn't be able to get burned in any generators, so we'll use `0.0` for that value.
* {blank}
+
M Radioactive Decay::
If set to a value greater than 0, the item will cause the player to take radiation damage.
The editor tooltip for this field is incorrect - values can seemingly be any value greater than 0.
For example, Plutonium Waste (most intense in Vanilla) uses a value of 200, and Encased Uranium Cell (least intense) uses 0.5.
{blank} +
We'll leave this at 0 for safety while testing our mod.
We'll leave this at `0` for safety while testing our mod.
* {blank}
+
M Form::
Defines the type of this item: Invalid, Solid, Liquid, Gas, or Heat
{blank} +
Our new item should be a Solid for ease of testing.
Our new item should be a `Solid` for ease of testing.

[WARNING]
====
Expand Down Expand Up @@ -150,7 +150,7 @@ M Small Icon::
// Links to GH hosted image because cloudflare serves it as a webp -> can't be imported to Unreal
We have an image ready for use
link:https://raw.githubusercontent.com/satisfactorymodding/Documentation/master/modules/ROOT/attachments/BeginnersGuide/simpleMod/Icon_DocItem.png[here].
You can import it in the Content Browser pane via `Add/Import > Import to...`.
You can import it via the Content Browser right click menu, or via the `Import` button in the Content Browser header.
* {blank}
+
M Big Icon::
Expand Down Expand Up @@ -209,7 +209,7 @@ The process of importing meshes and textures has a couple extra details that we

=== Importing the Mesh

First, import the mesh (.fbx file) to your DocItem folder via `Add/Import > Import to...`.
First, import the mesh (`.fbx` file) to your DocItem folder via one of the Content Browser's Import features described earlier.
Select just the Mesh, and pay attention on the dialog that pops up.
Most of the default settings are fine, but scroll down to the Material section
and ensure that:
Expand All @@ -220,11 +220,11 @@ and ensure that:

To finish this dialog, select the `Import` option in the prompt.

You should rename the asset to `SM_DocItem` to follow Coffee Stain's naming scheme.
SM stands for Static Mesh.

image:BeginnersGuide/simpleMod/NoMaterialImport.png[image]

Next, rename the created asset to `SM_DocItem` to follow Coffee Stain's naming scheme.
SM stands for Static Mesh.

=== Creating the Material Instance

We chose to not import any textures with the model because we want to leverage the Unreal
Expand Down Expand Up @@ -295,7 +295,8 @@ In the "Global Static Switch Parameter Values" section, check the `bUseLegacyPai
In the bottom right corner of the preview viewport,
click on the flat panel icon to preview the material on a plane instead of a sphere.
If you've done everything correctly, it should look like the below image.
Note that no warnings appear in the top left of the viewport.
Note that no warnings appear in the top left of the viewport,
just some statistics about the material.
Afterwards, save the asset.

image:BeginnersGuide/simpleMod/MaterialInstanceSettings.png[image]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,39 @@ Second, add a xref:Development/Satisfactory/PowerNetwork.adoc[FGPowerInfo] compo
If we had used one of the other types of base machine classes, these may have existed automatically, but since we chose FGBuildable, we need to add them ourselves.


== Init logic
[id="Code_BeginPlay"]
== Initialization Logic in Begin Play

The init logic happens in the `BeginPlay` event and initializes the base state of the machine (also based on the save information).
There is not that much we need to do here.
The only thing we need to do is to set the PowerInfo on the PowerConnection and configure the target consumption of the `FGPowerInfo` to something like 1.0.
This controls how much power in MW the building will use to operate.
The BeginPlay event is fired when the building spawns into the world, be it placed for the first time or loaded from the save file.

For our counter building, it needs to:

- Set what PowerInfo component the PowerConnection component should use
- Set how much power, in MW, the building should consume to operate.
This is done by using Set Target Consumption on the FGPowerInfo to some positive number.

We don't need to adjust anything else here
because the building's default values will already have been set from the blueprint class's Class Defaults.

.Logic in the Event Graph
image::BeginnersGuide/simpleMod/machines/SimpleMachine_Init.jpg[image]

[NOTE]
=====
Make sure to check out the
xref:Development/UnrealEngine/UnrealLearningResources.adoc#UnrealBlueprint[Unreal Learning Resources section: "Blueprint Scripting"]
for more information on how to write blueprint code.

Of particular note is the "Blueprint Editor: Graph Editor" document linked from there.
=====

[id="Code_Grab"]
== Grab Logic

[WARNING]
====
It is generally unwise to implement conveyor grab logic in Unreal Blueprint code as the tutorial does here.
If you plan for your buildings to be used in any substantive quantity,
If you plan for your buildings to be used in any substantial quantity,
you should implement this logic in C++ to avoid the performance overhead of Blueprint.
This tutorial will eventually™ be replaced with another one following better practices.
====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Next, let's add our recipe to a schematic to make it available in game.

Schematics are what Satisfactory uses to grant recipes and capabilities to the player.
Schematics are the milestones you'll see in the HUB,
the Tier 0 tutorial phases, M.A.M researches, alternate recipe researches, and more.
the Tier 0 tutorial phases, M.A.M researches, Hard Drive scan result options, AWESOME Shop purchases, and more.
If the player is unlocking an item, building, or any recipe, it's probably be granted by a schematic.

Go to the Content Browser in the Unreal editor.
Expand Down Expand Up @@ -270,6 +270,7 @@ M Schematic Icon::
// Links to GH hosted image because cloudflare serves it as a webp -> can't be imported to Unreal
Set both this field and `M Small Schematic Icon` to
https://raw.githubusercontent.com/satisfactorymodding/Documentation/master/modules/ROOT/attachments/BeginnersGuide/simpleMod/Icon_SchemDoc.png[this example image].
You can bring the image into the project by downloading it somewhere, then right clicking in a Content Browser and using `Import to /...`.
* {blank}
+
M Cost::
Expand Down
49 changes: 41 additions & 8 deletions modules/ROOT/pages/Development/BeginnersGuide/dependencies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,56 @@ Launch the game at least once to ensure all files get set up correctly.

== Visual Studio

Visit the https://visualstudio.microsoft.com/downloads/[Microsoft Visual Studio downloads page]
and select the button for Visual Studio 2022 Community, which is free of charge.
// Visit the https://visualstudio.microsoft.com/downloads/[Microsoft Visual Studio downloads page]
// and select the button for Visual Studio 2022 Community, which is free of charge.

Unreal Engine's build tools use MSVC (Microsoft Visual {cpp})
and have good integration with the Visual Studio,
a free of charge integrated development environment (IDE).

If you already have Visual Studio installed,
you'll need to run installer again and follow the steps below to modify your existing installation.

[IMPORTANT]
====
This version of Satisfactory works best with Visual Studio _2022_,
not the latest release version 2026.

If you were to proceed with Visual Studio 2026 installed,
you would have to select different Components than the ones we listed here,
and certain editor functionalities like the Create {cpp} Class wizard will not work.

To download 2022, either click
link:https://aka.ms/vs/17/release/vs_community.exe[here to directly download the Visual Studio 2022 Community installer from Microsoft],
or visit the
link:https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#evergreen-bootstrappers[Release and Build History page heading "Evergreen Bootstrappers"]
to download the "Community" channel bootstrapper for Version 17.14 (which is the exact same link we provided above).
====

After the installer has downloaded, run it and agree to any authorization prompts you receive along the way.
Once you are prompted to install Visual Studio 2022
you have two options for selecting the relevant components.

[id="ImportConfiguration"]
=== Option 1: Import an Installer Configuration

If the installer took you directly to the Workflow or Component selection screen
you'll have to use the smaller X button in the top right to close out of that prompt first.
// If the installer took you directly to the Workflow or Component selection screen
// you'll have to use the smaller X button in the top right to close out of that prompt first.

Instead of clicking "Install" next to Visual Studio 2022,
click the 'More' dropdown and select `Import Configuration`.
If the option does not appear, make sure that your existing installation is not "pending"
by allowing it to finish installing.
Because the Visual Studio installer really wants you to install 2026 instead of 2022,
this approach requires you to do a small workaround.

When the installer first opens, use its default settings to install Visual Studio 2022.
If you were to close out of this prompt, only the option to install 2026 will be provided,
and you'd have to close and reopen the installer to get it again.

After the installer completes, open it again and use the "More" dropdown on Visual Studio 2022's entry
to select `Import Configuration`.

// Instead of clicking "Install" next to Visual Studio 2022,
// click the 'More' dropdown and select `Import Configuration`.
// If the option does not appear, make sure that your existing installation is not "pending"
// by allowing it to finish installing.

// cspell:ignore vsconfig
Download link:{attachmentsdir}/BeginnersGuide/dependencies/SML.vsconfig[this configuration file]
Expand All @@ -81,6 +111,9 @@ search for and select:
- `.NET 6.0 Runtime (Out of support)`
- `.NET Framework 4.8.1 SDK`

Note that even though some of these components are marked as "Out of Support",
they are the versions that Satisfactory and Unreal use, so you must use them.

=== While Visual Studio Installs

Downloading and installing Visual Studio can take a while.
Expand Down
36 changes: 24 additions & 12 deletions modules/ROOT/pages/Development/BeginnersGuide/overwriting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,6 @@ To perform a CDO edit,
first obtain the class default object of the class you're trying to override
then use setter functions or directly modify values of the relevant properties.

Keep in mind that when modifying properties on a CDO,
you're not changing anything on _existing_ object instances -
you're only changing the template.
Depending on what kind of content you are modifying and when your code performs the edit,
some instances may have already been created using the old CDO values.
For example, buildings already placed in the save file load in earlier than some mod code executes.

Your code may also need to fetch all existing instances of the class
and modify their values too to ensure they match your new desired value.
Performing your CDO modifications earlier in the mod loading process can sometimes remove the need for this extra step.

When performing CDO manipulation, you must keep a reference to the CDO in memory
to ensure that Unreal does not garbage collect your patched object (and its descendants) and later load it unmodified from disk, undoing your change.
To do this, you need to reference the CDO in a property.
Expand All @@ -68,6 +57,29 @@ Be mindful when modifying class default objects as you can break other mod and v
For safety and troubleshooting reasons, SML's helper function logs a warning when you access a class not owned by your mod.
====

[id="Cdo_Timing"]
==== Timing

CDO edits must be performed at the correct time during the game lifecycle
depending on what data they need and what content they are trying to modify.
A CDO edit performed at an inopportune time can appear to work but result in unusual edge case behavior.

Keep in mind that when modifying properties on a CDO,
you're not changing anything on _existing_ object instances -
you're only changing the template.
Depending on what kind of content you are modifying and when in the game lifecycle your code performs the edit,
some instances may have already been created using the old CDO values.
For example, buildings already placed in the save file load in earlier than some mod code executes.

Your code may also need to fetch all existing instances of the class
and modify their values too to ensure they match your new desired value.
Performing your CDO modifications earlier in the mod loading process can sometimes remove the need for this extra step.

For example, if you want control over if a CDO is performed via a xref:Development/ModLoader/SessionSettings.adoc[Session Setting],
you must perform the edit after that data is available, such as in a xref:Development/ModLoader/ModModules.adoc[Game World Module].
But that's after buildings that exist in the save file have already been created,
so you may need to fetch and modify those instances too.

[id="CdoLimitations"]
=== Understanding the Limits of CDO Edits

Expand Down Expand Up @@ -98,7 +110,7 @@ Set the property's value to be the CDO before manipulating the object. +
If you are modifying multiple CDOs, you can make the property an array of objects instead, and add each CDO to the array.

====
Check out ExampleMod's `SubGameWorld_ExampleMod_SchematicCdoEdit` for a code example.
Check out ExampleMod's `SubInstance_ExampleMod_SchematicCdoEdit` for a code example.
====

[id="CDO_Cpp"]
Expand Down
Loading
Loading