Download

How to make a fabricator run on gas or electricity

I"m posting this since I haven’t found a clear answer on the forums for how to make a Fabricator run on gas or electricity.
I’m not good at writing tutorials but hopefully this will help anyone having problems switching fuel sources. This may not be the best way to switch fuel sources but its working for me. This now works on dedicated servers and in single player.

I want to thank to @DefaultCoder and @Matt_Tuttle for helping with this.

First you’ll want to take a look at Mezzow’s thread here on how to add to the radial menu.
https://forums.unrealengine.com/showthread.php?95296-Tutorial-Example-Adding-custom-MultiUse(Radial)-menu-entry-action

All of these graphs are on the StorageBox_Fabricator.
To view the example in the editor extract FabricatorTutorial.zip (105 KB) to the folder \Epic Games\ARKDevKit\Projects\ShooterGame\Content\Mods. Change the folder according to where you installed if its different.

I use a variable to set what string is displayed on the radial menu.
[screenshot]

&d=1501359458[/screenshot]

The event graph launches the OnRepCondition event when switching fuel sources is called upon, and has the custom event PoweredStructures (multicast and reliable).
[screenshot]

&stc=1&d=1501790137[/screenshot]

I set the string variable’s value according to the condition variable set in the BPTryMultiUse graph.
[screenshot]

&d=1501359464[/screenshot]
[screenshot]&stc=1&d=1501790092[/screenshot]

The OnRepCondition graph.
[screenshot]

&d=1501359490[/screenshot]

The PoweredStructuresCheck function.
[screenshot]

&stc=1&d=1501789039[/screenshot]

The FuelCheck function.
[screenshot]

&stc=1&d=1501789031[/screenshot]

The variables used changes how the Fabricator is powered.
UseEntryString sets what will be displayed on the radial menu. It is replicated and multicast to display on clients since it is run server side.
ActiveRequiresPower boolean sets whether or not the Fabricator will require electricity.
The variable ActiveNoFuel trashes the ActiveRequiresFuelItems setting.
The variable NoBurnTime trashes the FuelItemsConsumeInterval setting.
The variable NoFuelGives trashes the FuelItemsConsumedGiveItems setting.
The variable ElectricJunction sets PoweredNearbyStructureTemplate to ElectricJunction
The variable NeedsFuel sets ActiveRequiresFuelItems setting back to Gasoline
The variable BurnTime sets FuelItemsConsumeInterval setting back to 3600
The variable FuelGives sets FuelItemsConsumedGiveItems setting back to none
The variable NoElectricJunction sets PoweredNearbyStructureTemplate to none
The variable Condition is set last after the changes have been made.
The Set is powered prevents the fabricator from remaining powered if it was powered when switching to gas then having shut off the generator and switching back to electricity.
Set Container Active just turns the fabricator off when switching power sources.

To create the variables just drag off the node for the SET functions and promote to variable then set your variables accordingly.

Nice one! I will add this to the list on my thread

Can you plis upload your fabricator some where ?

You can see how it works with this it’s the StorageBox_Fabricator blueprint which has all the graphs on it.

It’s now in top post.

Thank you, i will try this o my auto turret

Thank you for sharing this!
I used your fabricator_BP, and used my PrimalItemStructure_BP to place it, but when I tested it on a dedicated server, the “Entry Use String” does not change, and it does not become powered.
Screen capture - 96c470d05c17c17dd9982c76f4e72c73 - Gyazo

Looks like it’s switching to require power, but isn’t grabbing that nearby outlet. You have nearby power template pointed to an outlet?

Yes, there is a power template variable that get’s set in the Fabricator_BP when it’s switched to “Electric Mode”.
I got the “Entry Use String” to finally change by setting every variable in the BP to “replicated”, but it will not run on electricity once it has been switched from “Gas Mode”.

I’m still fairly new to modding myself so I don’t really know too much yet but I can do some testing on it to see if I have something not set right.

Okay after trying a lot of different things I managed to get it working on a dedicated server and single player. I have updated the top post with the new setup.

Did you update the zid file aswell ?

Yes I replaced the zip file

Works great. Again, thank you very much for sharing this.

Your welcome. I’m glad it’s helpful.

Dude , thank you very much finally i made my auto turrets to switch fro gas to power and otherwise

not sure if its just me but i can place the structure, put gasoline in it and turn it on and off, switch to electricity with a gen nearby and i can turn it on and off, but if i switch BACK to gasoline it doesnt allow me to turn it on. any ideas?

There needs to be a kill switch before the initial switch to change from gas to electric as it bugs out… I found if left on while switching from gas to electric or vise versa it breaks…

Edit It however works as intended for testing and tutorial purposes… I think this is meant as a guide to get you started on your graph not as a completed mod.

@xSmokieMcPotx

This is how I got mine to work… through various forum posts and videos and some trial and error on my end… The information is out there

MultiUseEntry

[screenshot]MUentry.PNG&stc=1&d=1494117644[/screenshot]

EventGraph

[screenshot]Event.PNG&stc=1&d=1494117629[/screenshot]

TryMultiUse Function

[screenshot]

&stc=1&d=1494117263[/screenshot]

OnReplicationCondition

[screenshot]

&stc=1&d=1494117280[/screenshot]

I hope this helps…
This works for my custom crafting station.

had to wipe everything due to a hdd failure so ill give it a go tonight, thank you so much!

is there anyway you could upload a copy of your structure so i could see the graphs? i know its asking a bit much but im completely lost lol @defaultcoder