simonjackson1964 Geschrieben 15. September 2020 Teilen Geschrieben 15. September 2020 (bearbeitet) This might already have been suggested, and may even be in the pipeline - I don't read German I'm sorry to say, so I don't know what all the other headings are. My suggestion is that the track contact on the various signals be capable of being moved away from the signal itself. Either that or have the ability to connect a track contact to a signal. As it is at the moment, you either have the train reach a red signal and stop a little way past it (or stop unrealistically suddenly if you use "set current speed"), or you check each individual track contact with the exact same code but each one having it's own event. What I have in mind is something like: When any signal contact is triggered, if the signal [Trigger] is 0 Set vehicle[trigger] target speed to 0. And have the trai slow realistically to a halt just before the signal. Bearbeitet 15. September 2020 von simonjackson1964 Incomplete Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Dad3353 Geschrieben 15. September 2020 Teilen Geschrieben 15. September 2020 Good evening, Simon... I may be reading too much (or not enough..!) into this, and I'm a total beginner, myself, so may be wrong here. There are Track Contacts integrated into the Signals, but one may also place a separate Track Contact (symbolised by a yellow/green lozenge between the rails...), which can issue orders when triggered, depending on the Signal's state, such that the engine slows and stops well before the Signal itself. In the soon-to-be-released v6, this 'slow down' will be integrated into the Track Contact itself, and will not require lines of code. Meanwhile, using a combination of Track Contacts and Signal Contacts, one may avoid the scenario you've described of over-run. Correct me if I'm out of line in this, please; hope this helps. Douglas Ich lese vielleicht zu viel (oder nicht genug ..!) Darin und bin selbst ein absoluter Anfänger, also kann es hier falsch sein. In die Signale sind Gleiskontakte integriert, es kann jedoch auch ein separater Gleiskontakt (symbolisiert durch eine gelb / grüne Raute zwischen den Schienen ...) platziert werden, der je nach Signalstatus Befehle auslösen kann, wenn er ausgelöst wird Motor verlangsamt und stoppt lange vor dem Signal selbst. In der bald erscheinenden Version 6 wird diese "Verlangsamung" in den Track Contact selbst integriert und erfordert keine Codezeilen. In der Zwischenzeit kann durch die Verwendung einer Kombination aus Track-Kontakten und Signalkontakten das von Ihnen beschriebene Szenario eines Überlaufs vermieden werden. Korrigieren Sie mich bitte, wenn ich diesbezüglich nicht in der Reihe bin. hoffe das hilft. Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 16. September 2020 Teilen Geschrieben 16. September 2020 vor 8 Stunden schrieb simonjackson1964: As it is at the moment, you either have the train reach a red signal and stop a little way past it (or stop unrealistically suddenly if you use "set current speed"), or you check each individual track contact with the exact same code but each one having it's own event. Hello simonjackson, It is as Douglas suggested: With V6, contacts will obtain a new feature that allows them to decelerate any vehicle in such a manner, that a set speed is reached (rather than triggered) at the contact. And the function itself as well as the target speed is controllable via the event manager. It's as if the train driver can see the contact from afar. He'll slow down at the appropriate time, respecting the set brake force. It works a treat and makes traffic control a lot easier. Kind rergards Goetz Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 16. September 2020 Autor Teilen Geschrieben 16. September 2020 @Goetz That is what I was hoping for. I didn't think I could possibly be the first one to see the need. @Dad3353 Thanks. Yes I'm aware of the track contacts that can be used in conjunction with the signal to slow and/or stop the train, but the problem with the current system is that you have to specifically name each contact and signal (yes it's worth doing that anyway), but then you need a separate event for every contact because each one is dependent on the state of the signal behind it, but there's no link between the signal and the advance contact point. I suppose one could soft-code a link - create an object variable on the contact that held the state of the signal, and have an event that updated it when the signal changed. But again you'd need a different one for every signal. less work than having an event for every contact for every state of the signal, but it seems a bit superfluous if V6 is coming soon... When is V6 due out? Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 16. September 2020 Teilen Geschrieben 16. September 2020 (bearbeitet) vor 22 Minuten schrieb simonjackson1964: you need a separate event for every contact because each one is dependent on the state of the signal behind it, but there's no link between the signal and the advance contact point. The trick is to store the relevant signal in the contact. And to give all contacts, that you want to behave the same way, a common keyword. Now you can write one codeblock that looks up the address of the relevant signal in the contact's object variable. And set this event to be triggered by any contact with that keyword. In the following V5 video, I'm applying a similar concept to a slightly more complex situation. Rather than just storing a signal in a contact, I'm keeping a list of switch points and their corresponding settings in each of 7 locos, in order to send each engine to its respective destination. The core idea is similar enough to your request. Anything that is individual, is stored in a variable. That enables you to write one little proggy, applicable to all elements that trigger this event. I hope this helps? I have videos closer to what you're asking, but they are all with commentary in German. Greets Goetz P.S.: V6 is currently being tested and finalised. As it goes with these things, no one can quite predict, how long error hunting and bug fixing will take. (How long do you need to find your keys when you mislaid them?) But to my understanding, Neo's goal is to realease V6 in late Autumn ... Bearbeitet 16. September 2020 von Goetz Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Dad3353 Geschrieben 16. September 2020 Teilen Geschrieben 16. September 2020 2 hours ago, simonjackson1964 said: ... you need a separate event for every contact because each one is dependent on the state of the signal behind it, but there's no link between the signal and the advance contact point... Simon... Our friend Goetz was kind enough to spend some time explaining to me, in terms even I could understand, the basic use of this 'Keyword' notion, using at the start a pair of signals to illustrate. The whole 'lesson' took two hours, but I have generated a five-minute version with just the 'signal' part. It may help to watch this, and take note of exactly what he's doing; this answered many of my questions, along much the same lines as yours. Maybe worth a look..? I've uploaded it to Youtube so as not to overload the 3D-Train server with video; here's the link ... https://youtu.be/5kxWhNzzrpw Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 16. September 2020 Teilen Geschrieben 16. September 2020 vor 2 Minuten schrieb Dad3353: I have generated a five-minute version It's still processing, can't wait to see it. Very kind of you to do this for Simon Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Dad3353 Geschrieben 16. September 2020 Teilen Geschrieben 16. September 2020 Slight update: it's not five minutes, but nearly one hour..! S'worth it, though; Goetz is very thorough. It's finished processing, so can now be watched. Enjoy... Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 16. September 2020 Teilen Geschrieben 16. September 2020 You two inspired me to give the marriage of contact and signal some thought. I found a neat way to do this via Lua skript. Multiple ways, actually. I'll start a Twitch session to record my thoughts on this matter. Anyone's welcome, if you don't mind me mumbling to myself Cheers Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 17. September 2020 Autor Teilen Geschrieben 17. September 2020 Hey guys Thanks a million, those were really helpful. V6 looks really amazing and I can't wait to see it. (By the way, I spotted the missing full-stop before either of you! My wife must think I'm crazy, because I was all but yelling "There's a full-stop missing...!" at the computer screen!) Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Dad3353 Geschrieben 17. September 2020 Teilen Geschrieben 17. September 2020 Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 17. September 2020 Teilen Geschrieben 17. September 2020 vor 29 Minuten schrieb simonjackson1964: I was all but yelling "There's a full-stop missing...!" at the computer screen! That must have been painful for you. So sorry Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 19. September 2020 Autor Teilen Geschrieben 19. September 2020 So... With programming/coding there is no "Right" way of achieving something as long as it works... I have just done the same on V5, (because I have no patience and I want it now!) and it's actually a bit simpler... An object variable on the track contact, which is set further back from the signal to allow the train to slow (distance by trial and error!), holds the address of the signal it relates to. When the contact with the keyword STOP is triggered on entry, if contact.variables["Signal for"].state == 0 then vehicle.targetSpeed = 0 contact.variables["Signal for"].variables["Train at"] = vehicle end When a signal with keyword "signal" is changed if not (signal.state == 0) then if signal.variables["Train At"] ~= nil then signal.variables["Train At"].targetSpeed = 100 signal.variables["Train At"] = nil end end And that's it... Well, apart from "Closing the door". On the prototype, back in the old days of manned signal boxes on every station and at every junction, the signalman would wait until the train had passed completely before setting the signal on and blocking the track - he would do this latter by sending a coded bell message down the telegraph to the next signal box, saying "Train in block". (And I'm not being sexist, just historical, I don't think there were female signalpeople until very recently. Not in the UK anyway.) But these days,in the UK at least there is an actual track contact, something like this(?), just beyond the signal and when the locomotive passes over it, it sets the signal red. Which is why, when watching from the window of a passenger train in the UK, the signals always seem to be red when you go past them, unless you are right at the front of the train. If the track is straight enough (or curved just right) you can sometimes see the signal change as you get closer to it. Because of this I prefer to use the signal track contact event "On entering (Vehicle Centre)" which realistically changes the signal while the train is still passing it. (Of course to be totally true to prototype one could use one of these and have it set the signal "on entering"... But that's too much hard work! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 19. September 2020 Teilen Geschrieben 19. September 2020 great work, Simon Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 19. September 2020 Autor Teilen Geschrieben 19. September 2020 Thanks. Now I just have to put the rest of the signals in where I think I need them, along with their contacts, decide how I'm going to set the preceding signal to green (probably when signal contact is activated on leaving, and store the name of the preceding signal in each one). But most importantly I need to figure out how to automate this: Yep, that's a single track viaduct with a train waiting at both ends. (view from the cab of one and the other is that raised blip in the far distance...) I really wanted a viaduct, and couldn't find a two-track one I liked. And I figured it would make operating the layout entertaining to have a single track section. It's only since I got the "stop at red" working that I was able to put two trains on the track, and it is good fun sending them past each other manually, but I want to get on with other parts of the layout, so now I have to create an event for a train arriving at each end that checks if a train is already on the viaduct and if not, sets the route and clears the signals (There's an exit signal at both ends to prevent the train going onto the wrong track). I've already got events that set and clear a global boolean "Viaduct blocked". My one concern is the one in a million chance that two trains arrive at the same time. Because it's bound to happen! Murphey's law says so... And just delaying execution on one side doesn't help, because it just means that the other train has to arrive that little bit later to be at exactly the same time. I've not been able to think of a solution for that one since I first downloaded the free version 3 and then bought version 4. I suppose I could use two booleans, one for each direction, so I check the one for my direction. If it's true, I stop. If it's false, I set the one for the other direction true, wait a second then check the one for my direction again. If that's true I flash a big red light and pause the program.... Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 19. September 2020 Teilen Geschrieben 19. September 2020 (bearbeitet) vor 26 Minuten schrieb simonjackson1964: My one concern is the one in a million chance that two trains arrive at the same time. Because it's bound to happen! Even if it does, the Event Manager will always receive one train's call before the other. And it's only one event manager at work. So when the second train calls, regardless how soon after the first this may happen, this one Event Manager will always find the "engaged" flag raised because it set that flag when allowing the first train onto the viaduct. The secret is to combine "allow train in" with setting the "viaduct occupied" flag in one event and not wait for the train to actually step onto the viaduct. Bearbeitet 19. September 2020 von Goetz Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 20. September 2020 Autor Teilen Geschrieben 20. September 2020 Got that working, I used the track contact on advance (pre-) signals to check the block indicator and set things accordingly. I've also managed to get a train exiting the viaduct to start a train waiting to enter. Currently figuring out how to combine the two so a train that has already passed the advance signal but not stopped yet still gets started... I think I have a solution... Yep, that will work! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 23. September 2020 Autor Teilen Geschrieben 23. September 2020 Well that turned out to be trickier than I thought it would be... The hard part was making it so it would take trains alternately if they were waiting, but just pass the trains from one side if none were coming the other way... Still not perfect - If I take all the trains off going anticlockwise but leave them running clockwise, I have to manually change a couple of points and signals to start things moving for some reason I don't want to try and solve... Now looking at my junctions... Oh yes, this is going to be interesting when I get it going. I'm going to use a variant of storing the train's route in the locomotive - Which I would never have thought of so thanks @Goetz Bu one thing that was bugging me was how to get a pre-signal to change the signal it is repeating when a point between them is thrown? I tried using an event on the point to change the property "link", but I realised that's the "physical link" that makes two objects move together, not the "connection" which is what I was trying to change... Then I came up with the perfect solution. I'm not using the pre-signals for anything except decoration. I might at some future date add something that causes a train to go slower if it passes a signal at VR0, but I'm not yet and if I do I will allow for this. So, we have a pre-signal, a facing junction and two main signals, and we want the pre-signal to show the aspect that mirrors the main signal that the junction is currently set to. How do we do this? We can't change the signal's connection property, and we can't connect both main signals back to the pre-signal because that would result in one of those signals changing the other. How do we do it? We use two pre-signals. Link one to one main signal and link the other to the other one. Then use the event on the points to toggle the visibility of both signals. Then we simply put them both in the same place (on the mast of the main signal before the junction). And the effect is exactly what I wanted! I just had to tell someone... And there might be someone reading this who realises that the visibility property is exactly what they need but hadn't thought of it! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 23. September 2020 Teilen Geschrieben 23. September 2020 vor 3 Minuten schrieb simonjackson1964: I just had to tell someone... I appreciate why you had to. That's a fine example of lateral thinking, Simon Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 23. September 2020 Autor Teilen Geschrieben 23. September 2020 Also... A quick flirt with Google Translate reveals that @Henry did something similar in his signalling tutorial for the ground signal of a 3-way point. I knew I'd seen that somewhere! And I now know how to do the 3-way point on my layout too! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Henry Geschrieben 25. September 2020 Teilen Geschrieben 25. September 2020 @simonjackson1964 ground signals: Weichensignale bei Dreiwegweichen (3WW) Regards, Henry Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 27. September 2020 Autor Teilen Geschrieben 27. September 2020 @Henry Yep that was it. It's not perfect, because the signal stays where it is but the base moves, or vice versa but it's close enough. So thanks Note the black contact box is different in the third picture. Can't be helped, it's just the way it is! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Goetz Geschrieben 27. September 2020 Teilen Geschrieben 27. September 2020 vor 6 Minuten schrieb simonjackson1964: it's just the way it is! it's fine! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 12. November 2020 Autor Teilen Geschrieben 12. November 2020 On 9/16/2020 at 7:26 PM, Goetz said: The trick is to store the relevant signal in the contact. And to give all contacts, that you want to behave the same way, a common keyword. Now you can write one codeblock that looks up the address of the relevant signal in the contact's object variable. And set this event to be triggered by any contact with that keyword. In the following V5 video, I'm applying a similar concept to a slightly more complex situation. Rather than just storing a signal in a contact, I'm keeping a list of switch points and their corresponding settings in each of 7 locos, in order to send each engine to its respective destination. The core idea is similar enough to your request. Anything that is individual, is stored in a variable. That enables you to write one little proggy, applicable to all elements that trigger this event. I hope this helps? I have videos closer to what you're asking, but they are all with commentary in German. Greets Goetz P.S.: V6 is currently being tested and finalised. As it goes with these things, no one can quite predict, how long error hunting and bug fixing will take. (How long do you need to find your keys when you mislaid them?) But to my understanding, Neo's goal is to realease V6 in late Autumn ... I am trying to do this... Slightly more complex but essentially the same - set the route from a table on the train. Except I can't remember what the event on the track contact looked like. And the video seems to have gone! Help? Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
simonjackson1964 Geschrieben 12. November 2020 Autor Teilen Geschrieben 12. November 2020 Actually, it's fine. It was a lot simpler than I was expecting for some reason! All sorted! Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Empfohlene Beiträge
Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren
Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können
Benutzerkonto erstellen
Neues Benutzerkonto für unsere Community erstellen.
Neues Benutzerkonto erstellenAnmelden
Du hast bereits ein Benutzerkonto? Melde dich hier an.
Jetzt anmelden