* 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;
}