Anzahl der Beiträge : 413 Anmeldedatum : 10.09.09 Alter : 39 Ort : Philadelphia PA
Thema: Kneeling script Do 23 Jun - 1:59
For those who are wondering how to make the bus kneel, here is something which I have came up. Some of the code is based off of what Marpe has done.
Create a new bus by copying a *.bus file and changing the name of the bus within that first. Create a new script file or rename the bremse.osc text file to something else. This ensures that none of the default scripts are overwritten. Open up the bus file and correctly link these files
In this example I used the name bremse-kneel.osc
Code:
'############## 'Brake Script '##############
'Controls Brakes and includes air system (compressor)
'(c) 2007-2011 Rüdiger Hülsmann, Marcel Kuhnt
'Script Version: 1.0 'Omsi release: 1.0
'Needs: '- Engine (for compressor)
'Revision History: '- Rüdiger Hülsmann 11.05.2009 Last Change '- Rüdiger Hülsmann 15.03.2010 Brake squeak '- Marcel Kuhnt 15.04.2010 Pressure Calculation Stabilized '- Rüdiger Hülsmann 06.11.2010 Automatic level control '- Marcel Kuhnt 28.12.2010 Added wheel separated brake force variables '- Rüdiger Hülsmann 01.01.2011 Added ABS function '- Rüdiger Hülsmann 06.01.2011 separated brake force debugged (pipe diameter) '- Rüdiger Hülsmann 23.01.2011 ABS relais sound '- Rüdiger Hülsmann 31.01.2011 Random initial pressure, nonreturn valves for air suspension '- Rüdiger Hülsmann 03.02.2011 Random squeak sound volume
'Kreis 2 in Abhängigkeit vom Druck in Kreis 1 befüllen: Wenn Druckausgleich vorhanden, dann p2=p1 ansonsten Zufallswert unterhalb des Sicherungsdrucks (5 bar) (C.L.bremse_UeVentil_1_schliessdruck) > {if} l0 (S.L.bremse_p_tank02) {else} 300000 random 300000 + (S.L.bremse_p_tank02) {endif}
'Kreis 3 zufällig befüllen, aber mindestens Druck wie in Kreis 500000 random 400000 + l0 max (S.L.bremse_p_tank03) s0
'Kreis 4 in Abhängigkeit vom Druck in Kreis 3 befüllen: Wenn Druckausgleich vorhanden, dann p4=p3 ansonsten Zufallswert unterhalb des Sicherungsdrucks (5 bar) (C.L.bremse_UeVentil_2_schliessdruck) > {if} l0 (S.L.bremse_p_tank04) {else} 300000 random 300000 + (S.L.bremse_p_tank04) s0 {endif}
'Setzen der Luftfederbalgdrücke
300000 random 100000 + (S.L.bremse_p_balg_0_R) 300000 random 100000 + (S.L.bremse_p_balg_0_L) 300000 random 100000 + (S.L.bremse_p_balg_1_R) 300000 random 100000 + (S.L.bremse_p_balg_1_L)
(C.L.bremse_level_setpoint) (L.L.Axle_Suspension_0_R) > {if} ' Rückschlagventil der Luftfederung: (L.L.bremse_p_Tank04) (L.L.bremse_p_balg_0_R) > {if} ' Berechnung des Massenstroms aus Behälter 4 zum Federbalg 0 R
l1 (S.L.bremse_p_Tank04) l2 (S.L.bremse_p_balg_0_R) 460000 / 0.5 max (S.L.Axle_Springfactor_0_R) {endif} {else} ' Berechnung des Massenstroms aus Federbalg 0 R ins Freie
l1 (S.L.bremse_p_balg_0_R) 460000 / 0.5 max (S.L.Axle_Springfactor_0_R) {endif}
'Vorne links
(C.L.bremse_level_setpoint) (L.L.Axle_Suspension_0_L) > {if} ' Rückschlagventil der Luftfederung: (L.L.bremse_p_Tank04) (L.L.bremse_p_balg_0_L) > {if} ' Berechnung des Massenstroms aus Behälter 4 zum Federbalg 0 L
l1 (S.L.bremse_p_Tank04) l2 (S.L.bremse_p_balg_0_L) 460000 / 0.5 max (S.L.Axle_Springfactor_0_L) {endif} {else} ' Berechnung des Massenstroms aus Federbalg 0 L ins Freie
l1 (S.L.bremse_p_balg_0_L) 460000 / 0.5 max (S.L.Axle_Springfactor_0_L) {endif}
'Hinten rechts
(C.L.bremse_level_setpoint) (L.L.Axle_Suspension_1_R) > {if} ' Rückschlagventil der Luftfederung: (L.L.bremse_p_Tank04) (L.L.bremse_p_balg_1_R) > {if} ' Berechnung des Massenstroms aus Behälter 4 zum Federbalg 1 R
l1 (S.L.bremse_p_Tank04) l2 (S.L.bremse_p_balg_1_R) 460000 / 0.5 max (S.L.Axle_Springfactor_1_R) {endif} {else} ' Berechnung des Massenstroms aus Federbalg 0 R ins Freie
l1 (S.L.bremse_p_balg_1_R) 460000 / 0.5 max (S.L.Axle_Springfactor_1_R) {endif}
'Vorne links
(C.L.bremse_level_setpoint) (L.L.Axle_Suspension_1_L) > {if} ' Rückschlagventil der Luftfederung: (L.L.bremse_p_Tank04) (L.L.bremse_p_balg_1_L) > {if} ' Berechnung des Massenstroms aus Behälter 4 zum Federbalg 1 L
l1 (S.L.bremse_p_Tank04) l2 (S.L.bremse_p_balg_1_L) 460000 / 0.5 max (S.L.Axle_Springfactor_1_L) {endif} {else} ' Berechnung des Massenstroms aus Federbalg 0 L ins Freie
Copy the varlist list file and rename it to bremse_kneel_varlist.txt, thiis time, we are going to add a new variable into omsi. Make sure that both of the newly created files has replaced the entries made in the bus file.
Open up the o bremse_kneel_varlist.txt file and add in this text
bremse_kneel
This tells OMSI to create a new variable, the assigned value by default is 0.
Here the breakdown The code which was added to the script file is this:
Code:
(L.L.bremse_halte) {if}
(L.L.Axle_Springfactor_0_R) (L.S.Timegap) 0.15 * - 0.6 max (S.L.Axle_Springfactor_0_R) (L.L.Axle_Springfactor_0_R) 0.6 = {if} (L.L.Axle_Springfactor_1_R) (L.S.Timegap) 0.15 * - 0.6 max (S.L.Axle_Springfactor_1_R) {endif} {else} (L.L.Axle_Springfactor_1_R) (L.S.Timegap) 0.15 * + 1 min (S.L.Axle_Springfactor_1_R)
if (L.L.Axle_Springfactor_0_R) reaches 0.6, it will activated the kneeler on the rear wheels (L.L.Axle_Springfactor_1_R). Both of the kneelers get a 0.15 rate per second reduction all the way down to 0.6.
With this code alone within the script, the script will not work then it is being overwritten by the level control system. So by creating a new variable, bremse_kneel, we can tell OMSI, that whenever a certain condition has been set to disable the level control system. So we compile this script
This tells OMSI that when the stop brake is on, then our newly created variable will get an value of 1. Once the value is set to 1, we have our script which tells OMSI what to tell when the value is set to 1. When it is 1, (M.L.kneel) will execute. If the condition has not been reached, or 0, then the automatic level control will be re-enabled.
nemeza
Anzahl der Beiträge : 204 Anmeldedatum : 27.04.09 Ort : Budapest
Thema: Re: Kneeling script Do 23 Jun - 19:05
Thanks for sharing this script too!
basty1983
Anzahl der Beiträge : 11 Anmeldedatum : 23.05.11
Thema: Kneeling scrip Mo 27 Jun - 5:40
habs net pribiert get it out maybe someone könte a finished script purely telen
Gast Gast
Thema: Re: Kneeling script Mo 27 Jun - 14:18
basty1983 schrieb:
habs net pribiert get it out maybe someone könte a finished script purely telen
YOUR ENGLISCH IS "KATASTROPHAL!!!!!"
basty1983
Anzahl der Beiträge : 11 Anmeldedatum : 23.05.11
Thema: Kneeling script Mo 27 Jun - 14:43
ja ist das was mir der übersetzer überstzt hat
Gast Gast
Thema: Re: Kneeling script Mo 27 Jun - 14:51
IT WORKS!!!!!!!!!!!!!!!!!!!!!!!!!
BEFORE:
AFTER:
Zuletzt von LenkaTim am Di 28 Jun - 12:42 bearbeitet; insgesamt 1-mal bearbeitet
alexandersitko
Anzahl der Beiträge : 125 Anmeldedatum : 07.03.11
Thema: Re: Kneeling script Mo 27 Jun - 18:01
Can you tell me where to add the new parts in the bremse-kneel.osc? I've tried some ways, but none worked.
Gast Gast
Thema: Re: Kneeling script Mo 27 Jun - 18:14
When krtz07 it allowed then i made a download with all files!
Gast Gast
Thema: Re: Kneeling script Di 28 Jun - 12:43
So you can download it at the Bus Mods and Repaints Topic!
first problem: i use this kneeling script for setting height of the bus. i can set 3 height. higher-normal-lower Normal and lower it's OK. but when rise the height of the bus there is no smooth transition between the normal and higher level. here is the code: the part 0.2 is for the higher level. I know that by decreasing the value before the max decreasing the height of the bus.
The other problem is when i use this 2 codes ( i have a 3 state switch for this function) one of them are not working correctly. I mean i can set into higher level but i can't set the lower level. When i delete one of them the other is working correctly.
Problem solved. I made two macro. one for riseing one for sedimentation.
There is two code for the two macro: szintezo_rot is the button of leveling and as i wrote it has 3 state. I wrote an {if} command in the bremse_levelcontrol macro so it works only in the middle position of the button. My only problem is the smooth transition but i hope i can solve it.
Anzahl der Beiträge : 413 Anmeldedatum : 10.09.09 Alter : 39 Ort : Philadelphia PA
Thema: Re: Kneeling script Fr 1 Jul - 13:36
Cool, the whole point of this script really is to get people familiarized enough with the script!
ediblechickenwing
Anzahl der Beiträge : 317 Anmeldedatum : 16.04.10 Ort : South Wales, UK
Thema: Re: Kneeling script Fr 1 Jul - 14:11
Nice to know people are paying such attention to detail, many people don't implement raising devices or "ferry lifts" as we call them or don't even know the bus has them! It can be annoying when you need to use it and you know the bus should have it but it doesn't