Run single application instance, but on different screens for each vehicle

Hello guys, I need the following setup:

  1. Add two cars on map
  2. Add one property (without wheels) on building and attach there camera

And the worst thing, that I need display what the camera from building see on one display, and at the same time I need to drive cars on another display.

I tried to use multiclient setup, but in any case, the new window is not opened.
It works only inside one window, OR just not open another one, because process is already running.

Do you know how to implement my setup?

P.S. I suppose the only usage of the second PC will work.

Hi byzkrovnyi,
You may use the lua\ge\extensions\tech\multiscreen.lua example to set up multiple screens. This script allows different camera views on separate displays, perfect for your needs.

Hi @asaeed Could you please explain how to run this?

Hi @byzkrovnyi, load the console window by ~ key or ` key , then paste the following
extensions.load('tech/multiscreen') in GE - Lua mode, then add your configuration for the other monitor for example; tech_multiscreen.addVehicleView("FrontCam_Small", 0, 5, 1.5, 0, 0, 0, 640, 360, 0.5, 60, 1, 500, 0, 50, 50, 0)

Hi @asaeed . Thanks for quick reply.

The provided example creates the second screen view only for vehicle which is currently in focus and is changed/switched/applied to the another vehicle, if change the focus.

How to add this second screen view only for one vehicle and in a way, when I switch between vehicles, the second screen will not be changed and still display only view from vehicle to which this view is attached initially?

For better understanding, explain the general flow:

  1. I add three vehicles: 2 cars and 1 bollard
  2. Open second view display for added bollard which displays on another screen what this bollard see.
  3. Switch to the cars and run case scenario. Meaning, that I need to drive a car and at the same time second screen should show the picture from what bollard see.

Thanks in advance for your help and attention.

Hey I have fixed code in multiscreen.lua.

The main idea is preserving a veh variable in onPreRender method, once the addVehicleView method is invoked.

I did it using boolean flag.

Could you please tell me whether I am allowed to share extension modified code?

Hello, sure you are able to share the modified code, under the terms of the BeamNG Common Development and Distribution License: https://beamng.com/bCDDL-1.1.txt