Jump to content
Zum Start hinzufügen

Weitere Informationen

3D-Modellbahn Studio

Eine Vollbild-App auf Ihrem Startbildschirm mit Push-Benachrichtigungen und mehr.

So installieren Sie diese App auf iOS und iPadOS
  1. Tippen Sie auf das Teilen-Symbol in Safari
  2. Scrollen Sie durch das Menü und tippen Sie auf Zum Startbildschirm hinzufügen.
  3. Tippen Sie oben rechts auf Hinzufügen.
So installieren Sie diese App auf Android
  1. Tippen Sie auf das 3-Punkte-Menü (⋮) in der oberen rechten Ecke des Browsers.
  2. Tippen Sie auf Zum Startbildschirm hinzufügen oder App installieren.
  3. Bestätigen Sie durch Tippen auf Installieren.

Empfohlene Beiträge

Geschrieben

At program always must start iteration when you wish to access any vehicles on route (and the trigger is not the vehicle).

But most cases you need only first vehicle. Please modify current routines to get first vehicle at route.

Like this: getVehiclesOn("place",firstonly(boolean))

Or: getVehicleOn()

In module I suggest a markbox with label: "only first vehicle".

As commands and conditions.

modul.JPG.376ee5ae11d999caa212c7f1b4f22a83.JPG

With this developing become quite easier.

Thank you in advance!

Geschrieben

Switch to Lua, drop the iteration (you don't need it) and pick the first item from the list:

local t = layout:getVehicleGroup(vehicle)
t[1].couplers[1].enabled = false

disables the rear coupler of the first vehicle of a train

Geschrieben

And

t[#t].couplers[0].enabled = false

disables the front coupler of the last vehicle.

And this

local t=layout:getVehicleGroup(vehicle)
-- First Vehicle
t[1].couplers[0].enabled = t[1].couplers[0].connectedCoupler ~= nil
t[1].couplers[1].enabled = t[1].couplers[1].connectedCoupler ~= nil
if #t > 1 then
  -- Last vehicle
  t[#t].couplers[0].enabled = t[#t].couplers[0].connectedCoupler ~= nil
  t[#t].couplers[1].enabled = t[#t].couplers[1].connectedCoupler ~= nil
end

disables the couplers at the free ends of a vehicle group.

Bearbeitet von Phrontistes
typo

Geschrieben
  • Autor

Based on the advice of @Goetz  the partial solution:

Create a user-triggered event with parameter "Track":

$("Events").variables["Truck"] = layout:getVehiclesOn(Track)[1]

Then you find the first vehicle of given track on the module variable "Truck".

Or nil if track is empty.

You can use this event with any module or write it directly to LUA.

Geschrieben

Hi,

Am 9.5.2025 um 23:03 schrieb Leslie:

Based on the advice of Goetz  the partial solution:

Create a user-triggered event with parameter "Track":

$("Events").variables["Truck"] = layout:getVehiclesOn(Track)[1]

Then you find the first vehicle of given track on the module variable "Truck".

Or nil if track is empty.

You can use this event with any module or write it directly to LUA.

Note:
layout:getVehiclesOn() does not necessarily return the correct order of the vehicles within the train formation.
layout:getVehicleGroup() returns the correct order...

EASY

Geschrieben

It's good that you pointed that out. I completely overlooked that @Leslie always uses getVehiclesOn instead of getVehicleGroup.

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Push-Benachrichtigungen konfigurieren

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.