Changing Consist Name?

Achte bitte darauf, dass Du mit deinem Thema bzw. mit deiner Frage im richtigen Bereich bist.
Die Bereiche sind: Einstellungen im Forum, EEP aktuell ab EEP7 , Splines, Rollmaterialien, Immobilien, Landschaftselemente, Signale und Schaltung, Anlagenvorstellungen, Schnappschüsse Konstrukteure, EEP Treffen , Laberecke, Online - Handbuch EEP Vielen Dank für die Unterstützung das Forum übersichtlich zu halten.
Bilder/Fotos aus dem Internet sind nur als Link gestattet. Eigene Fotos, also Fotos aus dem realen Leben, sind erstens mit Eigenes Bild als Quellenangabe zu kennzeichnen und zweitens nur als Dateianhang im Beitrag zulässig. Bilder ohne Quellenangaben und Bilder dessen Quelle das Internet wie z. B. Google ist, werden gelöscht.
  • I have a layout with a single track main line. In one end of the line, there is a small station with a parallel track. In the other end, there is just a loop (I prefer the German word: Schleife) that makes the trains return to the station. I have set up contacts and LUA code to make the trains detach the passenger waggons at the station, pass by them in the parallel track, and attach them again in the other end. After that they leave the station - now driving with the opposite heading of the one they arrived to the station with. So, when the train arrives to the station, it drives alternatively forwards and backwards.
    When detaching the waggons, I create a new consist, of course, and in automatic mode, the new consist gets a new name. When driving forwards, the engine gets the new name. When driving backwards, the waggons get the new name. When the engine attaches the waggons at the other end, it seems that the engine's consist name takes precedence. So a train arriving forwards, has a new name when it leaves, whereas a train arriving backwards, has the same consist name when leaving. The latter is nice, the first is annoying.

    Is there any way to change the consist name programmatically? An undocumented EEPSetRollingStockName() for example?

  • When the engine attaches the waggons at the other end, it seems that the engine's consist name takes precedence.

    The moving element determines the name.

    And when you uncouple, it matters if you count from the front or rear. Depending on your travel direction, choose the appropriate side to have the engine keep the train's name and not the waggons.

  • I haven't been able to make it work. Below is my code for the decoupling. Variable ShortName has been set before calling this function to the TrainName exclusive the ";001" or ";002" which is added when I detach. Function IsEntryHeadingForwards() examines the variable EntrySpeed which is set to the train's speed when approaching the station.

  • Please check what happens when you add a new train name as a fourth parameter to EEPTrainLooseCoupling() to give the remaining waggons consist a new name. This may be necessary for having the loco keep the current name. Then again, it is also possible that you can only keep the original name when you uncouple via a vehicle contact. I'll have to check that myself.

    For the future:

    Don't subtract 1 from EEPGetRollingstockItemsCount() as this is already done for you. Used on a single loco, the function returns a value of 0.

  • I already tried the fourth parameter. That didn't change much to the situation.

    So, the real problem is, how to make sure, that the engine keeps the consist name - OR - how to give the original consist name back to the train, when it leaves the station.

    The moving element determines the name, you say. Well, for attaching the waggons, that fits my experience. But wouldn't it be a good idea to use the same rule when detaching? Nah, maybe not always... (rangier esel etwas) I don't know what to call it in English :ac_1:

    Thanks for the hint on EEPGetRollingStockCount(). But what if I have a consist with two or more locos in it? :ad_1:

  • But wouldn't it be a good idea to use the same rule when detaching?

    Indeed!

    This feature can do with a little improving ...

    But what if I have a consist with two or more locos in it?

    The returned number is always the number of items minus one, regardless.

  • Hi Vogn22,

    in termes like these you have to keep in mind another thing exept you don't use steam engines with an tender or two coupled engines.
    In this case you have to use two contact points, one for single engines, the second for the locos I described before.
    The easiest way to make sure, the appropriate contact point responses is to use a prefix in front of the name of trains. So you can use the filter like this for example:

    1-<train_name> for the 'singles' --> uncoupling at position 1
    2-<train_name> for the 'twos' --> uncoupling at position 2

    Then you can send different trains randomly over night and you can go to bed. ;)

    Best regards
    Thomas

    PS: How can I shut off the fu..ing »intelligence« of this tool, which makes nearby every first letter uppercase?!

    - - - - -
    MidiTower (i7 9700KF 3,6×3,6GHz, 16GB RAM, 4GB GeForce RTX2070 super, WIN 10)
    DELL-Notebook (Intel Core i7 3520M Quad Core, 2,9GHz, 8GB RAM, NVIDIA Quadro K1500M, WIN 10 Home;
    EEP von 4 bis 17.1

    »Nach diesem Jahrhundert der großen Sprüche und schlimmen Illusionen hoffe ich auf eine Zeit, in der die großen Sprüche nichts mehr gelten, sondern nur noch das, was man wirklich und greifbar getan hat.«

    Gerhard Richter, 1999

  • Thanks for making me aware of the contact filter, Thomas.

    I have just tried it and it only stresses the need for better control of consist names.
    Having a Bavarian Steam engine with tender + 5 passenger waggons matching in style.

    Consist name #2-SteamWithTender

    Setting Vehicle contact with filter #2 and Release Couple FRONT and Rolling Stock no. 2 and NewTrain Name set to some name, that doesn't really matter here.

    Passing the contact with 10 km/h, the engine detaches the passenger waggons as expected, but the ENGINE part gets the new name.

    The passenger waggons keep rolling far enough to meet the same contact and as they have preserved the original consist name, they are now split in 2 + 3 waggons. :ac_1: That was not what I wanted, but you could say that I should have stopped the train before detaching. That had only been fair to the engineer doing the physical detaching :aa_1:

    Anyway, I could have used the contact filter in my layout instead of making some LUA code to extract the original consist name from the one EEP created by adding ";001" or ";002". I think I will try to do so tomorrow.

  • Passing the contact with 10 km/h, the engine detaches the passenger waggons ...

    Don't.

    Have two contacts. (Ideally in one group contact)

    One for stopping the train. And a second one (with delay time) for uncoupling. And when you come in forward, uncouple five waggons from the rear to make the train name stay with the loco.

  • Right. Well, three contacts with delay 0, 5, and 10 in order to stop, detach, and continue the journey.

    I still name the consist "#2-SteamWithTender" and as I have changed Release Couple to REAR, 5 as you said, my waggons get the new name, I entered in the contact dialog box. However, in this case EEP adds ";001" to the consist name of the engine. Most peculiar, though, is that if I keep THAT name and rerun the reassembled train over the decoupling contacts, the engine preserves the name "#2-SteamWithTender;001". It is NOT changed to 002 or anything else.

    I'll check it in my LUA code layout tomorrow. It may be helpful anyway.

  • Hi Vogn22,

    in every case: at first you should to ensure, before uncoupling the loco from train, the train had to be stopped!

    Put into the coupling contact point (CP) a few seconds for delay. This guarantees a safe and always calculatable situation.

    Do you use the option »Sanftes Ankuppeln« ('soft/gentle coupling' - i don't know how it is named in the translated version)? I guess, you don't.

    If you don't use it, it is possible, the train has to stop two times at the same signal and passes the coupling-CP two times too:
    1st - after arriving (now the CP has to do it's work) and
    2nd - after coupling the engine at the rear side pushing train a bit backward onto the signal (and this time the CP has to shut up! It only has to notice, that it is run over the second time!). This was my way to support different lengths of incoming trains before the soft coupling option was available and that will be the reason for dividing your train into two after coupling at the rear side!

    Before the next train is coming in, try to use the entries »Ist-Zustand« (=1) and »Jeder« (=2) to make the contact effects only every first, but not the second time!

    I ponder to put a screenshot, but I think, you'll understand this without because you're in front of the target.

    I can't imagine, why you have to care of the trains name at all. The only thing, that's change by the program is the number at the end of the line. I never cared about it!
    The important information I transport only by the 'Route' and in the prefix(es) of the train name. All over the time these things are leaving untouched and in EEP14, I hope it's too. Until now this is my way as a 24/7 automatic fan to handle things - without problems, without additional desires or other needs. May be, you want more or you want to go another way... May be, the virtual depots disturbing this by bringing in new requirements. This I can imagine, but I haven't use it yet.

    If possible, please get us here your hard- and software environment by typing in the parameters in your signature like we do. Help can coming more accurate and faster, if we know, what's your latest EEP-Version, which plug ins you've installed, things like these... .

    Good luck
    Thomas

    - - - - -
    MidiTower (i7 9700KF 3,6×3,6GHz, 16GB RAM, 4GB GeForce RTX2070 super, WIN 10)
    DELL-Notebook (Intel Core i7 3520M Quad Core, 2,9GHz, 8GB RAM, NVIDIA Quadro K1500M, WIN 10 Home;
    EEP von 4 bis 17.1

    »Nach diesem Jahrhundert der großen Sprüche und schlimmen Illusionen hoffe ich auf eine Zeit, in der die großen Sprüche nichts mehr gelten, sondern nur noch das, was man wirklich und greifbar getan hat.«

    Gerhard Richter, 1999

    Einmal editiert, zuletzt von thoflo (13. November 2017 um 00:47)

  • Hi Goetz and Thomas,
    Thanks for keeping me occupied for several hours, trying to figure out, what is the best way to do it.

    Allow me to resume:

    I am using EEP 13.2 without plug-ins, meaning that EEPGetRollingStockItemsCount() is not available.

    I have to use REAR decoupling in order to have the engine preserve the original name.

    In order to use the REAR decoupling, I need to know the number of passenger waggons. As I cannot ask EEP that question, I see no other way than having the number of waggons as constants in my code. Not nice, but necessary.

    In order to know what constant to use with the current train, I use the train's name excluding ";001" / ";002".

    So, yes, I need to know the name of the train.

    You both pointed out, that I need to stop the train before decoupling. Yes, of course! It was only the results of a late-night-quick-and-dirty-test, I referred to in a previous reply.

    @thomas: Thanks again, for dragging my attention to a smart feature of EEP. I have used EEP for less than a month, so I am still a TrainEE(P). The Gentle Coupling is really smart. I don't quite understand why it isn't DEFAULT when creating NEW layouts in EEP 13++.

    @thomas: I think you refer to the two fields "Counter" and "Every" of the Vehicle Contact dialog box. The third and fourth edit fields of that dialog. You are right, I could have solved a double-pass problem with that. What I did, was to set an invisible signal and test the state of that, further down in the dialog. When I interfere in the driving (in case of errors), I can easily set the signal, but I cannot set the counter, can I?

    I want as much as possible to be in the LUA code. I think it's easier to get an overview of all code from a large LUA file than from various bits and pieces scattered all over the layout.

    I am planning to change the invisible signal to a global variable instead. Especially with Gentle Coupling, I don't need that signal at all.

    @thomas: I was around my profile a little earlier today. I didn't see any field for hardware information. Where do I put the information?

    Einmal editiert, zuletzt von Vogn22 (13. November 2017 um 16:13) aus folgendem Grund: Removed a mistake

  • I was around my profile a little earlier today. I didn't see any field for hardware information. Where do I put the information?

    Hi :)

    there is a tutorial (in German) which may help you. You can find it here: Welche Einstellungen kann ich im Kontrollzentrum machen.

    Regards

    Ingo

  • As I cannot ask EEP that question, I see no other way than having the number of waggons as constants in my code.

    Correct.

    That's why the item count function was added recently.

    When I interfere in the driving (in case of errors), I can easily set the signal, but I cannot set the counter, can I?

    Quite right.

    Good thinking

    I didn't see any field for hardware information. Where do I put the information?

    Control Panel -> User Account -> Signature

    No special fields for system information. Just enter it as free text.

  • Thanks, gentlemen!
    schlingo: I had actually been around that page before, without noticing the download button. As you can see, it helped me adding a signature.

    Oh, I chose to put EEP info BEFORE PC info. I hope it will not be too confusing :ad_1:

  • Hi, exactly 3 years later I entered into the the same issues.

    The function EEPTrainLooseCoupling is not easy to use.

    The naming of the two new trains after EEPTrainLooseCoupling is depending on the last direction of the train. If the train is stopped it seems to be <train_name>;001 and <train_name>;002 or the way around.

    Did you solve the problem?

    I solved the problem by calculating the first vehicle not part of the consist, and then uncouple both sides of the vehicle, so not using EEPTrainLooseCoupling at all.

    Groetjes, Peter.

    Windows 11 Pro 64bit

    Intel i9 9900k 8 cores @ 3.6 GHz, 32GB RAM

    NVidia GeForce RTX 2080 Ti 11GB

    Started in 2017 with EEP13, now using EEP17.2

    Groeten, Peter Nelissen :af_1: