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

Aus RailRoad&Co.-Wiki
Zur Navigation springenZur Suche springen
Die Seite wurde neu angelegt: „This variable is then entered as the length of stay.“
Die Seite wurde neu angelegt: „*Source: [https://www.freiwald.com/forum/viewtopic.php?p=281039#p281039 Forum] *TC-wiki: Variable length of stay
 
(9 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 20: Zeile 20:
This variable is then entered as the length of stay.
This variable is then entered as the length of stay.


:[[Datei:Zufall-Halt-Spontanfahrt.png|<span lang="de" dir="ltr" class="mw-content-ltr">400px</span>]]
:[[Datei:Zufall-Halt-Spontanfahrt.png|400px]]
:<div lang="de" dir="ltr" class="mw-content-ltr">
:''Fig: Random stop - spontaneous trip''
''Abb: Zufalls-Halt-Spontanfahrt''
</div>


<div lang="de" dir="ltr" class="mw-content-ltr">
'''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:''' Das Ergebnis war, dass die Test-Lok immer erst eine Runde später angehalten hat, obwohl (laut Variablenmonitor) Wert der Variable 7000 war.
</div>


<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">
Silvio Richter describes the solution in the [https://www.freiwald.com/forum/viewtopic.php?p=281039#p281039 forum]:
Silvio Richter beschreibt die Lösung im [https://www.freiwald.com/forum/viewtopic.php?p=281039#p281039 Forum]:
</div>


<div lang="de" dir="ltr" class="mw-content-ltr">
It doesn't matter which means (macro, section settings, etc.) are used to set the variable value.
Es ist egal, mit welchen Mitteln (Makro, Abschnittseinstellungen etc) der Variablenwert eingestellt wird.
</div>


<div lang="de" dir="ltr" class="mw-content-ltr">
It is important to note that the value must be fixed '''before the block''' with the variable stay is '''reserved'''. Therefore, with a reservation lance of 2, the value must be set 3 blocks before the stay.
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.
</div>


<div lang="de" dir="ltr" class="mw-content-ltr">
'''Or in other words:''' The value used is the one that is current at the moment the block is reserved.
'''Oder anders:''' Es wird der Wert genutzt, der im Moment der Reservierung des Blockes aktuell ist.
</div>


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




<div lang="de" dir="ltr" class="mw-content-ltr">
*Source: [https://www.freiwald.com/forum/viewtopic.php?p=281039#p281039 Forum]
*Quelle: [https://www.freiwald.com/forum/viewtopic.php?p=281039#p281039 Forum]
*TC-wiki: [[Special:MyLanguage/Variable Aufenthaltsdauer|Variable length of stay]]
*TC-wiki: [[Special:MyLanguage/Variable Aufenthaltsdauer|Variable Aufenthaltsdauer]]
</div>




:-- [[Special:MyLanguage/Benutzer:Uslex|Uslex]] ([[Benutzer Diskussion:Uslex|Diskussion]]) 16:19, 8. Apr. 2026 (CEST)
:-- [[Special:MyLanguage/Benutzer:Uslex|Uslex]] 16:19, 8. Apr. 2026 (CEST)





Aktuelle Version vom 8. April 2026, 16:56 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 describes the solution in the forum:

It doesn't matter which means (macro, section settings, etc.) are used to set the variable value.

It is important to note that the value must be fixed before the block with the variable stay is reserved. Therefore, with a reservation lance of 2, the value must be set 3 blocks before the stay.

Or in other words: The value used is the one that is current at the moment the block is reserved.


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