Jump to content

Reversing out of a parking bay with V7


Empfohlene Beiträge

@GoetzHi Goetz

I have another issue that I would like your help with please.

Having introduced an airport into my layout I am in the process of sorting out passenger parking. The layout itself seems straightforward, setting the test route seems straightforward. The test car stops in the appropriate parking bay and after a given period of time will reverse out of the bay ready to continue on it's way. However instead of continuing it simply goes back into the parking bay. 

I have tried several different options but all to no avail. Clearly with V6 it would simply be a case of set the switch for parking bay D4 from 1 to 0 but that does not seem possible with V7. I have tried my Hercule Poirot bit within EV but nothing seems to solve this issue. Clearly there is a solution but I cannot find it . Would you be so kind as to point me in the right direction please.

Kind regards

Pete

airport parking 1.jpg

airport parking 2.jpg

airport parking 3.jpg

Link zu diesem Kommentar
Auf anderen Seiten teilen

1 hour ago, Goetz said:

Hi Pete,

Currently I'm at my dad's place with no access to a PC. Only my tablet to read and reply. Not sure yet when I'll find the time to take a look. 

Greets

Götz

Hi Goetz

That's absolutely no problem. Only when it fits in will be absolutely fine. I am in no particular rush, just like to solve problems at some point. For now I need to spend some time on the airport taxiways, and much more to achieve a more realistic airport. Your advice at some point, when it is convenient, will be brilliant.

I hope you enjoy your visit with your Dad.

Kind regards

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

I think the solution lies in having different targets.

Capture.thumb.JPG.2cfc068aa2dcd7343777a27a09e145a5.JPG

Contact 0 would normally have code to decide which bay to go to... If no vehicle on contact 1 set target to contact 1 else if no vehicle... etc.

When the car hits contact 1, we stop it, wait, then set Contact 2 as its target and set its speed to a negative value.

Capture.thumb.JPG.3ab5fb820b28e73de1450fb64ade8d72.JPG

Then when it reaches contact 2, which is only active in the reverse direction, we set speed 0, set the target to contact 3 wait a second and set the speed to a positive value.

Capture.thumb.JPG.f9237d41dd424691c5ba9b7551980874.JPG

I put a portal on either end of the test track  just to make it easy to test, but on your layout, Contact 3 should decide where the car goes next.

Hope that helps?

Simon

(I'll pit a bigger and better version together to prove the theory. I did test it with one car, but I want to see what happens with more cars.)

Link zu diesem Kommentar
Auf anderen Seiten teilen

56 minutes ago, simonjackson1964 said:

I think the solution lies in having different targets.

Capture.thumb.JPG.2cfc068aa2dcd7343777a27a09e145a5.JPG

Contact 0 would normally have code to decide which bay to go to... If no vehicle on contact 1 set target to contact 1 else if no vehicle... etc.

When the car hits contact 1, we stop it, wait, then set Contact 2 as its target and set its speed to a negative value.

Capture.thumb.JPG.3ab5fb820b28e73de1450fb64ade8d72.JPG

Then when it reaches contact 2, which is only active in the reverse direction, we set speed 0, set the target to contact 3 wait a second and set the speed to a positive value.

Capture.thumb.JPG.f9237d41dd424691c5ba9b7551980874.JPG

I put a portal on either end of the test track  just to make it easy to test, but on your layout, Contact 3 should decide where the car goes next.

Hope that helps?

Simon

(I'll pit a bigger and better version together to prove the theory. I did test it with one car, but I want to see what happens with more cars.)

Hi Simon

Just picked up your solution so will give it a try tomorrow. By the looks of it it should solve my problems so many thanks for that.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

18 hours ago, simonjackson1964 said:

Mhhhh Well it works, the problem I have with it is that the cars all crash into each other when reversing out. (So pretty realistic I suppose).

It was a bit more complicated than I had anticipated, but if you can handle the traffic control, something I'm not that good at, then it should work!

Hi Simon

Well you're right it does work brilliantly. Hmmm, so much for the auto routing system. No doubt as I begin to tweak things on my layout it will be possible to mix and match but for now your solution is Numero Uno. I have a few thoughts that might help with the poor driver behaviour so if I get those to work then I'll let you know. Otherwise I plan to sell all of my shares in the 3D Train Studio driver insurance company and set up a vehicle repair shop!!!

Once again many thanks for your assistance.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

There is something that puzzles me about it though:

When track contact 0 is triggered it sets the target for the vehicle. I did some jiggery-pokery with variables to "lock" the routes, and that seems to work. But when the vehicle arrives at Contact 1a, 1b, 1c or 1d, it stops, waits and reverses, but doesn't set the target as contact 2a, 2b, 2c or 2d. Good old "Contact is triggered" still works, but it seems you can't set a target that requires the vehicle to actually reverse.

I've tried every combination I can think of. It's possible this is either a bug, or an oversight in the design.

Bearbeitet von simonjackson1964
typo
Link zu diesem Kommentar
Auf anderen Seiten teilen

2 hours ago, simonjackson1964 said:

Hah. Cracked it!

After setting the vehicle in motion in the reverse direction, delay execution for half a second and then set the target.

I've got a vehicle doing a waltz around the large 4-way crossing to prove it!

Simon

Now that's sound perfect. I have been experimenting too but only to se if I can incorporate the "autopilot" system in conjunction with your solution. Both systems work absolutely fine, to a point. Your bit is no problem but I am having real problems with the auto routing. I can set the start point, set the route all the way round to the parking bay. However, in my earlier experiments I set a short auto route from the equivalent of your contact 0 to the parking bay contact 1 and I cannot for the life of me get rid of it. The problem now is that the vehicle follows the little green line all the way round the given route but as soon as it get to contact 0 the short route takes over and the full route is deleted. The same thing happens when the vehicle reverses out of the parking bay and hits the stop contact 2. 

Perhaps after I have slept on this I might see the solution. Either that or I will have to duplicate this part of my layout in a demo one and try that one instead until I get it right.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 4 Stunden schrieb simonjackson1964:

but doesn't set the target as contact 2a, 2b, 2c or 2d

make sure that you give the car a (minimal) positive speed and wait for it to stop, before assigning the new target.
You cannot assign targets that require a reversal of direction.

Link zu diesem Kommentar
Auf anderen Seiten teilen

1 hour ago, Goetz said:

make sure that you give the car a (minimal) positive speed and wait for it to stop, before assigning the new target.
You cannot assign targets that require a reversal of direction.

In fact, you have to have the vehicle already moving in the other direction and off the last target to assign the new contact.

This works:

Capture.JPG.449a3e4858e01276a006566d6e3822b0.JPG

This doesn't:

Capture.JPG.657d8802a41ff57b7295398df7a3d990.JPG

Link zu diesem Kommentar
Auf anderen Seiten teilen

3 hours ago, 220hotwheels said:

Now that's sound perfect. I have been experimenting too but only to se if I can incorporate the "autopilot" system in conjunction with your solution. Both systems work absolutely fine, to a point. Your bit is no problem but I am having real problems with the auto routing. I can set the start point, set the route all the way round to the parking bay. However, in my earlier experiments I set a short auto route from the equivalent of your contact 0 to the parking bay contact 1 and I cannot for the life of me get rid of it. The problem now is that the vehicle follows the little green line all the way round the given route but as soon as it get to contact 0 the short route takes over and the full route is deleted. The same thing happens when the vehicle reverses out of the parking bay and hits the stop contact 2. 

Perhaps after I have slept on this I might see the solution. Either that or I will have to duplicate this part of my layout in a demo one and try that one instead until I get it right.

Pete

So, the point is that you need to set a new target whenever the vehicle reaches the current target. In the circumstance you describe here's what I would do:

On the vehicle create a variable, type "List", and fill the list with objects, each one holding the next target track contact in sequence. Call it "route" or some such. (doig that will enable each vehicle to have it's own route)

On contact 3, put an event:

Untitled.thumb.jpg.0e1e13db7faf865617f99673f2e194a2.jpg

Set the vehicle to Trigger: Vehicle. Then set the target to "Variable (extended)", select the object as "Trigger: Vehicle" and the name as the name of your list.

Capture.thumb.JPG.7fe969f57bbb00c0179bedeca87eefbc.JPG

This should set the route through the streets to take you back to where you want the vehicle to be.

Cheers

Simon

 

 

Bearbeitet von simonjackson1964
Remove unwanted screenshot!
Link zu diesem Kommentar
Auf anderen Seiten teilen

I could imagine a 'polite' process, with a Track Contact in the road before the parking slots. Have a variable set when any car is reversing, and a condition such that, if the Reversing flag is set, the approaching car comes to a stop, as if it were at a traffic light, to let the car out. Once the parked car on its way, the Reversing flag is released, and the approaching car continues its journey. Any use as an idea..?

Ich könnte mir einen „höflichen“ Prozess vorstellen, mit einem Gleiskontakt auf der Straße vor den Parkplätzen. Setzen Sie eine Variable, wenn ein Auto rückwärts fährt, und eine Bedingung, dass bei gesetztem Reversing-Flag das sich nähernde Auto wie an einer Ampel zum Stehen kommt, um das Auto auszulassen. Sobald das geparkte Auto unterwegs ist, wird die Rückfahrfahne freigegeben und das herannahende Auto setzt seine Fahrt fort. Irgendeine Verwendung als Idee..?

Link zu diesem Kommentar
Auf anderen Seiten teilen

Good morning one and all, @simonjackson1964  @Dad3353 

Your solutions seem to hit the mark. I cannot wait to put them fully into practice. I do seem to have one issue though that I just have not been able to resolve. I have a small section of route selected via the auto route system and I just cannot get rid of it. I've tried replacing each of the contacts, the road sections and the vehicle but all to no avail. The problem seems to be that as soon as the contact to start that route is tripped then the route is initialised and all other routes are deleted, anyone know why? If I set up another independent route it does not delete the old one!!!

Before I can fully appreciate the genius of your joint efforts I need to get rid of that b-----dy route.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

To get rid of it manually, just click the target selection icon on the car's properties tab. This should clear any current target, and a second click will request a new one, to which you just cancel.

To get rid of it automatically, well, there are two ways: the first is to assign the vehicle a new target. The second is to use an action "Set vehicle target" with the vehicle selected either hard coded or as a trigger, and leave the "target" field set to "Empty", which is a universal way of clearing a property or object store.

If something is notworking, my first suggestion is to make sure your "triggers" all refer to the correct class - the trigger object for a contact activation can be "vehicle" or "Track Contact", and I'm for ever forgetting to change it!

11 hours ago, Dad3353 said:

I could imagine a 'polite' process, with a Track Contact in the road before the parking slots. Have a variable set when any car is reversing, and a condition such that, if the Reversing flag is set, the approaching car comes to a stop, as if it were at a traffic light, to let the car out. Once the parked car on its way, the Reversing flag is released, and the approaching car continues its journey. Any use as an idea..?

Ich könnte mir einen „höflichen“ Prozess vorstellen, mit einem Gleiskontakt auf der Straße vor den Parkplätzen. Setzen Sie eine Variable, wenn ein Auto rückwärts fährt, und eine Bedingung, dass bei gesetztem Reversing-Flag das sich nähernde Auto wie an einer Ampel zum Stehen kommt, um das Auto auszulassen. Sobald das geparkte Auto unterwegs ist, wird die Rückfahrfahne freigegeben und das herannahende Auto setzt seine Fahrt fort. Irgendeine Verwendung als Idee..?

Thanks Doug

I've been thinking of something like that. But the biggest problem happens when two vehicles are both backing out at the same time, or one starts backing out just as another has finished and "heads for the exit". The problem is that there is no loop available to delay the one vehicle until the other is clear. About the only way I can see to do it is to have a list of vehicles waiting to move and process them in order. Or somehow use routes which would handle it all automatically!

Cheers

Simon

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Simon

I have tried the option of clicking the target section in the properties tab, made no difference. Your second option is, to me, just a bit too technical unless I am reading too much into the way forward with it. My solution has been to delete all of the EV relating to that particular operation. This might seem radical but so far, fingers crossed it does seem to have got rid of that b----y route, so I'll start again, set a route from the car park exit round a test route and back to the stop point in the parking area. From that point I will adopt your suggestion to set the relevant targets to reverse out and to then proceed to the track contact just before the one currently set as the start point for the auto route. I hope that works. If not then the auto route is out completely and I will simply set a number of targets for the car to hop from one to the other. The latter we know will work from your demo but it seems a shame not to take advantage of the new auto routing system.

I'll let you know how I get on.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

1 hour ago, 220hotwheels said:

Hi Simon

I have tried the option of clicking the target section in the properties tab, made no difference. Your second option is, to me, just a bit too technical unless I am reading too much into the way forward with it. My solution has been to delete all of the EV relating to that particular operation. This might seem radical but so far, fingers crossed it does seem to have got rid of that b----y route, so I'll start again, set a route from the car park exit round a test route and back to the stop point in the parking area. From that point I will adopt your suggestion to set the relevant targets to reverse out and to then proceed to the track contact just before the one currently set as the start point for the auto route. I hope that works. If not then the auto route is out completely and I will simply set a number of targets for the car to hop from one to the other. The latter we know will work from your demo but it seems a shame not to take advantage of the new auto routing system.

I'll let you know how I get on.

Pete

Hi Simon

Pure genius, that's all I have to say on the subject. Having followed your example to the letter I now have a properly working parking area. I'll now add a few more vehicles to the pot plus a police patrol vehicle and see if I can eliminate road rage and the odd collision. At least I now have a blueprint from which to experiment.

Many thanks for your guidance.

Pete

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...