Tram Patch - Patch for script macro GetHeightAbovePoint OMSI 2.3

Willkommen in der OMSI-WebDisk!
Als Gast kannst du nur Inhalte in deiner ausgewählten Sprache sehen. Registrierte Nutzer können die Sichtbarkeit anderer Sprachen in ihrem Kontrollzentrum aktivieren, weitere Infos hier.
Alle Themen sind in den Foren mit einer Sprachflagge gekennzeichnet: = Englisch [EN], = Deutsch [DE], = Französisch [FR]. Wenn du die angegebene Sprache nicht beherrschst, schreibe auf Englisch!
  • I managed to fix the macro almost a year ago, but I’ve only just remembered it.


    In short, since version 2.3, the GetHeightAbovePoint macro returns 0 if the vehicle in motion. The correct value is only returned when the vehicle is stationary.

    As a reminder, the macro determines the distance along the Z-axis downwards from the specified coordinates relative to the vehicle axis to the edge of the nearest scenery object/spline.


    The script macro is primarily used to determine the height of the pantograph to the overhead line, the lowest possible position of lift and ramps.

    In newer vehicles, addon's devs have worked around this by reading the value only when stopped, or ignoring zero value.


    The patch involves replacing two bytes in the game's exe.

    Positions 0x3D2C1E and 0x3D2C1F, relative to the beginning of the file should be 0x90.

    This corresponds to two nop instructions. Two identical instructions are needed to overwrite a two-byte jne instruction (0x75 0x0F) without changing the file size.


    For those interested, here are some code snippets from 2.3.004 and 2.2.032:


    Einmal editiert, zuletzt von A17PL ()

  • A17PL

    Hat den Titel des Themas von „Patch for script macro GetHeightAbovePoint (aka "Tram Patch") OMSI 2.3“ zu „Tram Patch - Patch for script macro GetHeightAbovePoint OMSI 2.3“ geändert.