How to create electric fences

From Platinum Arts Sandbox Free 3D Game Maker
Jump to: navigation, search

Method 1

  • First open up the map you want to make electric fence on. In current case(ICC from now on) fence
  • Make a fence like thing, I made this: fence. You can also use a model.
  • you can use particles to make it cooler particles
  • Surround it with respawn, you can do it by selecting area pressing F3 and selecting respawn from materials tab respawn, or selecting the area and hitting SHIFT+R.
  • Save your map and close sandbox
  • make a cfg file to your map, you can do that by going to my_stuff/packages/base and making a new text document, which then must be renamed to yourmapname.cfg, ICC fence.cfg
  • Type the following to your maps cfg file:
level_trigger_1 = [ echo "You just got shocked!" ]
  • Save it and open up sandbox
  • Open your map, ICC fence
  • if you used a mapmodel instead of making the fence with cubes, then just select the mapmodel and press F3 and set trigger tag to 1 and trigger type to 11
  • if you did it with cubes then create a new mapmodel, select it, press period (.), and set the second value to -1. That creates a invisible mapmodel, which you must now place in your fence. Do the same things as said in last step.
  • If you try to go near your fence now, you will respawn and a text will appear that you got shocked (or whatever you wrote to your maps cfg file), NB! If you don´t die, then you need to make the respawn area bigger

Method 2

  • this version uses more coding, and may (or may not) be more efficient, your choice.
  • First off, make a fence, like in Siim's tut.
  • then add lightning as needed.
  • Instead of adding respawn, add an empty mapmodel (a model with a value of -1). Give it a trigger type of 8, and a trigger tag of #.
  • Now go to the cfg and type:
 level_trigger_# = [ echo "You got shocked!" ; nap ] 

The nap command is like a kill command.