How to make an Electric Fence

Ok boys and girls, I’m going to show you how I made this fence (and the steps I took to get it working)

First off, we need to start with the basics. To create an item, you need to create the Static Mesh, and the required textures to properly your item in game.

From here you will need to create your texture for the fence. First you need to right click (in the folder for your object) and click “create new material”. Then in the new material window, you will get a blueprinting object that has the “base color, metallic, specular, etc” fields in it. You can just drag your created structures into the blueprinting area, and drop them in. Once they are dropped in, you can just connect them to their appropriate connector.

Next we can start to setup the item itself. I used an AirConditioner as my “base” model, since it already had the “is powered” structure in the BP. So I grabbed the basic air conditioner file from PrimalEarth\Structures\Electric and made a copy in my mod folder. I then renamed the file and changed the Static Mesh to be that of my fence. From there I continued editing the file to be more in line with my preferences of how the electric fence should be placed. I then created a PrimalItemStructure (duplicated form the PrimalItemStructure_AC PrimalEarth\Core\blueprints\Items\Structures\Misc) and made sure the fence was properly referenced. I then edited the resource requirements and saved.

From there, I added in my engram entry to have the appropriate values and references. Then went back through the Structure, the PrimalItemStructure, and the EngramEntry to ensure that everything was properly referenced to each other. From there, all that was needed was to go into the PrimalGameData_BP and add my fence into the additional engrams, then add it into “Additional Structures to be placed”.

Next is the more “advanced” part, where we create the blueprint code to do damage to any characters that get close to the electrical lines. I’m not going to lie, I kinda cheated on this part a bit, and used a blueprint that was already available. I found this “template” in PrimalEarth\Structures\Wooden"SpikeWall". Once you open that, you can go to the graph, and voila, there is a perfectly working BP of collision overlap detection and damage to a character object.

So I added a new component (on the components tab) to my Electric fence that was a “shape\box” and then mirrored the settings for the DamageBox of the SpikeWall. I then copied the SpikeWall EventGraph (OncomponentBeginOverlap and OnComponentEndOverlap) and pasted it into my ElectricFence Graph.

From there, I mirrored the variables created in SpikeWall, and created them in my electric fence.

After each variable is added, make sure to compile your BP so that it is loading and saving everything correctly. After I had input all of the required variables (the compile should have no errors at this point) I then had to modify the BP slightly so that it would do damage to wild dinos also, and only do damage when the fence is powered and active.

To do this ,I added a branch at the beginning of the OnComponentBeginOverlap that only continue if Container Activated (boolean) was true. I then modified the branch after “Cast to PrimalDinoCharacter” I made it so that true or false would connect to the next branch (this was what prevented wild dino’s from taking damage, it could be modified “more cleanly” but this is the simplest way to show)

And from there, you only need to test to see how you fence works!!!

I have also made a video of this (steps are in a different order) that you can watch:

Hopefully this helps everyone along their modding paths, if you guys want, I will be happy to include more tutorials on the different content in ArkReborn!!!

*updated to show youtube video link

awesome work man im like halfway through doing this u can have the fence so the mesh turns on off 2 like a gateway and a gate :smiley: u can also convert the base to be a say tesla tower if u check the sentry person check :stuck_out_tongue: ill upload a graph when i finish work

Great tutorial man! We have been needing a practical walkthrough for this subject matter, glad someone did it. :slight_smile:

Hi there

Have you got the on/off mesh done ?

Can i used this concept for a forcefield too ?

Fantastic tutorial Azrael!

Did you make the model for the gate yourself? Looks amazing!

My modding partner made that gate model, and yes he did a very good job with it. And yes Enrell, I did get the on/off models done. You could absolutely use this concept for a forcefield, I would recommend changing some of the values though.

Can i have a sample sir or a tutorial with the on/off ?

I am still learning.

Thank you

Nicely done. I like the texture! How about a videotutorial on youtube?