How can I make my bus hazards flash when I open any of my doors

  • Please note that answers to questions that receive more than 5 collective down votes will be automatically hidden.

simulatorguy101

Custom Content Creator
Apr 5, 2016
261
I wouldn't know what part of the script, but why would you want Hazards on when at the bus stop, buses just indicate in. They only put hazards on if they have to wait time.
 

BestBear

Member
Nov 4, 2016
174
I wouldn't know what part of the script, but why would you want Hazards on when at the bus stop, buses just indicate in. They only put hazards on if they have to wait time.
Some buses where I live have automatic hazards on when doors open so I wanna follow suit lol. My best guess would be adding a code like when door open, hazards flash xD
 

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,799
Errr...what buses are these?
American ones perhaps?
What I mean is like automatically so when I open/close my doors they on and off.
In the "Script" folder inside the bus in question, you should have a file called something like "lights.osc". This can be opened with a normal plain-text editor such as Notepad.
I'm imagining that the A21 probably uses similar if not the same scripts as the SD202, in which case it will have a couple of lines like this:
Code:
(L.L.lights_sw_blinker) 1 = (L.L.lights_sw_warnblinker) || (L.L.lights_blinkgeber) && (L.L.elec_busbar_avail) sqr * (S.L.lights_blinker_l)
(L.L.lights_sw_blinker) 2 = (L.L.lights_sw_warnblinker) || (L.L.lights_blinkgeber) && (L.L.elec_busbar_avail) sqr * (S.L.lights_blinker_r)
Now, you're interested in the parts up to and including the || for each. These are the conditions for when the left and right indicators should be active. The first line has a check that the indicator ("blinker" in German) stalk is in the "left" position (1) and a check if the hazards ("warnblinker" in German) switch is on. If the stalk is left and/or the hazards switch is on, the left indicator lamps will flash (II is the symbol for "OR"). The second line has the same, but checks if the indicator stalk is right. What you can do is to add other conditions to this that will also cause the indicators to be on.
The door script saves the position of each door leaf in the bus into its own variable. These are door_0, door_1, door_2, etc. You can therefore add door_0 0.1 > || after the existing || and the hazards will also be on whenever the first door leaf is more than 10% open (which also happens to be how open they have to be to light the door light). You can add more of those for each of the leaves you want the hazards to be activated by.
Hopefully this helps. :)
 

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,799
With two doors each with 2 leaves, it becomes:
Code:
(L.L.lights_sw_blinker) 1 = (L.L.lights_sw_warnblinker) || (L.L.door_0) 0.1 > || (L.L.door_1) 0.1 > || (L.L.door_2) 0.1 > || (L.L.door_3) 0.1 > || (L.L.lights_blinkgeber) && (L.L.elec_busbar_avail) sqr * (S.L.lights_blinker_l)
(L.L.lights_sw_blinker) 2 = (L.L.lights_sw_warnblinker) || (L.L.door_0) 0.1 > || (L.L.door_1) 0.1 > || (L.L.door_2) 0.1 > || (L.L.door_3) 0.1 > || (L.L.lights_blinkgeber) && (L.L.elec_busbar_avail) sqr * (S.L.lights_blinker_r)
 

BestBear

Member
Nov 4, 2016
174
Thank you, code works but one little problem.

When I opened any doors, I have to indicate either way, left or right for the hazards to come on.

Also, what does the && (L.L.elec_busbar_avail) mean? and sqr * (S.L.lights_blinker_l)

Thanks again!!!
 

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,799
Oh, of course, the blinker timer (the thing that makes the lights flash rather than always be on) won't be running... derp.
This might be a little more difficult to script than I first thought... :/