Jump to content

Empfohlene Beiträge

Hi 

 

Who can help me with either commands or LUA script

 

I have two trains running "Loc1" and "Loc2", and each train has two keywords:

 

LOC1 = keyword             "Module1" which refers to an user-defined event called "Loc1OpenDoors"

             second keyword "Module2" which refers to an user-defined event called "Loc1CloseDoors"

LOC1 = keyword             "Module1" which refers to an user-defined event called "Loc2OpenDoors"

            second keyword  "Module2" which refers to an user-defined event called "Loc2CloseDoors"

 

Now I want that when a trains hits a track contact the train stops and its corresponding event "Loc1OpenDoors" or "Loc2OpenDoors" is called,

and when the train leaves the contact, the corresponding event "Loc1CloseDoors" or "Loc2CloseDoors" is called.

I know that you can set this with a command that when a train hits a contact according to the trains name you can run its according event, but if you have 20 trains running then you have to do that for each train. Lot of work, lot of commands, which slows down the program.

 

Thanks in advance for the help.

Raf

 

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Raf,

here is what I would suggest you should do:

  • store the apropriate door names in each waggon.
  • upon entering the station halt, go through all waggons in your train, check if a door name exists and animate that door
  • wait some time
  • with a second loop, close all doors again (because surely you don't want to close the doors after leaving the station?)
  • set the train in motion (when appropriate)

my demo layout:    door opener.mbp

Kind regards
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Goetz

 

Thanks for the effort, but thats what im doing now. I check if for instance Loco1 hits a track contact and then open and close its according doors.

But i have a layout with over 30 trains (all self created belgian trains with ketchup)  and i have to do that for every train hitting that rail contact. This means a lot of commands.

What i want is that with one command it works for all trains using keywords to execute their according opening and closing procedures.

Thanks a lot.

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 58 Minuten schrieb raf.sonneville:

This means a lot of commands.

No, it doesn't.
In my example, I use one command for all three trains. And I could use the same command for as many trains as you like.

Keywords don't help in this context. Use object variables to have every train carry it's individual door names.

Wanna check my example again, maybe? In fact, did you even bother to look at the example layout?

Bearbeitet von Goetz
spelling mistakes fixed
Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 52 Minuten schrieb raf.sonneville:

Do i load that example in 3DTS?

Yes!!!
It's a layout, exported into a file.

You may either double click it after downloading.
Or start the train studio first, go to "Online catalog" on the start page and look for "import existing layout" at the bottom right of that screen. Click on that and navigate to the downloaded file to open it.

vor 41 Minuten schrieb raf.sonneville:

Can u send this as pdf file pls?

A layout as a pdf file?
Are you having me on, Raf?

Or do you maybe misunderstand the term layout? Just in case, here's a picture of it:

586304273_layoutscreenshot.thumb.jpg.241cb7fc0cecaf80cfa805c4b95d3766.jpg

 

9_9
Goetz

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Goetz

Sorry to disturb you again

I tried your layout and works fine.

Then i tried this on my layout with nearly 30 trains and it works wonderful.

Whatever train that stops at a signal the doors open.... however...

The doors don't close when th train leaves, and the reason is that I am using automated routes, the trains stop at a signal and stand therewaiting until the signal is turned green by the automated routes.

This means that the command "For all vehicles on a track/contact" does not work because I cannot not use a trigger there.

If a put this command within the command for a signal changing to green then I cannot select at" Vehicle" on the right the trigger option, so the train leaves when the signal goes green but the doors don't close.

Can you once more help me on this please.

Thanks so much

Regards

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

If you will use "signal with keyword changes to green" you have to store the train in a variable in the signal to access the train.
Maybe you could also use "route is activated" then store the train in the route.

You must use "for all vehicles in a train" instead of "on a track" then.

Regards
Thomas

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Raf,

vor 29 Minuten schrieb raf.sonneville:

The doors don't close when th train leaves

Have you ever seen a train, where doors close when it leaves a station?
They should be closed before the train is set in motion, don't you aggree?

You have some mechanism which changes the signal and sets the train in motion, correct?
That's where you should insert some method to close the doors, wait the appropriate time and then send your train on it's journey afterwards.

Without knowing how your current mechanism works. I find it difficult to give you some appropriate advice.

Kind regards
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

You are right, in real life the doors close before leaving. In 3DTS the train leaves when the signal turns green, and speed is set by the settings of the signal, "accelerate to".

I think all i can do is leave the doors open for some time, then close them, and then let the train wait with closed doors until the signal turns green.

Anyway, thanks a lot for all your help.

Regards

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

12 minutes ago, HaNNoveraNer said:

If you will use "signal with keyword changes to green" you have to store the train in a variable in the signal to access the train.
Maybe you could also use "route is activated" then store the train in the route.

You must use "for all vehicles in a train" instead of "on a track" then.

Regards
Thomas

 

Thanks for the help, i will try that.

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 35 Minuten schrieb raf.sonneville:

In 3DTS the train leaves when the signal turns green, and speed is set by the settings of the signal, "accelerate to".

Still, you can use the mechanism which turns your signal to "clear" to

  • first close all doors
  • and then, with a delay of a few seconds, change the signal state.


Or, if you want a more natural behaviour and don't mind a bit of extra effort,

  • deactivate the acceleration in the signal contact
  • close the doors when the signal changes to "clear", indicating that the path is clear and secure
  • wait a few seconds
  • activate the accelleration in the signal contact
  • wait another second
  • deactivate the acceleration again
    (because it's no longer needed for this train which is already moving and you want it off again for the next one that follows.)
Link zu diesem Kommentar
Auf anderen Seiten teilen

Just for my 2p worth here, another option is to stop the train at the platform short of the signal, open the doors, wait, then check if the signal is green. If it is, close the doors, and set the train moving. If it isn't then you leave the train at the platform and have the signal changing trigger the event that closes the doors and starts the train.

Of course that does mean that when the signal changes you have to check to see if the train's delay is still running but that's just putting a boolean on the loco or the signal, or even on the platform!

Link zu diesem Kommentar
Auf anderen Seiten teilen

  • 4 Wochen später...

@raf.sonneville, may I suggest one improvement?

When you enter a contact, the EV knows the train that triggered the event.

It's preferable to say "set speed for this train that called" and not "set speed for a train on this contact".
It's not always guaranteed that the vehicle on the contact has a motor. And when it doesn't, your command will fail.

 

381970979_triggervehicle.jpg.402dd65bea588213a0e3ffe4f7787d09.jpg

 

greets
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

  • 3 Monate später...

Hello Hein,

the new V8 features user definable text on models.
You'll be able to change text like a displayed destination where a model designer adds this feature to his model.
And a number of designers are currently giving a lot of their time and effort to implement this feature.

You may want to follow the V8 beta test threads in this forum to find out more about this.

Greets
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

@Goetz that sounds really useful!

@hb.resing In the mean time on V7, the ET420 power car has an animation that changes the destination board between two different values depending on which of the variations is selected.

Another option is to create a sign board by attaching a text label to a rectangle primitive of the right size, position it over the destination board on the vehicle and have an event that makes it invisible or visible. Of course this is a crude and temporary thing, but it will give the desired effect with a little care an attention.

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 7 Stunden schrieb Goetz:

Hello Hein,

the new V8 features user definable text on models.
You'll be able to change text like a displayed destination where a model designer adds this feature to his model.
And a number of designers are currently giving a lot of their time and effort to implement this feature.

You may want to follow the V8 beta test threads in this forum to find out more about this.

Greets
Goetz

hi Goetz, 

thanks ,

the train destination indicators have some properties that can be set in the layout , Like "label"   text 

 I was struggeling with the propertys ,objects variables etc in the event screen. I think that it must be possible and not that difficult. 

 probaly it's a matter of using the right names of the properies ,objects ,variables to set a value 

Anyway I will take a look at the  V8 beta thread.

Link zu diesem Kommentar
Auf anderen Seiten teilen

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 erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...