![omsi 2 car omsi 2 car](https://mods.club/uploads/mods/23790automobiles-uaz-3909-3962-3741.jpg)
The DLL can set active to true and can trigger the event.Ĭonfiguration Files (or shorter: config files) are all files which supply OMSI with external data and constants and which do not include executable code like the files of the Scripts. This procedure is very similar to AccessVariable, but OMSI will use the trigger list of the *.opl file. In the example, the position of the track bar will be used as new value of the variable with index 1 ("bus_doorfront0"). In this case you have to set write to true to advise OMSI to use the new value. But it is also possible (like in "1:") to give a new value to value. If you just would like to read a vehicle variable, you just have to read value like in the case "0:". The procedure can write now value and write. The index of the variable will be handed over via the variable varindex. While running OMSI, this procedure will be called for all variables listed in the *.opl file. In the example, Form1 will be destroyed and freed. Start hands the parameter "AOwner" over, the Handler of the main form of OMSI.įinalize will be called while closing OMSI. The second step is calling the Show command to make Form1 visible. In this example, it creates Form1 and puts it to the same named variable (which is part of the second Unit). Start( AOwner: TComponent ) will be called at the beginning and allows the DLL to initialize itself. These four procedures have the following functions: Procedure AccessTrigger( triggerindex: word var active: boolean ) stdcall įirst of all note the last section "exports": It contains the four needed procedures of the DLL: AccessVariable, AccessTrigger, Start und Finalize. Procedure AccessVariable( varindex: word var value: single var write: boolean ) stdcall į := floattostrF( value, ffFixed, 5, 1 ) + ' km/h' Procedure Start( AOwner: TComponent ) stdcall The DLL contains of two units, but I present you only the main unit (the second unit does not contain any important implementations): In general it should be possible to create DLLs with other programming languages, but I never tested that. With the shown example, I give you the corresponding Delphi Code.
![omsi 2 car omsi 2 car](https://omsimods.com/wp-content/uploads/2017/11/Tofas-Dogan.jpg)
In this case, there is only one trigger: "bus_doorfront0" with index 0. The command starts with the number of the expected triggers. In this example, the variable with index 0 is "Velocity", the variable with index 1 is "cockpit_heizregler_temp". Of course this won't have any effect, if the driven bus has not these user variables. You can also use user variables of a special bus type. The command starts with the expected number of (only local!) vehicle variables. The command indicates the file name of the corresponding DLL.
![omsi 2 car omsi 2 car](https://s1.gaming-cdn.com/images/products/9279/screenshot/game-steam-omsi-2-add-on-man-dn95-wallpaper-3.jpg)
User interface of the example plug-in Format of the *.opt File To activate, rename this file to "test.opl" This plug-in has three functions: A speedometer (analog and digital) on top, a track bar to set the red heater handle (even if it calls it "Rollband-Sollwert") and a door button named "Button1" (with the same function like the key). You can activate it in renaming the file "test.txt" into "test.opl" (you will find it in the directory "OMSI\plugins"). OMSI contains already an example plug-in. Both files have to be in the directory "OMSI\plugins". You can program plug-in DLLs which have reading and writing access to the vehicle variables and which can activate triggers.Įach plugin consists of a Configuration File with the extension *.opl and a corresponding DLL.