Locomotive tail lights script issue!

fen_tiger

Building the Wisbech line
The BR Class 37/4 has something wrong with its directional lighting script as for some reason I cannot figure out is that the (red) tail lights are showing in the loco's direction of forward travel... :eek: This script error occurs whichever forward direction I have the loco facing. All other locos I have don't have this tail light problem with them, except for this BR Class 37/4. Anyone on here with the answer of how I can correctly fix this and get the tail lights ONLY showing at the rear of the loco and not at both ends regardless of which way the loco happens to be forward facing? Many thanks.

 
Last edited:
* Directional lighting script for this BR Class 37/4 (37401) locomotive...


case CAR_FRONT:
if(direction)
{
//Interface.Log("Switching on no.2 end marker lights - car is front car headed in opposite direction to train");
if (!bCrewRear)
{
SetFXAttachment("crew_fwd", null);
SetFXAttachment("crew_rev", asCrew);
bCrewFront = false;
bCrewRear = true;
}
// SetFXCoronaTexture("frontmarker_0", null);
// SetFXCoronaTexture("frontmarker_1", null);
// SetFXCoronaTexture("rearmarker_0", null);
// SetFXCoronaTexture("rearmarker_1", null);
SetFXCoronaTexture("frontbox_0", null);
SetFXCoronaTexture("frontbox_1", null);
bHeadFront = false;
bTailFront = false;
bTailRear = false;

if (!bHeadRear)
{
SetFXCoronaTexture("rearbox_0", asHboxDisc);
SetFXCoronaTexture("rearbox_1", asHboxDisc);
bHeadRear = true;
}

}
else
{
//Interface.Log("Switching on no.1 end marker lights - car is front car headed in same direction as train");
if (!bCrewFront)
{
SetFXAttachment("crew_fwd", asCrew);
SetFXAttachment("crew_rev", null);
bCrewFront = true;
bCrewRear = false;
}
// SetFXCoronaTexture("frontmarker_0", null);
// SetFXCoronaTexture("frontmarker_1", null);
// SetFXCoronaTexture("rearmarker_0", null);
// SetFXCoronaTexture("rearmarker_1", null);
SetFXAttachment("frontlamp", null);
SetFXAttachment("rearlamp", null);
SetFXCoronaTexture("rearbox_0", null);
SetFXCoronaTexture("rearbox_1", null);
bHeadRear = false;
bTailFront = false;
bTailRear = false;
if (!bHeadFront)
{
SetFXCoronaTexture("frontbox_0", asHboxDisc);
SetFXCoronaTexture("frontbox_1", asHboxDisc);
bHeadFront = true;

}
}
break;

case CAR_BACK:
if(direction)
{
Interface.Log(GetRunningNumber() + "CAR_BACK, direction");
//Interface.Log("Switching on no.1 end tail lights - car is end car headed in opposite direction to train");
if (!bCrewRear)
{
SetFXAttachment("crew_fwd", null);
SetFXAttachment("crew_rev", asCrew);
bCrewFront = false;
bCrewRear = true;
}

// SetFXCoronaTexture("rearmarker_0", null);
// SetFXCoronaTexture("rearmarker_1", null);
SetFXAttachment("rearlamp", null);
SetFXCoronaTexture("frontbox_0", null);
SetFXCoronaTexture("frontbox_1", null);
SetFXCoronaTexture("rearbox_0", null);
SetFXCoronaTexture("rearbox_1", null);
bHeadRear = false;
bHeadFront = false;
bTailRear = false;
if (!bTailFront)
{
// SetFXCoronaTexture("frontmarker_0", asRedMarker);
// SetFXCoronaTexture("frontmarker_1", asRedMarker);
SetFXAttachment("frontlamp", asLamp);
bTailFront = true;

}

}
else
{
//Interface.Log("Switching on no.2 end tail lights - car is end car headed in same direction as train");
Interface.Log(GetRunningNumber() + "CAR_BACK, !direction");
if (!bCrewFront)
{
SetFXAttachment("crew_fwd", asCrew);
SetFXAttachment("crew_rev", null);
bCrewFront = true;
bCrewRear = false;
}
// SetFXCoronaTexture("frontmarker_0", null);
// SetFXCoronaTexture("frontmarker_1", null);
SetFXAttachment("frontlamp", null);
SetFXCoronaTexture("frontbox_0", null);
SetFXCoronaTexture("frontbox_1", null);
SetFXCoronaTexture("rearbox_0", null);
SetFXCoronaTexture("rearbox_1", null);
bHeadRear = false;
bHeadFront = false;
bTailFront = false;
if (!bTailRear)
{
// SetFXCoronaTexture("rearmarker_0", asRedMarker);
// SetFXCoronaTexture("rearmarker_1", asRedMarker);
SetFXAttachment("rearlamp", asLamp);
bTailRear = true;

}
}
break;

case CAR_SINGLE:
if(direction)
{
//Interface.Log("Switching on no.2 end marker lights - car is single car headed in opposite direction to train");
// If I had a no.2 end, I'd be setting the no.2 end marker lights too...
if (!bCrewRear)
{
SetFXAttachment("crew_fwd", null);
SetFXAttachment("crew_rev", asCrew);
bCrewFront = false;
bCrewRear = true;
}
// SetFXCoronaTexture("rearmarker_0", null);
// SetFXCoronaTexture("rearmarker_1", null);
SetFXAttachment("rearlamp", null);
SetFXCoronaTexture("frontbox_0", null);
SetFXCoronaTexture("frontbox_1", null);
bHeadFront = false;
bTailRear = false;
if (!bTailFront)
{
// SetFXCoronaTexture("frontmarker_0", asRedMarker);
// SetFXCoronaTexture("frontmarker_1", asRedMarker);
SetFXAttachment("frontlamp", asLamp);
bTailFront = true;

}
if (!bHeadRear)
{
SetFXCoronaTexture("rearbox_0", asHboxDisc);
SetFXCoronaTexture("rearbox_1", asHboxDisc);
bHeadRear = true;
}
}
else
{
//Interface.Log("Switching on no.1 end marker lights - car is single car headed in same direction to train");
// If I had a no.2 end, I'd be setting the no.2 end tail lights too...
if (!bCrewFront)
{
SetFXAttachment("crew_fwd", asCrew);
SetFXAttachment("crew_rev", null);
bCrewFront = true;
bCrewRear = false;
}
// SetFXCoronaTexture("frontmarker_0", null);
// SetFXCoronaTexture("frontmarker_1", null);
SetFXAttachment("frontlamp", null);
SetFXCoronaTexture("rearbox_0", null);
SetFXCoronaTexture("rearbox_1", null);
bHeadRear = false;
bTailFront = false;
if (!bTailRear)
{
// SetFXCoronaTexture("rearmarker_0", asRedMarker);
// SetFXCoronaTexture("rearmarker_1", asRedMarker);
SetFXAttachment("rearlamp", asLamp);
bTailRear = true;

}
if (!bHeadFront)
{
SetFXCoronaTexture("frontbox_0", asHboxDisc);
SetFXCoronaTexture("frontbox_1", asHboxDisc);
bHeadFront = true;
}
 
I figured out how to fix the directional lighting script on that BR Class 37 engine after comparing its lighting script with a similiar BR Class 37 (37906) I had elsewhere on my CM.

Turns out that the section of text '' // '' needed to be removed at the start of each lighting script line { SetFXCoronaTexture } as this was causing a conflict with how the loco lights were supposed to respond regarding which way the loco was facing for forward motion.


* All of the downloaded BR Class 37's on my CM being re-configured with 'Corona Weiss' & 'Corona Rot' lighting.

Andy.
 
Last edited:
Back
Top