Spontanfahrt mit zufälligem Halt/en: Unterschied zwischen den Versionen

Aus RailRoad&Co.-Wiki
Zur Navigation springenZur Suche springen
Die Seite wurde neu angelegt: „'''Problem:''' The result was that the test locomotive always stopped one lap later, even though (according to the variable monitor) the value of the variable was 7000.“
Die Seite wurde neu angelegt: „=== Define variable in time ===“
Zeile 25: Zeile 25:
'''Problem:''' The result was that the test locomotive always stopped one lap later, even though (according to the variable monitor) the value of the variable was 7000.
'''Problem:''' The result was that the test locomotive always stopped one lap later, even though (according to the variable monitor) the value of the variable was 7000.


<div lang="de" dir="ltr" class="mw-content-ltr">
<span id="Variable_rechtzeitig_festlegen"></span>
=== Variable rechtzeitig festlegen ===
=== Define variable in time ===
</div>


<div lang="de" dir="ltr" class="mw-content-ltr">
<div lang="de" dir="ltr" class="mw-content-ltr">

Version vom 8. April 2026, 16:55 Uhr

Verwendung
thumbs


Spontaneous trip with a random stop

Train should not always stop

The idea is not that every train should stop, but rather that trains should stop at random.

Insert time variable

I created a global variable of type Number. Then the variable "Stay_Random" is assigned a starting value of 0.

There is a 50% probability that it will be increased to 7000 (7000 milliseconds = 7 seconds).

This variable is then entered as the length of stay.

Fig: Random stop - spontaneous trip

Problem: The result was that the test locomotive always stopped one lap later, even though (according to the variable monitor) the value of the variable was 7000.

Define variable in time

Silvio Richter beschreibt die Lösung im Forum:

Es ist egal, mit welchen Mitteln (Makro, Abschnittseinstellungen etc) der Variablenwert eingestellt wird.

Zu beachten ist, dass der Wert feststehen muss, bevor der Block mit dem variablen Aufenthalt reserviert wird. Bei einer Reservierungslanze von 2 ist also der Wert 3 Blöcke vor dem Aufenthalt einzustellen.

Oder anders: Es wird der Wert genutzt, der im Moment der Reservierung des Blockes aktuell ist.



-- Uslex 16:19, 8. Apr. 2026 (CEST)