Herman Posted November 3, 2020 Posted November 3, 2020 I started with 3D train Studio in march 2020, and bought V6. Can anybody give some help please. It is quite specific. Relation between the track contact caused by a signal on that track, and the signal itself. In an event "track contact is triggered" how can i find the object name of that corresponding signal ? If so we can use the variables of that signal. A vehicle ( = wagons + locomotive ) hits the track contact of a signal. The wagons are in front of the Locomotive. How can I find the name of the object of the hitting Locomotive ? I tried ( even in version 5 ) local vehicles = layout:getVehiclesOn(signal) , but in this case it is not working, beause the locomotive is not on that Signal's trackcontact. Thanks if someone can give an answer. Kind Regards Herman
Herman Posted November 3, 2020 Author Posted November 3, 2020 Sorry, clarification Of course we know the name of the locomotive if hitting the track contact. I use it myself since V5 - see also HP V6 Signals V02 submitted in the catalof. But both questions are related. How can I restart the vehicle in the event "Signal is changed" when i then cannot find wat Locomotive is before the signal. Kind regards, Herman
HaNNoveraNer Posted November 3, 2020 Posted November 3, 2020 Hi Herman You could use a condition to find out which locomotive is on the track before the signal, or you could store the name of the locomotive in a variable of the signal when entering the track contact. Regards Thomas
Herman Posted November 4, 2020 Author Posted November 4, 2020 @HaNNoveraNer Hello, Always thanks for a reply, Ok i did use your suggestions before. I saved ( even in 5 ) the name of the vehicle in a variable from the signal. ( * attachment ) But Conditions to find the loc's name before the signal with something like local vehicles = layout:getVehiclesOn(signal) for _, vehicle in pairs(vehicles) do ... and so on. do not work with vehicles where there are wagons in front of the vehicle. Because the loc itself is not before the signal ? Another solution : put the signal in the beginning of a track, a vehicle that triggers this track will cause the vehicle to stop. Even with wagons in front, that works. The track before that track is stretched as long as the whole train ( wagons + vehicle ) fits on that stretched track. Kind regards, Herman HP V6 Signals V01b.mbp
HaNNoveraNer Posted November 4, 2020 Posted November 4, 2020 (edited) Hi Herman Is this what you want? V6 train starts by signal.mbp Edited November 4, 2020 by HaNNoveraNer
Herman Posted November 4, 2020 Author Posted November 4, 2020 @HaNNoveraNer Thanks, that's kind. It works fine because - as i did in my attachment saved the loc's name in the signal. Of course, i know that solution. Kind regards, Herman
Neo Posted November 4, 2020 Posted November 4, 2020 Hi Herman, please find attached the solution for restarting a train with a pushing loc: Restart at signal.mbp Kind regards, Neo
Herman Posted November 4, 2020 Author Posted November 4, 2020 Hello, A fine solution. We can close the topic. Kind regards, Herman
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello, I want to reopen a part of the topic, because my first question remains unsolved. A track contact from a Signal is triggered. Is there ( or not ) a possibility to find in that event the "object Signal itself" associated with that track contact ? If so, we can adress variables of the object signal. A solution is to place a triangular track contact near the signal with variable, type object, "MySignal", so please do not give that as an answer. Back to the question possible - please how ? Or not possible. Many thanks for a reply Greetings, Herman
HaNNoveraNer Posted November 5, 2020 Posted November 5, 2020 The object is named "contact" not "signal" You can access the signal variables via the trigger "contact" in the expanded variables section. Hope I did understand your question now? Regards Thomas
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello, Thomas, Thanks for the reply. More specific : The expanded variable version is known very well, and also contact in the script is known by me, and certain the use of contact.state. But I'm looking for something like contact.signalsobjectname ( or simular ) to use it and adress the signals variable. Something like contact.variables["#TRR OpenSignal"] == $("") but in this example the contact. is a triangular track contact, and it has variables. Hoping the question is clear enough. KInd regards Herman
HaNNoveraNer Posted November 5, 2020 Posted November 5, 2020 (edited) Blocksignal1 is a SIGNAL You dont need "contact.signalsobjectname" or similar. You can choose "contact" for the signal. Edited November 5, 2020 by HaNNoveraNer
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello, I appreciate your answer. I do not want to discuss, but I do not agree. Gleiskontakt Blocksignal 1 werd beim betreten ausgelöst The event says : the track contact from the corresponding signal is triggered. And that's a track contact not a signal. If you do not agree : you can easily give variables to a Signal. Try to do that with a track contact associated with that signal. Impossible not ?Really no offence, but when reading some forum topics, there is a confusion what is the signal, and what is that's signals track contact. The two are not the same at all.
Roter Brummer Posted November 5, 2020 Posted November 5, 2020 Hello, the track contact is integrated in the model So it can be addressed like any other track contact. You can also assign variables to a track contact. HG Brummi
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello Thomas, Very pleased with your reaction. Very useful , we are coming to the point. v.targetspeedabs = contact.variables["StreckenGeschwindigkeid"] I have the English version of 3D Studio, and mean that StreckenGeschwindigkeid indeed is set by the signal. But is it a own made variable set in the signal, that's where I'm looking for. But many thanks, Kind regards, Herman
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello Brummi, We are nearby a solution, Please give an example how I can make my own variable and put it on the track contact. I can do so on the signal. If I put it on the SIGNAL, which is possible, should contact.variables["Herman"] work ? I will try out to test it. Because that's i'm looking for. Greetings, Herman
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello Brummi and Thomas, Very nice, You can make variables in the Signal and adress them with ex : v.targetSpeed = contact.variables["herman"] That's even a very interesting solution. Many thanks, Kind regards, Herman
HaNNoveraNer Posted November 5, 2020 Posted November 5, 2020 >>> If I put it on the SIGNAL, which is possible, should contact.variables["Herman"] work ? <<< Phew, you got it!
Herman Posted November 5, 2020 Author Posted November 5, 2020 Hello Thomas, Here in my language they say "zijn frank valt traag", "slow to understand" haha. But I appreciate a lot you and Brummi cleared is out, something that's really simple to understand. Kind regards, Herman
Herman Posted November 6, 2020 Author Posted November 6, 2020 Hello, For me this topic is closed. I thank the members here for their help. , Greetings Herman
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now