Announcement

Collapse
No announcement yet.

How to make an Electric Fence

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic How to make an Electric Fence

    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)

    Click image for larger version

Name:	ElectricFenceBuilt.png
Views:	1
Size:	938.4 KB
ID:	1159584

    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.

    Click image for larger version

Name:	TextureInputsEFP.png
Views:	1
Size:	55.7 KB
ID:	1159585

    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.

    Click image for larger version

Name:	TextureSetupEFP.png
Views:	1
Size:	440.7 KB
ID:	1159586

    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.

    Click image for larger version

Name:	SpikeWall BP.JPG
Views:	1
Size:	210.3 KB
ID:	1159583

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

    Click image for larger version

Name:	Variables.JPG
Views:	1
Size:	28.5 KB
ID:	1159587

    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)

    Click image for larger version

Name:	BPAddon.JPG
Views:	1
Size:	127.9 KB
ID:	1159588

    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: https://www.youtube.com/watch?v=yEuZqAAFHA0

    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
    Last edited by KamenAlien; 08-19-2015, 09:23 PM.

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

    Leave a comment:


  • replied
    Originally posted by TheRealAzrael View Post
    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

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    Fantastic tutorial Azrael!

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

    Leave a comment:


  • replied
    Can i used this concept for a forcefield too ?

    Leave a comment:


  • replied
    Originally posted by gankey69 View Post
    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 u can also convert the base to be a say tesla tower if u check the sentry person check :P ill upload a graph when i finish work
    Hi there

    Have you got the on/off mesh done ?

    Leave a comment:


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

    Leave a comment:


  • replied
    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 u can also convert the base to be a say tesla tower if u check the sentry person check :P ill upload a graph when i finish work

    Leave a comment:

Working...
X