From Rigs of Rods Wiki
The Definition of a Flare Flares are basically lights that originate from a set of chosen nodes, which can be manipulated via the appropriate values in the .truck, .load, .trailer, .boat or .plane file. There are multiple types of flares, ranging from brake lights, to turn signals, to headlights, to specialty lighting.
The Coordinate Plane Flares operate on a different coordinate plane than nodes, for some reason. Note these changes:
|X||Front to back||Left to right|
|Y||Up to down||Up to down|
|Z||Left to right||Front/Back|
Time Warning Furthermore, be advised that adding flares to a vehicle will sometimes take quite a bit of time, depending on the type of vehicle, number of nodes, number of flares, etc. You've been warned.
Preparing the chassis
Before we begin, you'll absolutely need a truck editor, such as the Editorizer, which can be found in the repo, here on the wiki, as well as on the forums. This will allow you to see where each node is placed in relationship to the coordinate plane (X,Y,Z).
Once the editor is running, and is open to the truck of your choice (it's suggested that one starts out with something simple, such as the old Cartrailer.load, which can be found on the repository), you'll need to select the checkbox up at the top that says, "Print Node Numbers." This is pretty self-explanatory, as you'll need three node numbers later on to add your flares.
This next step can be challenging, depending on how many nodes and beams are present on the selected vehicle. You'll need to find three nodes close to where you want them on the vehicle. If you're adding brake/turn/head lights, it's suggested that you start with the lower lefthand corner of the front or back chassis, writing that node number on a piece of paper (this'll be your reference or REF node), then write down the node directly above it (this'll be your Y), and then finally, write the number of the node directly to the right of it (this'll be your X).
If you cannot find REF,X,Y nodes because they aren't where you want the lights (e.g. you're working on the school bus, which has the tail lights quite a bit above the bumper), you can add three nodes, in the same fashion as noted above, and use them to base your flares off of, but that's too advanced to go in this tutorial (See the Step-By-Step Truck Construction tutorial).
Getting to Know Notepad
Next up is man's best friend--the Windows notepad. If you're using another operating system, and/or another editor, that's fine, as long as it can save in ANSI format--it'll save you problems later on. Whatever you do, do not use MS Word/Wordpad/OpenOffice/AbiWord etc.
You'll need to open up the vehicle or load of choice with the aforementioned application (notepad or compliant editor). Here, you'll need to add a " Flares" sectionOnce the line "flares" is added, you'll need to hit enter once, starting a new section, where it's advised you paste the syntax:
Now, it should look like:;RefNode,X,Y,OffsetX,OffsetY, Type, ControlNumber, BlinkDelay, size MaterialName
flares ;RefNode,X,Y,OffsetX,OffsetY, Type, ControlNumber, BlinkDelay, size MaterialName
So imagine a flat plane with 4 nodes, the direction of the planes face up, down, left or right determines where your flare will be.
There are two ways to do this.
flares 219,218,220,0.0,0.0,f,-1,0,0.50, default
The first node (219) is where the flare comes from and the other 2 (218, 220) determine whether it faces front or back of the plane.
To do the rest of the headlight flares, all I change is the first node, but keep the other two nodes depending on the side you want it.
The other way to do it is without the nodes where the headlights would be (you need to move the flare with the the red marked numbers).
All you would do it replace the first node, so instead of 219, it would be 0 and then you would move the flare to the left.
flares 219,218,220,0.0,0.0,f,-1,0,0.50, default
flares 0,218,220,0.0,0.0,f,-1,0,0.50, default
Same thing apply for rear lights, top lights, side lights, just needs to have a plane, doesn't matter how big or how small the plane is since you can move the flare with the red marked numbers.
Borrowed from Truck_Description_File:
1: Reference Node 2/3: X / Y
4/5: offsetX / offsetY
This defines where the light flares will be. It is positioned in relation to 3 nodes of the chassis. One node is the reference node, and the two others define a base (x,y). So the flare is in the plane defined by the 3 nodes, and is placed relative to the reference node by adding a fraction of the vectors ref->x and ref->y. The three first parameters are the 3 nodes numbers (ref,x,y) and the two next gives what amount of ref->x and ref->y to add to displace the flare point (these two should be logically between 0 and 1, or else that means you use the wrong base triangle and if the body flexes too much the flare will not stick to the body correctly).
Basically, OffsetX/Y means that a fraction of X and Y will be added to the Reference node, which should be a corner, with a Y node above it, and an X node to the right or left of it. It's a bit easier, however, if it's in a left corner, than a right.
Example (* = node, + = flare location):
* + * *
Hint: Use the material name "tracks/aimflare" for help in positioning a flare.
6: Type field:
- f (default mode when not stated): frontlight
- b : brakelight
- l : left blinker
- r : right blinker
- R : reverse light (on when driving in R gear)
- u : user controlled light (i.e. fog light) (see controlnumber))
7: Control Number:
This determines how this light is switched on and off, if you chose a user controlled light. Valid user defined control numbers are 0-500. If you chose a non-user controlled light(i.e. brake light) you should say -1 here.
This defines how long the delay is between the light changes in Milliseconds. A value of 500 means that the light is 500ms on and 500ms off. Use a value of -1 to use the default value of 500ms. Use a value of 0 to create a non-blinking light.
This determines how big the flare will be. Reasonable values are between 0.1 and 5 (0.1 = 10% of default size). If the size is smaller then 0, then the flare will be independent of the camera angle. (So the flare does not get smaller when you move the camera)
10: Material Name
This field determines what material should be used for the flare display. If you want to use the standard material, use default. Please note that there is not comma between the material name and the size Argument. You can use tracks/aimflare to position your flare.
Alright, back on topic: below the syntax, you should begin listing your nodes, keeping in mind their location on the vehicle, and the coordinate plane. You'll probably need to save, open up RoR, and test out the flares quite a few times before the placement of the flare is perfect.
Adding Symmetrical Flares
Okay, so you finally have that headlight, taillight, marker light, whatever-light in place. Now, you need one for the opposite side. Never fear, however, because there's a quite simple way of figuring out how to exactly place the other side's flare. Remember above, when it was stated, "these two should be logically between 0 and 1" about offset-X and offset-Y?
Well, anyway, once you have the first flare placed, just use that same exact placement line again, but this time, subtract whatever offset-X you used on the first flare from 1.0. Example: say we placed this headlight:
flares ;RefNode,X,Y,OffsetX,OffsetY, Type, ControlNumber, BlinkDelay, size MaterialName 0,10,1,0.345,0.55,f
That'd be the left side. To get the right side, we'd have to take 0.345 and subtract it from 1.0 to get 0.655. Then, we use 0.655 for the right side's offset-X. Since we want the right side flare to be at the same height as the left side, we use the same offset-Y. So, in turn, it'd look like this:
flares ;RefNode,X,Y,OffsetX,OffsetY, Type, ControlNumber, BlinkDelay, size MaterialName 0,10,1,0.345,0.55,f 0,10,1,0.655,0.55,f
This guide uses headlamps as an example, but this technique can be used to place any type of flare.
OMG, it's an alien! No, it's Flares2.
Flares2 is essentially the same as Flares. The only difference is the fact that Flares2 incorporates the Z axis, allowing for front-to-back movement in the placing of flares. The syntax is as follows:
flares2 ;RefNode,X,Y,OffsetX, OffsetY, OffsetZ, Type, ControlNumber, BlinkDelay, size MaterialName
Should the flare seem to stick to the interior of the vehicle when you select REF, X and Y nodes from the left side of the chassis, just use three nodes directly opposite on the right side of the chassis instead. This should thereby make the flare stick to the outside of the vehicle.
If you had to add nodes to a vehicle to place flares, and the flares seem to swing around or fall to the ground, ensure that you tied the said nodes into the frame of the vehicle with beams.
If a flare isn't illuminating when you attempt to turn it on, verify that the syntax is correct; the flare line has the correct REF, X & Y nodes; that it is of the correct type; and that the control number (if it's a user-controlled light) is correct. The flare could be showing up inside the vehicle, check the wireframe (hit K). If this is the case, see above.