How to detect when the player is in a hypertube and overlay a blacking-out effect on the camera
Okay, so I'm making a mod, it's my first time modding this game, and like the title says, I want to add a black-out effect, like a fighter pilot experiences, and similar to the damage vignette, whenever the player is in a hypertube.
The reason for this is basically that I've discovered that hypertube launchers - and especially the type I'm designing - create a fairly serious photosensitive epilepsy risk. It turns out that dimming the screen can fix this issue, and I think that doing this with a black-out effect is a) cool, b) kinda funny that the hypertubes are so intense for the pioneer and c) makes sense in-universe.
I have already made a suitable effect texture. I just need to know how to detect the hypertube and overlay the texture.
I'm quite comfortable with both blueprints and C++, so whatever is the simplest way to achieve this is better for me.
Once I've got that working I'll look for some advice about what resolution to make the texture, but that's just implementation details at that point.
87 Replies
Hypertubes use a custom movement mode. You can use a blueprint SCS hook (look in docs) to bind an event on "movement mode changed" to check if entering/exiting a hypertube. You can look at SirDigby's Flashlight Settings mod to see how most of this is done (I overhauled the mod a while ago, so I know how the system works).
As for the overlay, use a post-processing material.
>docsearch scs hooking
This is the best result I got from the SMD :
https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/SimpleConstructionScript.html
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...
Thanks so much, I'll get to work on this and let you know if I have any more questions!
You might want it to only trigger when the player has entered or exited multiple times in a short timespan, so regular tube travel is unaffected
Flashlight Settings does detection on hypertube enter/exit
Yup, I'll consider that, but also I kind of like the idea that hypertube travel is just inherently unpleasant and traumatic. The other thing is, it needs to trigger immediately so I have some time to fade it in and you don't spend any time with the flashing, so I can't wait to detect whether there are multiple entrances. The simplest way to do it would be to trigger it on any hypertube entrance, then slowly fade it out after a delay or after exit. That would have the same effect.
Hey folks, so I've got my mod loaded and the configs and everything show up in the main menu, which is great. I'm now trying to copy the logic from the flashlight mod, which means I've essentially just copy-pasted the relevant parts of the blueprint and accepted the editor's offer to create matching functions for the ones that are being called. Now, I have no understanding of what this is doing or how to replicate any of this myself. I was just hoping the naive approach of copy-paste would get me to minimum functionality. I've now added at the end of the code block a print text function which should show a message on screen, although I don't know if what I've got is correct. Can anyone tell me if this should work? Currently when testing this in-game I see nothing. I just need to know how to print a message on-screen to verify that I'm capturing the right events.
Also when I say I have no understanding, I can follow the logic, but I don't know how to make the functions or the events myself. The custom event block is a bit of a mystery to me, and I assume the functions are C++ functions perhaps? It's all quite opaque to me right now.
So when I say the Movement Mode Changed event is mysterious, when I copy-paste this event or make my own custom event, the details I see when it's selected look like this:
But the details I see for the same event in the flashlight mod look like this:
So they look completely different, and I don't know why. I don't know how that event was created and how to replicate that, or even if I need to.
Actually I think I've found the relevant docs, I'll update this when I'm done.
Okay, the docs weren't very helpful but I have also found this flashlight C++ class, is this something I need to look at? Sorry, I just don't know where to look at all right now:
Try using https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/BlueprintInterface.html#_logging instead of Print Text. Those nodes are independent from the Debug/Release build modes.
Blueprint Library :: Satisfactory Modding Documentation
The most up to date information about SML blueprint library functions is the header files present in the source code. This page may fall b...
You can click on the functions in Flashlight Settings to see their implementation. IIRC
Get Mod Config Bool
is basically a helper function, and Is Hyper Pipe Enter
contains the logic to detect when the movement mode has changed to "hyper tube travel". You have to copy those functions too
Also, you need to bind the "movement mode changed" event. Otherwise it will never get calledYeah, that's the thing that I'm struggling with with the event. How do I configure it correctly and bind it etc? I don't see how to replicate what I see in the flashlight. Also with the functions, how do I copy them? If I just accept the editor's offer to copy them, is that enough?
Okay, so I've discovered the "goto definition" option in the blueprint designer. There I can see that the automatically copied function only copies the signature of the original, but the logic is missing, so I need to go in and manually copy the logic across.
And for now it looks like I can just replace that get mod config function with a true value, just to get minimum functionality.
Yes, get mod config stuff you can just use a boolean true
But for the other thing, you need to copy the function as well
Okay, is there a good starter tutorial for blueprints? Because I feel like I'll be bugging you over every little thing I encounter otherwise.
But the new error I'm getting is this:
Here's the text so it's searchable for later: The property associated with Char Player could not be found in '/HypertubeBlackout/HypertubeBlackout_Comp_Effect.HypertubeBlackout_Comp_Effect_C'
I think that's the first error, I'm not sure.
Sorry, again I think I'm posting a little too fast. I'm searching it up.
You need to get the player and store it in a variable
Hmmm... It might be easier for you to copy the entire asset
Thanks, I'll do this and see if it works once I can get this little issue working.
IIRC this is used to load/save the flashlight settings in bulk, you shouldn't need it for your use-case
Yeah, I can see that's what the variable is used for, just not how to do that.
Okay, uhh... I've fixed it.
Turns out if I just deleted the set char player nodes, then remade them by dragging from the char player variable, they worked. I suspect the names were slightly different between the two mods.
Thanks for the help though :)
I mean they look identical on inspection but there was a broken reference in there somewhere. No idea why. I'm honestly not a huge fan of visual scripting but that's Unreal I guees :/
Ah yes, copying the nodes doesthat
Okay, so just a quirk of the editor then.
Okay, I've got most of the logic duplicated, and I think I've figured out what's necessary and what's not, the problem is now that I can't get anything to happen in the mod. I'm trying to get some kind of logging to happen, just to see that the logic is working, but nothing is happening currently. This is the blueprint logic I've got. I've got three log display nodes that should be firing, but I'm seeing nothing.
What I'd like to know is if that log display node is the right thing to use, and if there's some simpler, more reliable event I can use just to check that the blueprint is running at all. I've tried attaching it to the Begin Play event, but that doesn't appear to show anything either.
This component is (in Flashlight Settings) attached to the player controller using something known as "SCS hooks"
>docsearch scs hooking
This is the best result I got from the SMD :
https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/SimpleConstructionScript.html
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...
Yup, I got that link before and I've set it up in my project, I can get a screenshot for you.
Did you set up the things in the game instance module of your mod?
That's the game instance module, because the flashlight mod was using the same thing and it seemed right.
I just went through and made sure all the settings were the same as the flashlight module.
Did you compile and save your blueprints?
I'll double check and try again.
Yup, I did all of that and re-ran the game and I'm still seeing no messages.
Where should I look for them if they're working?
In the log file
You can also add
-console
to the launch arguments
https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/Logging.htmlOh, well they're there and they're working, which is great! I'm trying the console argument now
Okay, I've tried -console as a launch argument in steam, but it didn't seem to change anything.
I'd like to be able to see something respond in real time in the game so I can check what's actually happening.
Thanks so much for your help, I'll be back tomorrow!
Oh, bad memory
-log
I got it mixed up with -NewConsole
(which is something else)What were the relevant docs, and what were you looking for that they were missing? Always looking to improve them
I think you would benefit from a general into to UE blueprint scripting video. I think we link a few in the docs, otherwise Google is your friend. There's too much for the docs to feasibility cover without linking elsewhere
I think they just didn't contain the functions I needed, and also the error I was having wasn't documented, it was just a problem with how the blueprint editor is a little bit too opaque (imho)
Thanks, yeah, I'll look into that, but I'm getting a feel for it now. I've used blueprints back when the UDK was the latest version, they're not so different, and ultimately it's just programming. I think the things I'm struggling with right now are API specific, so I don't know that beginner tutorials will help that much.
Also I'm realising a lot of my questions have generic Unreal-based answers, so I can just search them up rather than asking here.
If you find any good general unreal resources, please link them here so we can add them to the docs
So looking at the documentation for the Print String and Print Text nodes, they should be showing messages on screen, it's strange that they don't. Do we have access to the Satisfactory onscreen message system? Like the one that tells you when power turns off etc?
But the -log argument was the right one, I got this:
I just need to exit fullscreen so I can look at the log window while I'm playing.
And that "entered hypertube" message is key, because it means we are correctly detecting that event. I think that's most of the functionality of this mod tbh. The only thing left is to overlay the texture in front of the screen.
Yup, detection is working:
notice how the Print Text nodes say development only at the bottom of the node. the distributed shipping game is not a development build
Oh, I see, so that's what that means.
the satisfactory onscreen message system is something the devs created specifically to handle events like the power going out. you could theoretically interface with it, but it would be faster to either use logs (which also captures order of events, timing and leaves a paper trail) or make your own debug widget to display info
Okay, I think I don't need to worry about that for now. I'll implement it if I really need to but for now the console is giving me the info I want.
Okay, I'm trying to get the effect texture to show, so I've made a widget and I've created an instance in the blueprints, but I can't find a way to make it visible. The UE 5.5 docs have this entry: https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Rendering/SetVisibility?application_version=5.5
But I can't find an equivalent for 5.3 which is what I believe we're using. There doesn't appear to be anything like that when I search for the appropriate nodes in the blueprint editor.
Am I close to an answer here?
Epic Games Developer
Set Visibility | Unreal Engine 5.5 Documentation | Epic Developer C...
Set Visibility
I figured it out, I need to uncheck "context sensitive" when searching for nodes.
I'm trying to show something on screen, and I'm getting nothing. I think my issue is that I don't know what kind of widget to create. I made my widget inherit from UserWidget, but there are so many options I don't really know which one is appropriate for my use case:
I've found that if I search for Widget, then click on it, then clear the search field, I can find this:
I'm going to try that for now.
Okay no that was useless, it just creates a blueprint.
Still researching, sorry for spamming messages...
Success! It's wayyyy too opaque, but we'll figure that out later.
This was the information I needed, I know it may seem basic but I didn't really know where to look: https://dev.epicgames.com/documentation/en-us/unreal-engine/creating-widgets-in-unreal-engine
Epic Games Developer
Creating Widgets in Unreal Engine | Unreal Engine 5.5 Documentation...
How to create and display in game a Widget Blueprint in Unreal Engine.
The success continues, I now have a better overlay image, and it only triggers inside hypertubes:
Multi-monitor is very convenient for this :wonke:
If you want to apply an overlay image, I'd try using a post-process material. But a widget may work for now (just make sure it is not hit-testable, otherwise it can block clicking on things)
I run sf exclusively in windowed for mod testing to avoid the graphics driver delay when alt tabbing
The purpose of context sensitive is to only show stuff that can be done with the inputs you have. To create a Set Visibility node with context sensitive on, you can drag a wire of a type that has the Context Sensitive method. As opposed to creating it by using Add Node on the background canvas, which is what I assume you've been using to create nodes
So if you drag a wire of type User Widget, Set Visibility should show up
Windowed fullscreen is a thing
I use windowed fullscreen all the time so I can overlay a yt video over the game, although Satisfactory doesn't capture the mouse so you end up clicking out all the time. I wonder if a mod could fix that...
You are reminding me that I should attach a second monitor someday soon. I haven't had one for ages but I think it might be time.
I will look into this. I'm still getting basic functionality working, but in the future. For now I have not hit-testable, that seemed the obvious choice.
I have found the variable that changes what layer the widget renders on, called ZOrder in the AddToViewport node: https://forums.unrealengine.com/t/render-a-widget-over-all-others/1732952
Epic Developer Community Forums
Render a widget over all others?
I’m trying to make an FPS show widget, but I can’t figure out how to make it render over other widgets that are also created, like menus. Any help?
Thus:
I think I'll make the over/under UI rendering an option. I think I actually like it hiding the UI, although I'll have to do some tests to figure out what layer the pause menu renders on, because currently with ZOrder set to 0 the effect covers the pause menu. I had to blind-click out of the game the first time I got it to show, with the first almost-entirely-black overlay.
you could add it into the player's hud widget instead of being added to the viewport; that could help give more precise control over what it gets added above/under
most convenient way to add it would probably be with a widget hook, having it start fully transparent, then causing it to become opaque when needed. althouh it will probably require you to change how you do things somewhat
>docsearch Widget Blueprint Hooks
This is the best result I got from the SMD :
https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/WidgetBlueprintHooks.html
Widget Blueprint Hooks :: Satisfactory Modding Documentation
Introduced in SML3.5, Widget Blueprint Hooks can be used to add your custom widget into one of the existing game widgets. This functionali...
I've thought of this but I really don't want it to vanish whenever the HUD goes away, unless there's a way to prevent that from happening. I don't want there to be a way to accidentally turn it off, which is why I went with a lower-level approach. If there's a way to make that happen within the HUD I'd be interested to hear it.
That would probably be less "hacky" to hook into the game's HUD, but again I'm leery of that because I don't know under what circumstances the game might hide the HUD.
Okay, the mod is working with basic functionality, including customisable opacity and fade-in and fade-out times.
I just need to publish it now.
And maybe add a little bit of polish.
Thanks so much everyone!
You can look at the skeleton of the HUD widget in the editor, I think it's called BPW_Hud or something. Pretty sure it's never hidden and even contains the pause menu
Okay, thanks, I'll take a look then.
It sounds like what you have works, this way would just probably handle other mods' UI elements easier
Okay, well if I decide to implement a "Render Over UI" option maybe I'll do it, but right now it's just drawn on -100 and underneath everything, which will work for now.
I'm just going to publish this to github and to the mod repo. I'm using a lot of code from the flashlight mod which is GPL 3.0, I assume that means I should release it under the same license, is that right?
Yes, it's the simplest approach
Thank you!
Hey everyone, got some good results after doing some tests, I think this is just about ready for primetime, BUT it has suddenly started crashing. I was replacing a 4096 texture, which was 5MB and a bit excessive, with a 1024 texture. At first this crashed the editor, but on a second attempt it compiled and packaged just fine. Then the game crashed when loading the texture. After a bit of troubleshooting I've discovered this is probably to do with the in-game texture asset and the texture file used to create that asset having mis-matched names. So I had blackout.png and replaced it with blackout_1024.png, and that's when I got the crash.
But it's fixed now, and 1024 looks just fine on my 2560x1440 monitor. I think it'll look fine for most people and that's the texture size I'm using. Just about ready to publish this. There are a couple of more options and tweaks I can add, but it is definitely feature-complete.
Also, here are my results from using the epilepsy analysis tool:
Night & day difference. I've discovered a faster attack than 0.3s causes warnings, but at 0.3s if I'm careful to walk slowly into the launcher without flicking the camera everywhere, I can stay under the CAUTION FAIL line, which is great. It's now no worse than any of the regular menus in the game.
Somehow the editor now remembers the wrong name that my texture file had, so automatically mis-names it. What a feature.
I am now being told "You cannot create a 'Texture2D' asset named 'blackout' in '/HypertubeBlackout', as there is already a 'ObjectRedirector' asset with the same name in this folder." I'm so glad they decided to silently, invisibly force this error to persist. I am looking into how to remove this object redirector, and possibly how to nuke the feature entirely.
This is the solution: https://dev.epicgames.com/documentation/en-us/unreal-engine/asset-redirectors-in-unreal-engine
Epic Games Developer
Asset Redirectors in Unreal Engine | Unreal Engine 5.5 Documentatio...
Objects that redirect references for moved assets from their old location to their new location.
But also, this gave a bit of a WTF moment:
"Fix Up" in that menu is the way to delete it.
Unbelievable, the problem persists
I have gone for the hacky solution I didn't want to have to do, and renamed the texture to a fresh name that hasn't been polluted by this bug:
Okay, that's tested and working AFAICT.
Okay, I've made the ficsit.app page here: https://ficsit.app/mod/7jdneQDfyno5ny
Hypertube Blackout - SMR
Applies a blackout effect over hypertube travel, to reduce flashing lights caused by hypertube launchers.
I can't figure out where to upload the actual mod though.
Nevermind, I found the help page.
You can't nuke this feature, but you can indeed use "Fix up redirectors" to get rid of redirectors. But note this can cause issues when collaborating with others: https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine#avoidredirectors/cleanthemupasap?
Right, I mean it turns out it didn't actually fix the problem anyway, so that's a bit scary tbh. But anyway, I've found a workaround for now.
Honestly I'd prefer Unreal to take the fail-fast approach rather than enable my mistakes.
Okay, source and app link are now uploaded. If anyone tests it please let me know if you have any feedback!
I also added an icon, just a trace of the hypertube posture with the blackout effect over it.