News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Double Way

Started by salihonur, July 10, 2009, 04:38:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

salihonur

Hi,
I'm new at simutrans developing. I have been researching to create a new addon, I couldn't find an useful document for my aim. I built an autobahn and I want that the vehicles use both sides of the road. For example;

if car_current_speed > 120 (or 125)
  use left side
else
 use right side

And another problem is that the vehicles wich are on the autobahn wait the vehicles come from ancillary road.

ceap = car_entering_to_autobahn_position

if ceap_left_box+2=free or ceap_right_box+2=free
 enter autobahn
else wait

How can I make it?

Isaac Eiland-Hall

Simple answer: You can't, I'm sorry to say. Vehicles always travel in both directions on roads (one-way signs merely prevent traffic from passing the sign in one direction); and there is, unfortunately, no scripting available for addons.

salihonur

But there is a overtake patch. Vehicles use the left side when they are overtaking. I think it should be modifyed.

Isaac Eiland-Hall

Great. Simutrans is open source. Learn how to program and modify it. :)

It's true, the overtaking patch was done somewhat recently, but there are extremely special and limited instances when it can apply. The entire pass is checked before it is allowed to happen.

1. The vehicle must be able to pass in the space available
2. No intersections (because citycars turn randomly)
3. No oncoming traffic in the amount of space calculated to be needed

In other words, it is more like a graphics hack than anything else.