<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.wiki.omnibussimulator.de/omsiwikineu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Faaabiii</id>
	<title>OMSIWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.wiki.omnibussimulator.de/omsiwikineu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Faaabiii"/>
	<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Special:Contributions/Faaabiii"/>
	<updated>2026-04-08T11:25:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Main_Page&amp;diff=82</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Main_Page&amp;diff=82"/>
		<updated>2014-10-17T18:56:25Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font style=&amp;quot;font-size:1.2em;&amp;quot;&amp;gt;&lt;br /&gt;
'''Welcome on the English version of OMSIWiki!'''&lt;br /&gt;
&lt;br /&gt;
Here you can continue directly to one of the main categories:&lt;br /&gt;
&lt;br /&gt;
* [[FAQs - Frequently Asked Questions]]&lt;br /&gt;
* [[:Category:Driving the Bus|Driving the Bus]]&lt;br /&gt;
* Developing Addons:&lt;br /&gt;
** [[:Category:Developing Reference|Reference]]&lt;br /&gt;
** [[:Category:Developing Tutorials|Tutorials]]&lt;br /&gt;
** [[:Category:Developing Tips and Tricks|Tips and Tricks]]&lt;br /&gt;
* [[:Category:Linked Projects|Linked Projects (e.g. Addon-Manager, OAT)]]&lt;br /&gt;
* [[:Category:Addon Presentations|Addon Presentations]]&lt;br /&gt;
* [[:Category:Background Information|Background Information]]&lt;br /&gt;
&lt;br /&gt;
'''Attention: Before changing and creating articles, please read our rules first!''' You will find a very short wiki manual further down, too.&lt;br /&gt;
&lt;br /&gt;
''In progress:''&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* --[[User:Dario|Dario]] 10:19, 17 July 2012 (MEST) Translating some articles&lt;br /&gt;
&lt;br /&gt;
== Idea ==&lt;br /&gt;
&lt;br /&gt;
We (the developers of OMSI) have installed OMSIWiki for getting a better platform for every kind of information dealing with OMSI. At the moment, we plan to have the following topics:&lt;br /&gt;
&lt;br /&gt;
* Presentation of background information about addon design by us (creating of objects and vehicles, sound engine, script engine and so on)&lt;br /&gt;
* Tipps and tricks or even entire tutorials written by users, e.g. about creating repaints or maps&lt;br /&gt;
* Using of OMSI and especially driving bus could be another topic. Of course there exists a manual, but perhaps there are some things which can be explained a little bit better by other users?&lt;br /&gt;
* Also presenting additional projects dealing with OMSI could be another function of this wiki; we think about OAT or the Addon-Manager.&lt;br /&gt;
* This wiki could also be the right place presenting high quality and complex addons, e.g. manuals for addon buses or descriptions and schedules for addon maps. But we don't want tiny articles about repaints or something like that! For this you can better use our forum.&lt;br /&gt;
* Of course you can also present background information about our maps/buses or addon maps/buses (e.g. stories about the real bus service of Berlin in 1989). But it should be a serious article really dealing with OMSI! Don't write unnecessary tiny articles don't dealing with any addon of OMSI!&lt;br /&gt;
&lt;br /&gt;
== Rules ==&lt;br /&gt;
&lt;br /&gt;
=== Does my new article fit into OMSIWiki? ===&lt;br /&gt;
&lt;br /&gt;
Each article should fit in one of the categories on the top of this page!&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Golden Rule&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
First of all the '''&amp;quot;golden rule&amp;quot;''': Before writing or changing an article, please check out if there are changes in our rules! Mainly in the time of commencement, there could be rule changes more often.&lt;br /&gt;
&lt;br /&gt;
=== Do's ===&lt;br /&gt;
&lt;br /&gt;
* If you find a tiny or big mistake, everybody is invited to correct it (even if it depends one of our articles)! But you should feel confident doing that!&lt;br /&gt;
* You think one of our articles is too abstract? Then just add a nice example! E.g. I know that I tend to write too &amp;quot;dusty&amp;quot; and abstract if I have to write long technical texts.&lt;br /&gt;
* You find a technical term which is not be explained? If you find it in Wikipedia, just place an external link. If it is an unexplained term of OMSI, you could add a small article about it.&lt;br /&gt;
* To avoid double writings while you have not finished your article, please add the line &amp;quot;''Note: This article is still in development!''&amp;quot;. This can be also useful if someone likes to translate it.&lt;br /&gt;
* If your article has an equivalent in the German language section, please link them together! Otherwise, please add a note like &amp;quot;''Note: This article still has no German equivalent!''&amp;quot; or &amp;quot;''Note: The German equivalent still is not up to date!''&amp;quot;.&lt;br /&gt;
* If you have fun translating articles, you are very welcome here! If you find one of these notes, feel free to translate the article! (German =&amp;gt; English or the other way round!) But you should inform the author of the original article later that he gets the chance to read and check your translation. If you have translated something, please remove the notes and add the links!&lt;br /&gt;
&lt;br /&gt;
=== Don't Do's ===&lt;br /&gt;
&lt;br /&gt;
* '''Very important: Please think well about the title of a new article! It is not possible to correct it easily. If you add dowdy article titles careless, you will get the chop!&lt;br /&gt;
* bad style in writing! Ok, my English could be much better - but everyone writing here should take trouble writing good articles! Of course if you will find a mistake, you are invited removing it! ;)&lt;br /&gt;
* just advertising unknown, small projects, forums, virtual companies and so on. The idea behind OMSIWiki is not the advertising of projects but being an information platform!&lt;br /&gt;
&lt;br /&gt;
=== Communication ===&lt;br /&gt;
&lt;br /&gt;
* Before starting your work, add a brief description and your signature into the &amp;quot;in progress&amp;quot; section on top of this page.&lt;br /&gt;
* If you would like to do larger changes on one of our articles, it would be very kind to inform us and we can keep track of everything.&lt;br /&gt;
* Before starting a new article, it could not be bad informing us about your intention via e-mail!&lt;br /&gt;
* Don't create new categories without our agreement!&lt;br /&gt;
&lt;br /&gt;
* Please mind the possibility to discuss on the discussion page! Typical source code you will find on Wikipedia discussion pages. And don't forget: the signature can be generated with &amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Multilinguality ===&lt;br /&gt;
&lt;br /&gt;
OMSIWiki was installed in two languages: English and German. Like on the well-known Wikipedia, articles of both languages can be linked together. Of course it would be ideal if both parts of OMSIWiki are on the same state. Of course in practice, this aim cannot be achieved completely...&lt;br /&gt;
&lt;br /&gt;
=== Access ===&lt;br /&gt;
&lt;br /&gt;
In difference to Wikipedia, you have to have an account to make changes. But I don't think that we expect too much... we hope this could be a useful sanction keeping enough control about the wiki.&lt;br /&gt;
&lt;br /&gt;
== Manual ==&lt;br /&gt;
&lt;br /&gt;
Some hints for newbies who do not like to read the complete manual. How do I &amp;quot;build&amp;quot; an OMSIWiki article?&lt;br /&gt;
&lt;br /&gt;
* Signature: Click on the button or write &amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
* Create a new article: After let us know via e-mail or forum, type the well-considered name for the new article into the &amp;quot;search&amp;quot; field and click on &amp;quot;Go&amp;quot;. Because this page does not exist, OMSIWiki will ask you if you would like to create a new article with this name. Just click on &amp;quot;yes&amp;quot; and get to the empty editor.&lt;br /&gt;
* A sensible structure can be created like this:&lt;br /&gt;
 == Main Title ==&lt;br /&gt;
 === Sub Title ===&lt;br /&gt;
 ==== Sub Sub Title ==== and so on.&lt;br /&gt;
* Lists (like this one) can be created like this:&lt;br /&gt;
 * Point&lt;br /&gt;
 * Point&lt;br /&gt;
 ** Sub Point&lt;br /&gt;
* A # instead of a * will create a numbered list.&lt;br /&gt;
* Bold and italic:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ''Italic''&lt;br /&gt;
 '''Bold'''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can add your article to a category (e.g. ''Driving the Bus'') by adding &amp;lt;nowiki&amp;gt;[[Category:Driving the Bus]]&amp;lt;/nowiki&amp;gt; at the bottom of your article.&lt;br /&gt;
&lt;br /&gt;
Further information about creating wiki articles:&lt;br /&gt;
&lt;br /&gt;
[http://meta.wikimedia.org/wiki/Help:Contents http://meta.wikimedia.org/wiki/Help:Contents]&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
* Sept. 9th 2011 - Marcel Kuhnt: Creating of the English Main Page of OMSIWiki&lt;br /&gt;
* Sept. 13th 2011 - Marcel Kuhnt: OMSIWiki is now public&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.omnibussimulator.de/english.htm www.omnibussimulator.de] - official website of OMSI]&lt;br /&gt;
* [http://omnibussimulator.forumieren.com omnibussimulator.forumieren.com] - official OMSI forum&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&lt;br /&gt;
[[Technical Information about MediaWiki]]&lt;br /&gt;
&lt;br /&gt;
[[de:Hauptseite]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Guide_to_Performance-Friendly_Vehicle_Construction&amp;diff=81</id>
		<title>Guide to Performance-Friendly Vehicle Construction</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Guide_to_Performance-Friendly_Vehicle_Construction&amp;diff=81"/>
		<updated>2014-10-17T18:51:33Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: Created page with &amp;quot;''This article is originally written by Marcel Kuhnt. So'' I ''refers to him.''  As the name suggests, this guide is to provide opportunities and food for thought to make OMSI-ve...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This article is originally written by Marcel Kuhnt. So'' I ''refers to him.''&lt;br /&gt;
&lt;br /&gt;
As the name suggests, this guide is to provide opportunities and food for thought to make OMSI-vehicles as performance-friendly as possible.&lt;br /&gt;
&lt;br /&gt;
A OMSI vehicle consists of 3D-models, textures, sounds and scripts - and in all four areas you should pay attention more or less intense on an optimization in terms of performance!&lt;br /&gt;
&lt;br /&gt;
But one thing always applies: '''Even if you no longer have to be stingy as in the past: You should waste by no means!''' So for each part that you model, for each sound and for each texture you should have in mind what is both useful and necessary, or what may be more than you need. That this is a matter of taste, of course, goes without saying.&lt;br /&gt;
&lt;br /&gt;
== 3D-Models ==&lt;br /&gt;
&lt;br /&gt;
=== Theory ===&lt;br /&gt;
&lt;br /&gt;
First we must define the term 'drawcall':&lt;br /&gt;
&lt;br /&gt;
While the bus is drawn (as everything else) of single triangles, the triangles are combined to meshes with the same material properties, textures, and so on. Such a combined drawing process is called 'drawcall'. Internally, this is first prepared by OMSI, then all the parameters are passed to the graphics card and finally the graphics card processes &amp;quot;independently&amp;quot; the drawcall with all its triangles.&lt;br /&gt;
&lt;br /&gt;
This connection also explains why one drawcall with 100,000 vertices is processed considerably faster than 1000 Drawcalls with each 100 vertices.&lt;br /&gt;
&lt;br /&gt;
=== Not too many o3d-files and not too many individual textures ===&lt;br /&gt;
&lt;br /&gt;
Each o3d-file causes at least one drawcall per texture that uses the o3d-file. Each o3d file causes at least one Drawcall per texture that uses the o3d-file. In certain cases - and in particular at x-files - it may even be multiple drawcalls per texture and o3d file.&lt;br /&gt;
&lt;br /&gt;
This results in the following rules:&lt;br /&gt;
&lt;br /&gt;
'''Use a minimal number of o3d-files per bus.'''&lt;br /&gt;
&lt;br /&gt;
Inevitable is a separation for animations and often for transparent things where the rendering order is set on the separation. There is no way out of that.&lt;br /&gt;
&lt;br /&gt;
However, it is easily possible to put the vehicle together out of very few non-animated o3d files, e.g. (order = rendering order):&lt;br /&gt;
&lt;br /&gt;
# Interior mesh including driver's workplace without indicator lights, switches, etc.&lt;br /&gt;
# Transparencies in the interior&lt;br /&gt;
# Exterior mesh&lt;br /&gt;
# window panes from the inside&lt;br /&gt;
# window panes from the outside&lt;br /&gt;
&lt;br /&gt;
'''Within an o3d-file as little different textures as possible.'''&lt;br /&gt;
&lt;br /&gt;
With the explanation above probably easy to understand: If my entire exterior mesh has only one texture, then it is only one drawcall. This is better than my exterior mesh using two textures, so that it must be rendered in two drawcalls.&lt;br /&gt;
If a component is always getting animated anyway (typical example: wheels), then it is less tragic if the texture is separate. However, the [[LOD]]s should also be considered: Since our cars do not have animated wheels at a greater distance, we have integrated their texture into the main texture, too.&lt;br /&gt;
&lt;br /&gt;
=== Use of reduced display for distance and AI vehicles ===&lt;br /&gt;
&lt;br /&gt;
By using LODs, a vehicle can be drawn simpler at greater distance. It should also be simplified when not in use by the user.&lt;br /&gt;
&lt;br /&gt;
'''Every vehicle should have at least two LOD-levels, so it is simplified a lot below about 10% of the screen size.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:2012 0716 05 Performance.jpg|600px|link=http://www.omnibussimulator.de/omsiwiki.de/images/3/34/2012_0716_05_Performance.jpg|thumb|right|The very simple LOD mesh of the SD77 for greater distance. Although rather simple, it is sufficient for greater distance and fairly economical. Only downside: Because of the repaint-possibilities the big 1024-texture for the exterior mesh must be loaded all the same, but apart from the reflexion texture that is all!]]&lt;br /&gt;
In this scale one can already do without the interior, the exterior should only be a very simple mesh anymore (20-50 vertecies). We also renounced on night textures and light effects in this distance entirely. One must only see that &amp;quot;there is a bus driving&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''All vehicles should be greatly simplified for AI.''' (The same applies to &amp;quot;abandoned&amp;quot; user vehicles. All flags, such as the following, which relate to this nomenclature, classify abandoned user vehicles as AI vehicles.)&lt;br /&gt;
&lt;br /&gt;
This purpose serves the viewpoint command. The number underneath can take following values:&lt;br /&gt;
&lt;br /&gt;
* 0 = always visible&lt;br /&gt;
* 1 = only visible from outside on the current user vehicle&lt;br /&gt;
* 2 = only visible from inside on the current user vehicle&lt;br /&gt;
* 3 = 1 + 2, visible from inside and outside on the current user vehicle&lt;br /&gt;
* 4 = only visible on AI vehicles&lt;br /&gt;
* 5 = 4 + 1, visible on AI vehicles or only from outside on the current user vehicle&lt;br /&gt;
* 6 = 2 + 4, visible on AI vehicles or only from inside on the current user vehicle&lt;br /&gt;
* 7 = 1 + 2 + 4, always visible (same as 0)&lt;br /&gt;
&lt;br /&gt;
Note: You only look at an AI vehicle from outside and usually not so accurately. However it can be close by and you often look into it from behind (at traffic lights or at a bus stop).&lt;br /&gt;
&lt;br /&gt;
* AI vehicles should therefore have the complete and detailed exterior mesh and rough things of the interior mesh like panelling, seats etc. Those things that you see from behind are particularly important.&lt;br /&gt;
* AI vehicles do not need an animated cockpit (animated seat, steering wheel) and handrails can be greatly simplified. Theoretically this also goes for your ''own'' bus from outside but you do not need to be so saving here because your own bus is visible only once - AI vehicles on the other hand often in large numbers.&lt;br /&gt;
* Drawcalls provide a high potential again: Typically with all optimization there will be more than one textur for the interior but only one for the exterior mesh.  So it makes sense to save as many textures of the interior as possible. The static dashboard, the steering wheel, the remaining handrails etc. often use seperate textures and should be mapped on a small area of a still necessary texture in the AI-mesh, e.g. a simple dark-grey, slightly &amp;quot;roughened&amp;quot; surface. But be careful: This is only useful if one or more complete textures can be saved.&lt;br /&gt;
&lt;br /&gt;
==== The AI model of the SD77 as an example ====&lt;br /&gt;
&lt;br /&gt;
The AI interior mesh of the SD77 only needs the textures SD77_02.bmp, _03.bmp and _04.bmp. The textures of the driver seat, panel, thermometer and cashdesk are saved compared with the user interior:&lt;br /&gt;
&lt;br /&gt;
[http://www.omnibussimulator.de/omsiwiki.de/images/2/2b/2012_0716_03_Performance.jpg Picture]&lt;br /&gt;
&lt;br /&gt;
Differences between AI and user mesh of the SD77. In the view from behind those slight differences can be spotted, which especially mesh simplifications with larger poly-reduction potential have: handrails, stop-request buttons, handles on the seats. Important details like seats, stringers or lamps must remain:&lt;br /&gt;
&lt;br /&gt;
[http://www.omnibussimulator.de/omsiwiki.de/images/5/5d/2012_0716_04_Performance.jpg Picture]&lt;br /&gt;
&lt;br /&gt;
=== Do not use too many vertecies - textures can provide reasonable assistance ===&lt;br /&gt;
&lt;br /&gt;
Once upon a time™, when we began to build models for Flight Simulator, we had to draw the mesh by hand on graph paper and measure out and convert the coordinates ourselves. Then we sat down in front of the punch-card punching machine and we had better not make a mistake... okay, enough of those antiquated tales of former times™! :-D (Although the beginning is correct, the design programs for Flight Simulator only really got going with the versions 2000/2002 with FSDS and Gmax...)&lt;br /&gt;
&lt;br /&gt;
What you can learn from this story: Simply out of selfishness one was frugal with polys and vertices. You keep this attitude - while today we look at the freeware-NL202 and admire the 3D-lion and the 3D-letters - and are just as amazed that OMSI tolerates this...&lt;br /&gt;
&lt;br /&gt;
Of course, the NL202 is a successful and naturally very popular OMSI addon. Nevertheless, I am being cheeky and put it next to our NG272 (WIP at that time):&lt;br /&gt;
&lt;br /&gt;
[http://www.omnibussimulator.de/omsiwiki.de/images/5/5d/2012_0716_04_Performance.jpg Picture]&lt;br /&gt;
&lt;br /&gt;
What do you notice? The NL202 has much more polygons than the NG272. Of course, certain things can only be represented with appropriately detailed modelling, e.g. the oblique position of the air vents or the profile of the rubber bars of the windows. But when building a vehicle one must constantly wonder: Do I really need that? Is the effort and the higher polygon count worth it? Certainly it looks very nice but how often are you back at the engine compartment?&lt;br /&gt;
&lt;br /&gt;
If you look at it from far away, a photo real texture is generally sufficient. Of course, in return our air vents do not shine so prettily in the sun! :)&lt;br /&gt;
&lt;br /&gt;
=== Only put verticies in places where they make sense ===&lt;br /&gt;
&lt;br /&gt;
Another example on vertex saving:&lt;br /&gt;
&lt;br /&gt;
[http://www.omnibussimulator.de/omsiwiki.de/images/1/16/2012_0716_07_Performance.jpg Picture]&lt;br /&gt;
&lt;br /&gt;
Of course, the pipe in the middle is the nicest! :) But it also has most polygons. Now, the question is - how exactly do you save polygons and how much optical loss does it take?&lt;br /&gt;
&lt;br /&gt;
In this case, polys can either be saved longitudinally or circumferentially. What is better? If you would like to maintain about the same numbers of vertecies and faces, then the pipes look as shown. The left pipe is no longer broken in longitudinal direction, but the scope still has 32 ​​edges. The right pipe on the other hand has only 8 edges, but all seven breaks (also corresponds to 32 corners along the full circle!) could be maintained which is obviously the better solution since you only notice the cross-section where the profile ends (e.g. exhaust) or where it encounters a different-coloured surface respectively takes on a different coulour itself while you often look directly at the longitudinal direction, as you do in this example.&lt;br /&gt;
&lt;br /&gt;
Handrails, which are often lively designed in today's buses, typically resemble this: There the swing should also be sufficiently round - in return the profile can be a bit edgier (octagon or even hexagon).&lt;br /&gt;
&lt;br /&gt;
So in order to get back to the beginning: In 1995 the FlightShop-Jumbo for Flight Simulator 95 had an octagonal (!!!) fuselage profile! You schoul always consider this when constructing a handrail profile with 32 edges! :D&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&lt;br /&gt;
An important aspect has already been mentioned: &lt;br /&gt;
&lt;br /&gt;
=== Few big textures are generally better than many small ones === &lt;br /&gt;
&lt;br /&gt;
... especially when they are applied together on one o3d file. Obviously there are limits: On one hand textures become a bit unhandy at a certain resolution. That is why we usually only go up to 1024x1024, although this limit is certainly not quite up to date.&lt;br /&gt;
&lt;br /&gt;
=== Use regular resolutions! ===&lt;br /&gt;
&lt;br /&gt;
Once every object builder for Flight Simulator knew what is no more common knowledge today: Textures should have pixel dimensions that follow the power-of-two row:&lt;br /&gt;
&lt;br /&gt;
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, (2048, 4096, ...)&lt;br /&gt;
&lt;br /&gt;
The values ​​in parentheses are beyond what we usually use and frankly I do not know what restrictions there may be even today. But up to 1024 is no problem.&lt;br /&gt;
&lt;br /&gt;
Rectangles are also ok, as long as the series above is maintained. Earlier in Flight Simulator, 256x256 was the ultimate standard for all textures, thus &amp;quot;old stagers&amp;quot; often use this measure today still. But 1024x128 is also ok, as is 512x512 or 4x128. You should only avoid crooked measures (200x300 or 256x77) because the processing tends to get worse. To what extent this is still the case on current graphics cards, I do not know - but in order to achieve compatibility to older graphics cards it cannot hurt to stick to the rule.&lt;br /&gt;
&lt;br /&gt;
Such &amp;quot;crooked&amp;quot; cases are rounded to the next &amp;quot;allowed&amp;quot; measure, anyway. So you can round up by yourself right away and use the remaining areas sensible instead of letting them expire.&lt;br /&gt;
&lt;br /&gt;
=== File formats ===&lt;br /&gt;
&lt;br /&gt;
DirectX loads quite a lot formats. The traditional format is bitmap (*.bmp). Since this format is not compressed, some are inclined to use JPG.&lt;br /&gt;
&lt;br /&gt;
Wether the loading time gets faster or slower, I cannot say and that certainly also depends on the look of the texture and a variety of other factors. But it should be clear to you that (as far as I know) it does not help to save graphics memory because JPEG-formats cannot be applied in the graphics memory.&lt;br /&gt;
&lt;br /&gt;
So if you want to save graphics memory, you should rather take the DDS-format which offers a compression that - if I am correctly informed - also carries over to the graphics memory.&lt;br /&gt;
&lt;br /&gt;
== Sound ==&lt;br /&gt;
&lt;br /&gt;
When it comes to sound you cannot do much wrong, actually. Basically OMSI is quite frugal there and designed so that vehicles can have maaaany sounds in order to make a whole lot of fun and normally slightly longer samples of 48kHz should be no issue.&lt;br /&gt;
&lt;br /&gt;
However OMSI has for reasons of performance a sound counter and a sorting function which ensure that a certain maximum number of sounds is not exceeded. This affects not only currently audible sounds but also &amp;quot;theoretically audible&amp;quot; sounds, which must be constantly checked whether they need to be heard soon. So that no free &amp;quot;sound spaces&amp;quot; are unnecessarily wasted, there is the possibility that AI-vehicles (and abandoned user-vehicles) are equipped with a simpler sound set.&lt;br /&gt;
&lt;br /&gt;
This is quite simple to realize:&lt;br /&gt;
&lt;br /&gt;
1. First you create the normal sound.cfg as usual and finish it completely.&lt;br /&gt;
&lt;br /&gt;
2. Now you copy and rename it, e.g. to sound_AI.cfg.&lt;br /&gt;
&lt;br /&gt;
3. Now you delete all sound entries in this file that are unnecessary for vehicles which are not controlled by the user - these are: &lt;br /&gt;
:* starter and switch off sound&lt;br /&gt;
:* sound effects that are primarily audible from within, e.g. the air compressor or the rattling in stand in the SD&lt;br /&gt;
:* cockpit or similar system sounds like switches, warnings, IBIS, rollsigns, wipers, etc. pp.&lt;br /&gt;
:* But we have kept the sounds of engine and gearbox, which are audible from outside, and of retarder, doors, auxiliary heating and brake squeal as well.&lt;br /&gt;
&lt;br /&gt;
4. Last but not least you have to add the following entry to the *.bus/*.ovh-file: [sound_ai] | sound\sound_AI.cfg, so that OMSI knows that there is an AI-soundset.&lt;br /&gt;
&lt;br /&gt;
You will quickly find out how much you can save here and how many more vehicles will then still &amp;quot;sound&amp;quot; nearby as opposed to previously.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
=== Generally ===&lt;br /&gt;
&lt;br /&gt;
Similar to the sound, it is possible to run a simplified script. How this is done is described in the article [[Scripting System]].&lt;br /&gt;
&lt;br /&gt;
However, in order to be able to take over a vehicle at all times, all normal variables are always keep ready. But this is usually not a major problem.&lt;br /&gt;
&lt;br /&gt;
Apart from that OMSI is also frugal in terms of the script respectively there is no big optimization potential. In general one can give script developers this to take along: as little as possible as much as is necessary. You need not be stingy and you should not waste. When you can decide between two variants, you should try to take the one with better performance.&lt;br /&gt;
&lt;br /&gt;
Incidentally, if repeatedly used script sequences are outsourced in a shared macro, you save loading time and memory. Probably only microscopically little, but all the same! ;-)&lt;br /&gt;
&lt;br /&gt;
=== Special performance problems ===&lt;br /&gt;
&lt;br /&gt;
However, what you should be aware of, are possible bottlenecks. The script itself is relatively uncritical. But system macros need occasionally some processing by OMSI, e.g. when some .hof-file is searched. So it makes sense to be sparing with system macros.&lt;br /&gt;
&lt;br /&gt;
In addition, the variable '''Refresh Strings''' allows a specific updating of OMSI-fonts on the vehicle (or sceneryobject): This should only happen when something actually changed. On your own vehicle this is not so critical but AI-vehicles should only refresh their strings when something actually changes - e.g. the matrix display.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developing Reference]]&lt;br /&gt;
[[de:Leitfaden performancefreundlicher Fahrzeugbau]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=File:2012_0716_05_Performance.jpg&amp;diff=80</id>
		<title>File:2012 0716 05 Performance.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=File:2012_0716_05_Performance.jpg&amp;diff=80"/>
		<updated>2014-10-17T18:29:38Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Main_Page&amp;diff=79</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Main_Page&amp;diff=79"/>
		<updated>2014-05-16T14:24:17Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font style=&amp;quot;font-size:1.2em;&amp;quot;&amp;gt;&lt;br /&gt;
'''Welcome on the English version of OMSIWiki!'''&lt;br /&gt;
&lt;br /&gt;
Here you can continue directly to one of the main categories:&lt;br /&gt;
&lt;br /&gt;
* [[FAQs - Frequently Asked Questions]]&lt;br /&gt;
* [[:Category:Driving the Bus|Driving the Bus]]&lt;br /&gt;
* Developing Addons:&lt;br /&gt;
** [[:Category:Developing Reference|Reference]]&lt;br /&gt;
** [[:Category:Developing Tutorials|Tutorials]]&lt;br /&gt;
** [[:Category:Developing Tips and Tricks|Tips and Tricks]]&lt;br /&gt;
* [[:Category:Linked Projects|Linked Projects (e.g. Addon-Manager, OAT)]]&lt;br /&gt;
* [[:Category:Addon Presentations|Addon Presentations]]&lt;br /&gt;
* [[:Category:Background Information|Background Information]]&lt;br /&gt;
&lt;br /&gt;
'''Attention: Before changing and creating articles, please read our rules first!''' You will find a very short wiki manual further down, too.&lt;br /&gt;
&lt;br /&gt;
''In progress:''&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* --[[User:Dario|Dario]] 10:19, 17 July 2012 (MEST) Translating some articles&lt;br /&gt;
* --[[User:Faaabiii|Faaabiii]] 16:24, 16 May 2014 (MEST) Translating &amp;quot;Guide Performance-friendly Vehicle Construction&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Idea ==&lt;br /&gt;
&lt;br /&gt;
We (the developers of OMSI) have installed OMSIWiki for getting a better platform for every kind of information dealing with OMSI. At the moment, we plan to have the following topics:&lt;br /&gt;
&lt;br /&gt;
* Presentation of background information about addon design by us (creating of objects and vehicles, sound engine, script engine and so on)&lt;br /&gt;
* Tipps and tricks or even entire tutorials written by users, e.g. about creating repaints or maps&lt;br /&gt;
* Using of OMSI and especially driving bus could be another topic. Of course there exists a manual, but perhaps there are some things which can be explained a little bit better by other users?&lt;br /&gt;
* Also presenting additional projects dealing with OMSI could be another function of this wiki; we think about OAT or the Addon-Manager.&lt;br /&gt;
* This wiki could also be the right place presenting high quality and complex addons, e.g. manuals for addon buses or descriptions and schedules for addon maps. But we don't want tiny articles about repaints or something like that! For this you can better use our forum.&lt;br /&gt;
* Of course you can also present background information about our maps/buses or addon maps/buses (e.g. stories about the real bus service of Berlin in 1989). But it should be a serious article really dealing with OMSI! Don't write unnecessary tiny articles don't dealing with any addon of OMSI!&lt;br /&gt;
&lt;br /&gt;
== Rules ==&lt;br /&gt;
&lt;br /&gt;
=== Does my new article fit into OMSIWiki? ===&lt;br /&gt;
&lt;br /&gt;
Each article should fit in one of the categories on the top of this page!&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Golden Rule&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
First of all the '''&amp;quot;golden rule&amp;quot;''': Before writing or changing an article, please check out if there are changes in our rules! Mainly in the time of commencement, there could be rule changes more often.&lt;br /&gt;
&lt;br /&gt;
=== Do's ===&lt;br /&gt;
&lt;br /&gt;
* If you find a tiny or big mistake, everybody is invited to correct it (even if it depends one of our articles)! But you should feel confident doing that!&lt;br /&gt;
* You think one of our articles is too abstract? Then just add a nice example! E.g. I know that I tend to write too &amp;quot;dusty&amp;quot; and abstract if I have to write long technical texts.&lt;br /&gt;
* You find a technical term which is not be explained? If you find it in Wikipedia, just place an external link. If it is an unexplained term of OMSI, you could add a small article about it.&lt;br /&gt;
* To avoid double writings while you have not finished your article, please add the line &amp;quot;''Note: This article is still in development!''&amp;quot;. This can be also useful if someone likes to translate it.&lt;br /&gt;
* If your article has an equivalent in the German language section, please link them together! Otherwise, please add a note like &amp;quot;''Note: This article still has no German equivalent!''&amp;quot; or &amp;quot;''Note: The German equivalent still is not up to date!''&amp;quot;.&lt;br /&gt;
* If you have fun translating articles, you are very welcome here! If you find one of these notes, feel free to translate the article! (German =&amp;gt; English or the other way round!) But you should inform the author of the original article later that he gets the chance to read and check your translation. If you have translated something, please remove the notes and add the links!&lt;br /&gt;
&lt;br /&gt;
=== Don't Do's ===&lt;br /&gt;
&lt;br /&gt;
* '''Very important: Please think well about the title of a new article! It is not possible to correct it easily. If you add dowdy article titles careless, you will get the chop!&lt;br /&gt;
* bad style in writing! Ok, my English could be much better - but everyone writing here should take trouble writing good articles! Of course if you will find a mistake, you are invited removing it! ;)&lt;br /&gt;
* just advertising unknown, small projects, forums, virtual companies and so on. The idea behind OMSIWiki is not the advertising of projects but being an information platform!&lt;br /&gt;
&lt;br /&gt;
=== Communication ===&lt;br /&gt;
&lt;br /&gt;
* Before starting your work, add a brief description and your signature into the &amp;quot;in progress&amp;quot; section on top of this page.&lt;br /&gt;
* If you would like to do larger changes on one of our articles, it would be very kind to inform us and we can keep track of everything.&lt;br /&gt;
* Before starting a new article, it could not be bad informing us about your intention via e-mail!&lt;br /&gt;
* Don't create new categories without our agreement!&lt;br /&gt;
&lt;br /&gt;
* Please mind the possibility to discuss on the discussion page! Typical source code you will find on Wikipedia discussion pages. And don't forget: the signature can be generated with &amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Multilinguality ===&lt;br /&gt;
&lt;br /&gt;
OMSIWiki was installed in two languages: English and German. Like on the well-known Wikipedia, articles of both languages can be linked together. Of course it would be ideal if both parts of OMSIWiki are on the same state. Of course in practice, this aim cannot be achieved completely...&lt;br /&gt;
&lt;br /&gt;
=== Access ===&lt;br /&gt;
&lt;br /&gt;
In difference to Wikipedia, you have to have an account to make changes. But I don't think that we expect too much... we hope this could be a useful sanction keeping enough control about the wiki.&lt;br /&gt;
&lt;br /&gt;
== Manual ==&lt;br /&gt;
&lt;br /&gt;
Some hints for newbies who do not like to read the complete manual. How do I &amp;quot;build&amp;quot; an OMSIWiki article?&lt;br /&gt;
&lt;br /&gt;
* Signature: Click on the button or write &amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
* Create a new article: After let us know via e-mail or forum, type the well-considered name for the new article into the &amp;quot;search&amp;quot; field and click on &amp;quot;Go&amp;quot;. Because this page does not exist, OMSIWiki will ask you if you would like to create a new article with this name. Just click on &amp;quot;yes&amp;quot; and get to the empty editor.&lt;br /&gt;
* A sensible structure can be created like this:&lt;br /&gt;
 == Main Title ==&lt;br /&gt;
 === Sub Title ===&lt;br /&gt;
 ==== Sub Sub Title ==== and so on.&lt;br /&gt;
* Lists (like this one) can be created like this:&lt;br /&gt;
 * Point&lt;br /&gt;
 * Point&lt;br /&gt;
 ** Sub Point&lt;br /&gt;
* A # instead of a * will create a numbered list.&lt;br /&gt;
* Bold and italic:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ''Italic''&lt;br /&gt;
 '''Bold'''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can add your article to a category (e.g. ''Driving the Bus'') by adding &amp;lt;nowiki&amp;gt;[[Category:Driving the Bus]]&amp;lt;/nowiki&amp;gt; at the bottom of your article.&lt;br /&gt;
&lt;br /&gt;
Further information about creating wiki articles:&lt;br /&gt;
&lt;br /&gt;
[http://meta.wikimedia.org/wiki/Help:Contents http://meta.wikimedia.org/wiki/Help:Contents]&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
* Sept. 9th 2011 - Marcel Kuhnt: Creating of the English Main Page of OMSIWiki&lt;br /&gt;
* Sept. 13th 2011 - Marcel Kuhnt: OMSIWiki is now public&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.omnibussimulator.de/english.htm www.omnibussimulator.de] - official website of OMSI]&lt;br /&gt;
* [http://omnibussimulator.forumieren.com omnibussimulator.forumieren.com] - official OMSI forum&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&lt;br /&gt;
[[Technical Information about MediaWiki]]&lt;br /&gt;
&lt;br /&gt;
[[de:Hauptseite]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Bounding_Box&amp;diff=78</id>
		<title>Bounding Box</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Bounding_Box&amp;diff=78"/>
		<updated>2014-05-16T14:21:11Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: Created page with &amp;quot;The bounding box is needed in the geometric data for the configuration of a vehicle.  =Application=  The bounding box is entered under &amp;quot;[boundingbox]&amp;quot; in the respective .bus-file...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The bounding box is needed in the geometric data for the configuration of a vehicle.&lt;br /&gt;
&lt;br /&gt;
=Application=&lt;br /&gt;
&lt;br /&gt;
The bounding box is entered under &amp;quot;[boundingbox]&amp;quot; in the respective .bus-file or .ovh-file of a vehicle. It creates a cubical collision model around the vehicle which ensures that it can collide with the scenery and other objects.&lt;br /&gt;
&lt;br /&gt;
=Definition=&lt;br /&gt;
&lt;br /&gt;
The bounding box is made up as follows:&lt;br /&gt;
&lt;br /&gt;
==Requirementsn==&lt;br /&gt;
&lt;br /&gt;
*Width without outside mirrors in m of the vehicle to be simulated&lt;br /&gt;
*Length in m of the vehicle to be simulated&lt;br /&gt;
*Height in m of the vehicle to be simulated&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
The bounding box is made of six values which are entered in one line each:&lt;br /&gt;
&lt;br /&gt;
#Width&lt;br /&gt;
#Length&lt;br /&gt;
#Height&lt;br /&gt;
#Distance of the center of the bounding box from the origin of the local coordinate system on the width axis in m (x)&lt;br /&gt;
#Distance of the center of the bounding box from the origin of the local coordinate system on the length axis in m (y)&lt;br /&gt;
#Distance of the center of the bounding box from the origin of the local coordinate system on the height axis in m (z)&lt;br /&gt;
&lt;br /&gt;
=Note!=&lt;br /&gt;
&lt;br /&gt;
Many maps have at object transitions &amp;quot;invisible walls&amp;quot; where mainly low-lying vehicles get stuck. To avoid this, the height of affected vehicles can be reduced by one meter and the distance of the box to the origin on the z-axis can be increased by one meter.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developing Reference]]&lt;br /&gt;
[[de:Boundingbox]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=DISABLED-Command&amp;diff=77</id>
		<title>DISABLED-Command</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=DISABLED-Command&amp;diff=77"/>
		<updated>2014-05-16T14:18:55Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: Created page with &amp;quot;''OMSI 2 only!''  Some Configuration Files allow the commands &amp;quot;-&amp;lt;DISABLED&amp;gt;-&amp;quot; and &amp;quot;-&amp;lt;ENABLED&amp;gt;-&amp;quot;. These commands can be used to comment multiple lines withou...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''OMSI 2 only!''&lt;br /&gt;
&lt;br /&gt;
Some [[Configuration File|Configuration Files]] allow the commands &amp;quot;-&amp;lt;DISABLED&amp;gt;-&amp;quot; and &amp;quot;-&amp;lt;ENABLED&amp;gt;-&amp;quot;. These commands can be used to comment multiple lines without having to comment the relevant keywords individually.&lt;br /&gt;
&lt;br /&gt;
It is simple to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{valid lines}&lt;br /&gt;
...&lt;br /&gt;
-&amp;lt;DISABLED&amp;gt;-&lt;br /&gt;
...&lt;br /&gt;
{commented lines}&lt;br /&gt;
...&lt;br /&gt;
-&amp;lt;ENABLED&amp;gt;-&lt;br /&gt;
...&lt;br /&gt;
{valid lines}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command can be used in the following configuration files:&lt;br /&gt;
&lt;br /&gt;
*.bus, *.ovh, *.sco, *.hum, model.cfg, envir.cfg, passengercabin.cfg, path.cfg&lt;br /&gt;
&lt;br /&gt;
[[Category:Developing Reference]]&lt;br /&gt;
[[de:DISABLED-Befehl]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Inverse_of_the_Minimum_Turning_Radius&amp;diff=76</id>
		<title>Inverse of the Minimum Turning Radius</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Inverse_of_the_Minimum_Turning_Radius&amp;diff=76"/>
		<updated>2014-05-16T14:16:47Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: Created page with &amp;quot;The inverse of the minimum turning radius is needed in the basic physical data for the configuration of a vehicle.  =Application=  The inverse of the minimum turning radius is en...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The inverse of the minimum turning radius is needed in the basic physical data for the configuration of a vehicle.&lt;br /&gt;
&lt;br /&gt;
=Application=&lt;br /&gt;
&lt;br /&gt;
The inverse of the minimum turning radius is entered under &amp;quot;[inv_min_turnradius]&amp;quot; in the respective .bus or .ovh-file of a vehicle.&lt;br /&gt;
&lt;br /&gt;
=Calculation=&lt;br /&gt;
&lt;br /&gt;
The inverse of the minimum turning radius is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
== Requirements==&lt;br /&gt;
&lt;br /&gt;
*Wheelbase in m of the vehicle to be simulated&lt;br /&gt;
*Turning radius in m from the outer wheel to the outer wheel of the vehicle to be simulated&lt;br /&gt;
*Optional: Windows calculator in scientific view &lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
# (2 * wheelbase) / turning radius = sin(maximum turning angle of the wheels on the steering axis in °) &lt;br /&gt;
# tan(maximum turning angle of the wheels on the steering axis in °) / wheelbase&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developing Reference]]&lt;br /&gt;
[[de:Kehrwert des minimalen Lenkradius]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Vehicle_Mass&amp;diff=75</id>
		<title>Vehicle Mass</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Vehicle_Mass&amp;diff=75"/>
		<updated>2014-05-16T14:12:50Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: Created page with &amp;quot;The mass of a vehicle is required for its correct simulation. OMSI always calculates the current weight by adding the kerb weight (specified in the basic physical data under [mas...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The mass of a vehicle is required for its correct simulation. OMSI always calculates the current weight by adding the kerb weight (specified in the basic physical data under [mass]) to the mass of all passengers currently on board.  &lt;br /&gt;
&lt;br /&gt;
Therefore, if possible it is important to use the dry weight when entering a value for [mass], thus without tank capacity, luggage, passengers and of course the drivers themselves.&lt;br /&gt;
&lt;br /&gt;
The mass of the vehicle is specified in t.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developing Reference]]&lt;br /&gt;
[[de:Fahrzeugmasse]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
	<entry>
		<id>http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Scripting_System&amp;diff=74</id>
		<title>Scripting System</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.omnibussimulator.de/omsiwikineu/index.php?title=Scripting_System&amp;diff=74"/>
		<updated>2014-05-16T14:08:12Z</updated>

		<summary type="html">&lt;p&gt;Faaabiii: Created page with &amp;quot;The scripting system in OMSI lets you equip sceneryobjects and in particular vehicles with individual systems, which communicate via variables and function calls with the main pr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The scripting system in OMSI lets you equip sceneryobjects and in particular vehicles with individual systems, which communicate via variables and function calls with the main program and the grafics engine respectively the sound engine.&lt;br /&gt;
&lt;br /&gt;
== Files of the Scripting System ==&lt;br /&gt;
&lt;br /&gt;
The scripting system contains the following files:&lt;br /&gt;
&lt;br /&gt;
* scripting files with executable code (*.osc)&lt;br /&gt;
* varlist files and stringvarlist files in the OMSI\program directory for the definition of systemfiles and predefined files&lt;br /&gt;
* varlist files and stringvarlist files for the definition of uservariables&lt;br /&gt;
* constfile files for the definition of userconstants and function tables&lt;br /&gt;
&lt;br /&gt;
Apart from the files for the definition of systemvariables all required files for each vehicle/sceneryobject (below short: object) must be registered in its [[Configuration File]].&lt;br /&gt;
&lt;br /&gt;
For this purpose, there are the commands ''[script]'', ''[varnamelist]'', ''[stringvarnamelist]'' and ''[constfile]''. The first entry of each command is the number of files followed by the corresponding filenames (including the path relative to the configuration file). The names of the files are not relevant as long as they are correctly entered in the lists.&lt;br /&gt;
&lt;br /&gt;
The function of the respective files will be discussed in the course of describing the scripting language.&lt;br /&gt;
&lt;br /&gt;
== Basics of the Scripting Language ==&lt;br /&gt;
&lt;br /&gt;
The OMSI scripting system works with the [http://en.wikipedia.org/wiki/Reverse_Polish_notation Reverse Polish notation]. That is, the operator stands behind the two operands; put simply it means, that the operation &amp;quot; 1 + 2 &amp;quot; is instead listed &amp;quot; 1 2 + &amp;quot;. A more complicated example: &amp;quot; (1 + 2) * (4 + 5) &amp;quot; matches &amp;quot; 1 2 + 4 5 + * &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that OMSI textfiles and especially the scripting language is [http://en.wikipedia.org/wiki/Case_sensitivity case sensitive]! So always pay attention to uppercase and lowercase.&lt;br /&gt;
&lt;br /&gt;
=== Stack and Register ===&lt;br /&gt;
&lt;br /&gt;
When processing the scripts OMSI uses a [http://en.wikipedia.org/wiki/Stack_(abstract_data_type) stack] for [http://en.wikipedia.org/wiki/Floating_point floating-point numbers]. Below &amp;quot;stack&amp;quot; always refers to the stack for floating-point numbers. Otherwise it is spoken of the &amp;quot;string stack&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Both stacks contain 8 memory slots, which are numbered from 0 to 7. Every script operation can insert (push) one or multiple new values into one of the stacks, where the new value is set on position 0 and all of the following values &amp;quot;move up a place&amp;quot;, or it can pull one or multiple values out of the stack (pop) or just read them (peek).&lt;br /&gt;
&lt;br /&gt;
For the temporary drop of numbers there are additional eight memory slots, which can be written or read directly, in the so called &amp;quot;register&amp;quot; - however, there is only a register for the floating-point numbers.&lt;br /&gt;
&lt;br /&gt;
=== Example Operations ===&lt;br /&gt;
&lt;br /&gt;
Example: The operationn &amp;quot; 1 + 4 &amp;quot;. The code for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 4 +&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The table below demonstrates how the stack behaves on this occasion:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
operation:	stack:	0	1	2	3	4 ...&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
before:			0	0	0	0	0&lt;br /&gt;
&amp;quot;1&amp;quot;			1	0	0	0	0&lt;br /&gt;
&amp;quot;4&amp;quot;			4	1	0	0	0&lt;br /&gt;
&amp;quot;+&amp;quot;			5	0	0	0	0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the initial state the stack is filled only with zeros (or unknown/random values). The command &amp;quot;1&amp;quot; pushes the One into the top stack space and pushes all the other values (zeros) back. The command &amp;quot;4&amp;quot; pushes the Four on the 0. place and all the other values, so in particular the One on the respective next place. In the next step &amp;quot;+&amp;quot; the top two values are pulled out of the stack - that is 4 and 1 - and summed up. The result (5) is in turn pushed into the stack. The two original numbers are no longer present in the stack.&lt;br /&gt;
&lt;br /&gt;
A second example:&lt;br /&gt;
&lt;br /&gt;
(1 + 2) * (4 + 5) must, as already mentioned, be listed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 2 + 4 5 + *&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the stack behaves like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
operation:	stack:	0	1	2	3	4 ...&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
before:			0	0	0	0	0&lt;br /&gt;
&amp;quot;1&amp;quot;			1	0	0	0	0&lt;br /&gt;
&amp;quot;2&amp;quot;			2	1	0	0	0&lt;br /&gt;
&amp;quot;+&amp;quot;			3	0	0	0	0&lt;br /&gt;
&amp;quot;4&amp;quot;			4	3	0	0	0&lt;br /&gt;
&amp;quot;5&amp;quot;			5	4	3	0	0&lt;br /&gt;
&amp;quot;+&amp;quot;			9	3	0	0	0&lt;br /&gt;
&amp;quot;*&amp;quot;			27	0	0	0	0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So in the end the correct result is on stack space 0!&lt;br /&gt;
&lt;br /&gt;
=== Floating-point Numbers and Strings ===&lt;br /&gt;
&lt;br /&gt;
The OMSI scripting system works exclusively with the datatypes float (simple precision with sign) and string. Both datatypes have seperated stacks. Therefore the processings of floats ad strings generally run independently side by side. However it can happen that certain functions (e.g. converting numbers to strings) access both parts at the same time.&lt;br /&gt;
&lt;br /&gt;
Boolean variables have been omitted. In general the numerical values ​​0 and 1 are used for boolean values.&lt;br /&gt;
&lt;br /&gt;
== Script Keywords ==&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments can only be done by setting an apostrophe ['] at the front of the row to be commentated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'I am a comment line&lt;br /&gt;
   'I am NOT a comment line!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entry Points and Exit Points, Macros and Trigger ===&lt;br /&gt;
&lt;br /&gt;
All commands must be between an entry point and an exit point.&lt;br /&gt;
&lt;br /&gt;
The entry point is characterized by one of the keywords listed below:&lt;br /&gt;
&lt;br /&gt;
* {frame} During each frame OMSI calls through this entry point the framewise script processing, if it is available.&lt;br /&gt;
* {init} Bei der Initialisierung ruft OMSI über diesen Einstiegspunkt die Script-Initialisierung auf.&lt;br /&gt;
* {init} When initializing, OMSI calls through this entry point the script initialization&lt;br /&gt;
* {frame_ai} This is a variant of the {frame}-entry point, which is called with vehicles, when they are not in the focus of the user, e.g. when it is travelling as AI vehicle. If this entry point does not exist, but only {frame}, then the latter is called alternatively. With sceneryobjects this entry point is not considered.&lt;br /&gt;
* {macro:''name''} This entry point calls a subsection (macro), which must always be defined '''after the call''' &lt;br /&gt;
* {trigger:''name''} This entry point is called from the main program, when the user calls the key combination or the mouse event with the designation ''name'' - there are also certain trigger, which are called directly by the main program, e.g. when OMSI changes the display on AI busses&lt;br /&gt;
&lt;br /&gt;
{end} is the universial exit point. It must always close the block, which is opend by one of the commands above.&lt;br /&gt;
&lt;br /&gt;
==== Macro Call ====&lt;br /&gt;
&lt;br /&gt;
A macro is called by (M.L.''name''). The macro must ''always'' be called before its definition. Otherwise OMSI will report that the macro could not be found.&lt;br /&gt;
&lt;br /&gt;
==== Distributing the Script into Several Files ====&lt;br /&gt;
&lt;br /&gt;
With simple scripts (e.g. for pure AI vehicles or sceneryobjects) it is generally sufficient to create a *.sco-file, which comes with a {frame}...{end}-block and possibly a {init}...{end}-block.&lt;br /&gt;
&lt;br /&gt;
If it is, however, a complete vehicle script, then it is advisable to create separate files for the various subsystems. This case should be approached as follows:&lt;br /&gt;
&lt;br /&gt;
* There is a main script and the necessary subsystem files. The main file contains the {frame}-blocks and {init}-blocks, which, however, only call macros defined in the subsystem files.&lt;br /&gt;
* There is a *.sco-file for each subsystem and as required an own varlist and consfile with the variables belonging to the system. Furthermore the triggers for the key commands are sorted here.&lt;br /&gt;
* It is sensible to name the macros {macro:''subsystem''_frame} and {macro:''subsystem''_init}.&lt;br /&gt;
* To ensure that a makro can be called by the main script, it must be called first in the list of the scripts in the object configuration file. The order of the scripts must also be chosen so that all cross-file macro calls are always before each macro definition.&lt;br /&gt;
&lt;br /&gt;
The restriction that macros must always be defined after the call can indeed sometimes be a hindrance, but is a very effective protection against circular reasoning and infinite loops.&lt;br /&gt;
&lt;br /&gt;
==== Trigger ====&lt;br /&gt;
&lt;br /&gt;
As has been written, a {trigger:'' name''} ... {end}-section can be called by different ways from the main program. These include:&lt;br /&gt;
&lt;br /&gt;
* Triggered via keyboard: Has the key combination been called ''keycombi'', is {trigger:keycombi} called, if the key is pressed and {trigger:keycombi_off} if the key is released.&lt;br /&gt;
* Triggered via mouse: Has a mesh with the [mouseevent]-designation ''mouse_ev'' been clicked on, {trigger:mouse_ev} is called if the mouse button is pressed, {trigger:mouse_ev_drag}, while the mouse button is held and {trigger:mouse_ev_off} id  the mouse button is released.&lt;br /&gt;
* There is also a number of system triggers.&lt;br /&gt;
&lt;br /&gt;
=== Operations ===&lt;br /&gt;
&lt;br /&gt;
==== Stack Operations ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:95%;&amp;quot;  &lt;br /&gt;
|- class=&amp;quot;hintergrundfarbe5&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |%stackdump%&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Gives out a dialog box with the floating-point stack content. Should therefore naturally be used only for debugging purposes.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |s0, s1, ..., s7&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Saving the current stack value in the register indicated by the number. The value remains in the stack.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |l0, l1, ..., l7&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Loading the corresponding register value and shifting it into the stack. The register value is retained.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |d&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Dublicating the top stack value. All the other stack values are pushed back.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$msg&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Writing the top string stack value into the debug line of OMSI. Wether it is a AI vehicle, a user vehicle or a sceneryobject.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$d&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Dublicates the string stack value similar to &amp;quot;d&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Logical Operations ====&lt;br /&gt;
&lt;br /&gt;
The logical operations operate on the principle 0 = FALSE, everything else is TRUE.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:95%;&amp;quot;  &lt;br /&gt;
|- class=&amp;quot;hintergrundfarbe5&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;amp;&amp;amp;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |AND, that is, if one of the top two stack values ​​is 0, the result is 0, otherwise it is 1&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |OR&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;lt;nowiki&amp;gt;!&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Negation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Rational Operations ====&lt;br /&gt;
&lt;br /&gt;
Rational operators compare the values in the two top stack spaces and insert, depending on the result, 1 or 0 into the top stack space. The &amp;quot;greater than&amp;quot;/&amp;quot;less than&amp;quot; symbols are here according to the order, in which the values were specified before. That is:&lt;br /&gt;
&lt;br /&gt;
4 2 &amp;gt; is true for the internal operation performed is in this case &amp;quot;4 &amp;gt; 2&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:95%;&amp;quot;  &lt;br /&gt;
|- class=&amp;quot;hintergrundfarbe5&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |=&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;quot;1&amp;quot;, if the top stack values ​​are identical, else &amp;quot;0&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;lt;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;quot;1&amp;quot;, if stack value 1 is less than stack value 0, else &amp;quot;0&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;gt;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |... is greater than ...&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;lt;=&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |... is smaller than or equal to ...&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;gt;=&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |... is greater than or equal to ...&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$=&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |The same as &amp;quot;=&amp;quot; only for the string stack&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$&amp;lt;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Less than (string). The inequality operations on strings check on alphabetical order. So &amp;quot;A&amp;quot; is less than &amp;quot;B&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$&amp;gt;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Greater than (string).&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$&amp;lt;=&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Smaller than or equal to (string).&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$&amp;gt;=&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Greater than or equal to (string).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Mathematical Operations ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:95%;&amp;quot;  &lt;br /&gt;
|- class=&amp;quot;hintergrundfarbe5&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |+&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Plus&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Minus (stack space 1 - stack space 0, so in principle, as in the greater/less than operations)&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |*&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Multiplication&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |/&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Division (stack space 1 / stack space 0)&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |%&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Remainder of the division (extended as follows for floating-point numbers: stack0 - trunc(stack1 / stack0) * stack1 )&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |/-/&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Sign change&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |sin&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Sine&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |arcsin&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Inverse function of sine ''(OMSI2 only)''&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |arctan&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Inverse function of tangent ''(OMSI2 only)''&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |min&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Choosing the lesser of the two top stack values&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |max&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Choosing the greater of the two top stack values&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |exp&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Exponential function to the base e (e^Stack0)&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |sqrt&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Square root&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |sqr&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Square&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |sgn&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Return of the sign; either -1, 0 or 1&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |pi&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Circle constant pi&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |random&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |random integer 0 &amp;lt;= x &amp;lt; stack0&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |abs&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Return the absolute value&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |trunc&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Rounding down to nearest integer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== String Operations ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:95%;&amp;quot;  &lt;br /&gt;
|- class=&amp;quot;hintergrundfarbe5&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |&amp;quot;''bla''&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Insert the string ''bla'' into the top string stack space&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$+&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Join two strings. &amp;quot;Omnibus&amp;quot; &amp;quot;simulator&amp;quot; $+ results in &amp;quot;Omnibussimulator&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$*&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |The top stack string is repeated until the resulting character length is just less than or equal to the top stack value is. Example: &amp;quot;nu&amp;quot; 6 $* results in &amp;quot;nununu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$length&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Returns the number of characters in the top stack string back into the stack. &lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$cutBegin&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Cuts ''stack0'' characters from the front of the top stack string.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$cutEnd&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Cuts ''stack0'' characters from the back of the top stack string.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$SetLengthR&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Adjusts the length of the top stack string to ''stack0'' aligned to the right by removing leading characters or by adding spaces.&lt;br /&gt;
Attention: The command does not remove the float operator from the stack. I.e. the value, to which the lenght of the string is truncated, remains on stack0.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$SetLengthC&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Adjusts the length of the top stack string to ''stack0'' centred by removing leading and trailing characters or by adding spaces ''(OMSI2 only)''.&lt;br /&gt;
Attention: The command does not remove the float operator from the stack. I.e. the value, to which the lenght of the string is truncated, remains on stack0.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$SetLengthL&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Adjusts the length of the top stack string to ''stack0'' aligned to the left by removing trailing characters or by adding spaces.&lt;br /&gt;
Attention: The command does not remove the float operator from the stack. I.e. the value, to which the lenght of the string is truncated, remains on stack0.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$IntToStr&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Rounds down ''stack0'' and converts the resulting integer to a string.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$IntToStrEnh&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |The enhanced version of IntToStr. Here, the top stack string is used to determine the format of the string conversion: The first character of the string is used to fill the missing characters. The following characters must result in a number, which indicates the digits. Example:  35 &amp;quot; 5&amp;quot; $IntToStrEnh results in &amp;quot;   35&amp;quot;  and 123456789 &amp;quot;011&amp;quot; $ IntToStrEnh results in &amp;quot;00123456789&amp;quot;. If an error occures, &amp;quot;ERROR&amp;quot; is output.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$StrToFloat&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Converts the top stack string to a floating-point number if possible. Otherwise, a -1 is written.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |$RemoveSpaces&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Removes all spaces before and after the actual string. &amp;quot;   Spandau Freudstr    &amp;quot; becomes &amp;quot;Spandau Freudstr&amp;quot; ''(OMSI2 only)''.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Accessing Variables===&lt;br /&gt;
&lt;br /&gt;
A distinction is made between system variables and local variables. The system variables apply OMSI-wide, the local variables are stored belonging to the vehicle/object. &lt;br /&gt;
&lt;br /&gt;
For local variables, there are always a number of variables which are predefined by OMSI. In addition, any number of variables can be added using the varlist files. Furthermore there is the variant in OMSI 2 that, although one must define the variable by themselves, it will still be connected to an OMSI internal state (&amp;quot;on-demand pre-defined variables&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;font-size:95%;&amp;quot;  &lt;br /&gt;
|- class=&amp;quot;hintergrundfarbe5&amp;quot;&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |(L.S.''varname'')&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Loads the system variable ''varname'' in the top stack space&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |(L.L.''varname'')&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Loads the local variable ''varname'' in the top stack space&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |(L.$.''varname'')&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Loads the local string variable ''varname'' in the top string stack space&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |(S.L.''varname'')&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Saves the top stack space into the local variable ''varname''&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |(S.$.''varname'')&lt;br /&gt;
| align=&amp;quot;left&amp;quot; |Saves the top string stack space into the local string variable ''varname''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Constants und Functions ===&lt;br /&gt;
&lt;br /&gt;
Local constants and [http://de.wikipedia.org/w/index.php?title=Datei:Linear_interpolation.svg&amp;amp;filetimestamp=20080226155013 piecewise defined linear functions] can be defined in the constants files (''constfiles'', ''~_constfile.txt''). The structure of each constants file is the same as the structure of the [[Configuration File|configuration files]]. There are only three keywords. Note that so far no strings but only floats can be defined as constants.&lt;br /&gt;
&lt;br /&gt;
[const] defines a new constant and specifies its value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[const]&lt;br /&gt;
name&lt;br /&gt;
value&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[const]&lt;br /&gt;
power&lt;br /&gt;
200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[newcurve] initiates the definition of a new (piecewise linear) function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[newcurve]&lt;br /&gt;
name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[pnt] adds a new x-y pair to the previously with newcurve defined function. Each function should normally have at least two pairs. The order of the pairs ''must'' be ascending in the x-direction!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[pnt]&lt;br /&gt;
x&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[newcurve]&lt;br /&gt;
speed_torque_curve&lt;br /&gt;
&lt;br /&gt;
[pnt]&lt;br /&gt;
50&lt;br /&gt;
0&lt;br /&gt;
&lt;br /&gt;
[pnt]&lt;br /&gt;
300&lt;br /&gt;
400&lt;br /&gt;
&lt;br /&gt;
[pnt]&lt;br /&gt;
1000&lt;br /&gt;
600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Constants are loaded into the stack on the command (C.L.''constant name'')&lt;br /&gt;
&lt;br /&gt;
Functions are called on the command (F.L.''functionname''). At that the value previously stored on the top stack position is always passed as the x-parameter and the resulting y-value of the function is instead stored on the top stack space. Is the x-value outside the limits of the vertecies defined by the [pnt]-entries, the y-value of the nearest vertex is always used. Thus the function is extended horizontally to infinity before the first and after the last vertex.&lt;br /&gt;
&lt;br /&gt;
=== Sound Trigger ===&lt;br /&gt;
&lt;br /&gt;
Do not mix up the sound triggers with the above mentioned triggers!&lt;br /&gt;
&lt;br /&gt;
They rather represent a way to directly play a desired sound. There are two options for doing this:&lt;br /&gt;
&lt;br /&gt;
(T.L.''soundtriggername'') is a simple sound trigger. The so marked sound is played (once).&lt;br /&gt;
&lt;br /&gt;
(T.F.''soundtriggername'') is a sound trigger with file change function. The top stack string is read and used as the file name, where the file path is interpreted as relative to the sound folder of the object.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
Assuming the sound file is &amp;quot;this.wav&amp;quot; and is linked to the trigger ''My trigger'', then&lt;br /&gt;
&lt;br /&gt;
 (T.L.MyTrigger)&lt;br /&gt;
&lt;br /&gt;
plays the file &amp;quot;this.wav&amp;quot; and&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;other.wav&amp;quot; (T.F.MyTrigger)&lt;br /&gt;
&lt;br /&gt;
plays the file &amp;quot;other.wav&amp;quot;. As an alternative to (T.L.''soundtriggername'') can at the command (T.F.''soundtriggername'') also be a &amp;quot;null string&amp;quot; in the stack (i.e. &amp;quot;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== System Macros ===&lt;br /&gt;
&lt;br /&gt;
The current methods allow the scripts following communication options with OMSI:&lt;br /&gt;
&lt;br /&gt;
* Reading values ​​of the system variables and pre-defined local variables&lt;br /&gt;
* Writing values ​​on them&lt;br /&gt;
* Receiving keyboard, mouse, or system triggers&lt;br /&gt;
&lt;br /&gt;
Finally, there is another way to communicate with the main program, the so-called system macros, sometimes imprecisely referred to as &amp;quot;callback functions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In certain situations it is necessary that the script gets values ​​from OMSI, which are present in larger databases and therefore can not be transmitted via predefined variables, e.g. the contents of the hof-file. This is where the system macros come in.&lt;br /&gt;
&lt;br /&gt;
They work script-sided very much like the local, self-defined macros: The call (M.V.''macroname'')  calls the system macro (&amp;quot;V&amp;quot; originally stood for &amp;quot;Vehicle-Macro&amp;quot;, but applies equally well on scenery objects) which gets values from both stacks and/or writes into them during the execution.&lt;br /&gt;
&lt;br /&gt;
=== Conditionals and Loops ===&lt;br /&gt;
&lt;br /&gt;
The control of the program flow is so far only possible with the IF-condition.&lt;br /&gt;
&lt;br /&gt;
==== IF-Condition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'Here must be a condition, e.g:&lt;br /&gt;
    (L.L.bla) 1 =&lt;br /&gt;
    {if}&lt;br /&gt;
'This section is executed if bla = 1:&lt;br /&gt;
        2 3 +&lt;br /&gt;
    {else}&lt;br /&gt;
'Otherwise this section is executed:&lt;br /&gt;
        3 4 +&lt;br /&gt;
    {endif}&lt;br /&gt;
    (S.L.blub)&lt;br /&gt;
{end}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fact that first the condition is formulated and then the keyword {if} follows, should be clear: First of all the value must be dropped on top of the stack and anly then the keyword {if}, which checks this value, follows. Here, similar to &amp;amp;&amp;amp; and ||, equality with zero is equivalent to ''False'', all other values mean ''True''.&lt;br /&gt;
&lt;br /&gt;
So if in the example above ''bla'' has the value 1, then ''blub'' is set to the value 5, else it is set to 7.&lt;br /&gt;
&lt;br /&gt;
Nesting of IF-conditions is used as a substitute for the (nonexistent) &amp;quot;Else if&amp;quot;-constructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'Here must be a condition, e.g:&lt;br /&gt;
    (L.L.bla) 1 =&lt;br /&gt;
    {if}&lt;br /&gt;
'This section is executed if bla = 1:&lt;br /&gt;
        2 3 +&lt;br /&gt;
    {else}&lt;br /&gt;
    (L.L.bla) 5 =&lt;br /&gt;
    {if}&lt;br /&gt;
'This section is executed if bla = 5:&lt;br /&gt;
        3 4 +&lt;br /&gt;
    {else}&lt;br /&gt;
'Otherwise this section is executed:&lt;br /&gt;
        13&lt;br /&gt;
    {endif}&lt;br /&gt;
    {endif}&lt;br /&gt;
    (S.L.blub)&lt;br /&gt;
{end}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay particular to the double {end if}! Here the following applies:&lt;br /&gt;
&lt;br /&gt;
* bla = 1 ==&amp;gt; blub = 5&lt;br /&gt;
* bla = 5 ==&amp;gt; blub = 7&lt;br /&gt;
* else   ==&amp;gt; blub = 13&lt;br /&gt;
&lt;br /&gt;
[[Category:Developing Reference]]&lt;br /&gt;
[[de:Scriptsystem]]&lt;/div&gt;</summary>
		<author><name>Faaabiii</name></author>
		
	</entry>
</feed>