Override base game static mesh
As the title says, I'm trying to figure out how to replace a base game static mesh with a custom one, but I can't seem to find a way to do this in the documentation.
Is this not possible, or am I just being dumb?
84 Replies
Do you want to replace any mesh in particular? In some cases (e.g. items), it might be easier to accomplish
My specific end goal is to replace the collisions of the locomotive.
As far as I can tell, the collisions of the locomotive are attached to
FactoryGame/Buildable/Vehicle/Train/Locomotive/Mesh/SM_Locomotive_LOD4
, which is a static mesh.
If you check the Locomitive BP, it has a Skeletal Mesh component for the actual train object, and then SM_Locomotive_LOD4 as a LOD object and for the collisions.
I've already reimported SM_Locomotive_LOD4 and was able to verify that the collisions on the placeholder object do match the ones in game
And I've already edited the collisionsAh, you can use a CDO edit to replace the collision mesh
https://docs-dev.ficsit.app/satisfactory-modding/latest/Development/BeginnersGuide/overwriting.html#_use_cdo_manipulation
In the
Dev
branch of the modding repo, there's an example of a CDO edit in ExampleModI'm not sure I'm quite following.
I've been to that page on the docs, and didn't really understand how to actually use CDOs
I'm just gonna work my way through the project setup section of the docs for a 2nd time, and make sure I got everything in there
Yeah, I definiteley missed a bit there lol
The CDO (Class Default Object) works as a "template", and stores the default values used when spawning objects of a given class.
The idea of a CDO edit is to change the values in a CDO, so that objects get created with different initial values
What I'm not understanding is how does one actually set up a CDO modification?
Just in general, I flat out don't understand what I'm supposed to do.
Do I need to copy the base game file to my mod?
Is it all done within some Blueprint?
If so, what kind of Blueprint and where?
It is done in code
Right, I've never used C++ in UE5
Code can be Blueprint too
Time to read the C++ documentation then
Ah, I have this screenshot
Yeah, but where is that BP
how do I set it up?
Make a Game World Module (docs explain how), and in there you should be able to override a function
Could also be a Game Instance Module
I... miseed the fact the root game object had a full BP editor
Look, it's been a while since I used UE5 lmao
It's OK, it happens. Good to know, though: I'm pretty sure it's a rather common pitfall, especially for newcomers
Oh for sure, might be worth appending something about it to the docs?
I mean I've been using UE as a hobby since UE4 became available to the public (back when you actually had to subscribe to use it)
I just forgor π
Yes, if you have any ideas feel free to PR any fixes/improvements
This button brings you to the GitHub repo where docs are, and from there you can edit the page
π
Done
Anyways, back to BP editing
This isn't working, do you see any reason why it wouldn't work?
You should save the CDO in a variable so that it persists
And I'm not sure if the "Set Static Mesh" node is succeeding, might be worth adding a log message
(Log Display)
Yep, it ain't going through:
I'm assuming that means I'm gonna learn about Access Transformers now
It just means that
Set Static Mesh
didn't work, no idea whyWhat about the warning above?
LogSatisfactoryModLoader: Warning: Blueprint /BetterTrainCollision/RootGameWorld_BetterTrainCollision, owned by BetterTrainCollision, is accessing CDO of class /Game/FactoryGame/Buildable/Vehicle/Train/Locomotive/BP_Locomotive.BP_Locomotive_C, owned by FactoryGame
That warning is expected
Aight
It just means you called
Get Class Default Object
on something that's not part of your modFair
Which is not an issue, but can cause surprises (e.g. mods changing values on things without documenting it)
Ah, you might need to temporarily change the component's mobility to Movable
The component I'm trying to change is movable by default
Either the mesh was the same or mobility wasn't good
Might be that the mesh component in the CDO still has static mobility, might be worth testing
Could this be relevane:
Mount point: '../../../FactoryGame/Mods/BetterTrainCollision/' is not mounted to a valid Root Path yet, assets in this pak file may not be accessible until a corresponding UFS Mount Point is added through FPackageName::RegisterMountPoint.
No
Changing the mobility to movable did not fix it
It's also not gonna be the fact that it's the same exact mesh just with different collisions, cause the Uobject still has a different name, location, and data to the original
UObject*
-# Responding to
objectnaming
triggered by @The Urban GooseYeah, I don't get it, it's just not working
Dunno what else to do here
And set static mesh only outputs true of false, so I don't really have any idea why it's not working
Yeah, I've got absolutely no fucking clue how to continue here.
There are no functions that allow direct manipulation of the collisions, replacing the static mesh that actually has the collisions on it just doesn't work, and there is no way to get anything even remotely useful out of the logs.
you will need something to detect when a train gets built or one loads in from the save file
I think you could either hook begin play or use an SCS component hook to add your own component that does the mesh re-apply
I am not sure if one would be better than the other, per-say, but I'd say try the SCS hook because I think it will deal with both the "new train" and "existing train loaded from save" cases easily
ExampleMod and Vampirism have examples of using SCS hooks
>docsearch SCS hook
I encountered an error while trying to call this command. The error has been logged, sorry for the inconvenience.
:feynoooo:
Simple Construction Script (SCS) Hooks :: Satisfactory Modding Docu...
Introduced in SML3.5, Blueprint Simple Construction Script hooks allow adding modded Components to any blueprint-based actor. Mods can def...
SCS hook would be reasonable, I'm not sure if it'd run when placing the train as a hologram but it shouldn't matter anyway
if I recall correctly for your use case the mesh doesn't matter at placement time, you want to be able to stand on the side of trains, right?
The train hologram shouldn't have the SM component I'm trying to replace
Yeah, the hologram is it's own separate BP
Not actually sure about that one, now that I looked at it again, still figuring out how everything works
It shouldn't be a problem
Yeah, from what I can see it should be fine
Where in the example mod is the SCS hook?
root instance module data (Blueprint SCS Hooks)
Ah, got it
This is... something
The SCS hook is loading the components and reporting they're owned by the locomotives
your component will probably want to look at its owner, cast that to the train, check the mesh to make sure it's actually the vanilla train mesh and not a modded subclass, then change the mesh
Yes, this worked perfectly
Solution
excellent
is there a QA site post about it? you could link your mod in the comments there
I made one and didn't get any upvotes lmao
Still, link to it anyway for visibility
Will do
link it here and I will upvote it lol
For context:
1st image is the collisions as they are in 1.0, 2nd image is the collision model that still is in the game files
They just added a collision around the collision model
I just went in and removed that
I wanna be able to stand on the side of the engine
I wonder if it's to have a convex collision mesh
Or simplify collision checks in some way
Probably, but it also means that my trains are now too big for my tunnels
(and it did work in previous versions)
Eh, doesn't matter, I fixed it now
Thanks a ton for your help! (both of you)
thanks for making the mod, I was bothered by the mesh change in game too but clearly not bothered enough, haha
I'll send the link once I release it (gotta go afk for a moment)
https://questions.satisfactorygame.com/post/66f3bf1a772a987f4a8d02ed
This should be good to release without MP testing, right?
(I'm gonna test it later tonight, just making sure)
Yeah... should be fine
Anyways, here we go:
https://ficsit.app/mod/BbJ6Lgfs6d6Jno
Better Train Collision - SMR
Makes train locomotive collisions more accurate.
(Also is it intended that #mod-updates skips the initial release of mods?)
it isn't, I think you just got Digby'd (in-server term for #mod-updates not working for some reason, it happens unusually often to digby in specific)
F
The mod is so simple I don't think it'll ever need updating lmao
you might for multiplayer, but probably not since you used scs hooks
you should publish source π π
Creating a Git Repo for your Mod :: Satisfactory Modding Documentation
Once you have started working on a mod of your own, you should set up a repository to store your modβs files. This page walks throug...
That is a fair shout
I just switched back to Linux though ;-;
Gotta reboot again lol
then we can get this added as a mod that uses SCS hook to the examples
https://docs.ficsit.app/satisfactory-modding/latest/Development/OpenSourceExamples.html
Open Source Examples :: Satisfactory Modding Documentation
Itβs impossible for this documentation to cover every aspect of making Satisfactory mods. However, there are quite a few open-source m...
Fair enough, I'll brb once I'm on Windows
In that case I'll just go over everything, make it look nice and pretty, and add some comments
not urgent, you just rebooted after all
Eh, not doing anything else right now
(this also gives me an excuse to push an update lol)
Update pushed, source code released
@Robb (Nowβ’)
GitHub
GitHub - zuliwa/BetterTrainCollision: Satisfactory mod to change th...
Satisfactory mod to change the collision model of Locomotives - zuliwa/BetterTrainCollision
sweet, could you write a brief summary in this style about what features you used? I can deal with formatting it if you don't want to
Just in here?
here or a PR, whatever's easiest for you
docs repo is asciidoc (plain text editable) and already has a devcontainer if previewing it interests you
I'll have a look, gonna get the thing typed up in notepad++
I'll see if I can be bothered to do the formatting :P
This look ok?
yup, will add that on my side now
thanks