barnamedve Posted January 19, 2023 Share Posted January 19, 2023 Hi all, Using V6. Could anyone let me know, how to create an event which triggers when something else happened 3 times. (For example, signal turns red when train completed 3 laps on the layout.) Link to comment Share on other sites More sharing options...
Herman Posted January 19, 2023 Share Posted January 19, 2023 (edited) Hello, I just made this in V6, please study this. You may always ask extra information how this is done.. Kind regards, Herman count problem in V6.mbp Attention : In V6 you have to program a signal to work. That is not explained here, we can help with that, but it is another thing. ( before a red signal trains do not stop in V6, exept when it is done by EV ) If possible take the step to V7 or V8 where signal handling is effective done by the 3MBStudio. Edited January 19, 2023 by Herman extra info signal V6 Link to comment Share on other sites More sharing options...
streit_ross Posted January 19, 2023 Share Posted January 19, 2023 (edited) Hello, With a small extension you can automatically stop the train after 3 turns and set the counter back to 0. Set the signal to green , start the trains again and the game starts from the beginning. Kind regards streit_ross Count problem in V6 (1).mbp Edited January 19, 2023 by streit_ross Link to comment Share on other sites More sharing options...
Goetz Posted January 19, 2023 Share Posted January 19, 2023 (edited) Herman and streit_ross both beat me to it Still, here's my example: counter variable example.mbp When the signal is set to "clear", I set an object variable with the name "counter" to a value of 3 This object variable is stored in the signal. But any variable - object or module - will do the trick. Upon leaving the contact, I reduce the value in that variable by 1 and every time the variable changes, I write it's value into a text field check if the value is 0 or less and change the state of the signal to "stop" if that's the case. The two second delay before the signal change is for beauty only and not required Kind regards Goetz Edited January 19, 2023 by Goetz spelling Link to comment Share on other sites More sharing options...
barnamedve Posted January 24, 2023 Author Share Posted January 24, 2023 Gentleman! Thank you very much for your detailed answers! Have a great day! Link to comment Share on other sites More sharing options...
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