Clone wiki

SplineTools / Tutorial: Setting up a wirespline

In this tutorial you learn how to set up a wire spline without a terrain. This uses a very similar approach to the 'Setting up a spline path tutorial'. The only difference are the WireNodes instead of PathNodes. You can also watch the Youtube tutorial.

  1. Start by creating a new map and placing a camera. You can either make it look at the splines you are going to create or attach the spectator script. Leadwerks has this script by deafult but you can also find it in the "Scripts/SplineTools/Editor/Helpers" folder.
  2. Then place a pivot in your scene (Video tutorial if you don't know about pivots.).
  3. Go to its script tab and click select.
  4. Browse to the spline tool package and select the "Editor/EditorSpline.lua" lua script.
  5. By default the spline type is set to "Path", so we set it to "Wire".
  6. Turn on all checkboxes that say "Debug"
  7. Drag the scene camera from the scene tree on to the "Debug camera" script property. Without doing this, the debug options won't work.
  8. Now lets create the nodes of this wire. Create a pivot called WireNode1 and give it 2 pivots child called A and B.
  9. Attach the EditorWire.lua script to the WireNode1.
  10. Copy WireNode1 and call it WireNode2.
  11. Select WireNode1, go to the script tab and drag WireNode2 from the scene hierarchy in to the 'Next node' property.
  12. Set the "Sides" property to 7. For a basic rope this should be plenty. For more detail you can increase this number.
  13. Set the "Radius" property to 0.02.
  14. Set a "Wire material". Go to the folder "Scripts/SplineTools/Materials/Wires" and pick a wire material. WireNode1 now looks something like this <insert image>
  15. Place WireNode2 a litlle further away from the first node. This node is the end of the wire.

  16. In order to get (bezier) curves we need to start playing with the A and B handlers of a node.

  17. The "A" handler determines the outgoing handler (Little trick: "A" could be short for "Away") and B determines the incoming spline handler.
  18. For WireNode1 drag the the A handler away from the node. Move it halfway towards WireNode2 and then some more the the right, so that it looks a little like in the image below. <insert image>
  19. For WireNode 2, we do a similar thing. Drag handler B away from the node.
  20. If you run the game now you will see how the wire is being created.
  21. You can continue extending this spline by placing new WireNodes and linking them to previous nodes.

Now you know how to set up a wire spline with Aggror's Spline Tools.