Radar/speed camera

Das Forum befindet sich im reduzierten Betrieb. Die Addon- und Supportforen bleiben weiterhin verfügbar.
Bitte beachte, dass OMSI nicht mehr weiterentwickelt wird. Ein Teil der Entwickler widmet sich inzwischen der Entwicklung eines neuen Simulators. Weitere Informationen zum LOTUS-Simulator findest Du hier.
  • I'm making a 3D radar for my map project. I'm importing the textures but i'd want my radar to be fully operational like a traffic light. therefore I don't know what should the scripts say in order to create a "flash" effect when i drive above 50kph for example. screenshots will come once i finish the render with blender

    :)

    .

    Einmal editiert, zuletzt von User23392 () aus folgendem Grund: No large Fonts pls. :)

  • A map object in Omsi can not read the speed of AI vehicles or the bus. By means of a plug-in you can only read the speed of the player's bus and record a carry at a certain position (L.L.velocity). This information can only be processed by an external program.
    Speed cameras are not possible in Omsi.

  • As Tatra noted, OMSI does not in general support the notion of "inter-object communication"; that is, objects cannot access the state (variables and constants) of other objects.


    There are however certain special-purpose variables, typically maintained by the game, that can occasionally be exploited in order to convey information between objects. One such variable is TrafficLightApproach, which the game sets to 1 iff a vehicle is approaching a traffic light's crossing.


    So here's my (purely theoretical, since I haven't actually implemented, let alone tested it) workaround: Your camera could be configured to serve as a traffic light, and associated with some kind of "virtual" (read: indistinguishable from a normal road segment), unidirectional crossing. The crossing itself would permanently have the traffic light set to green (or off), such that traffic flow is unaffected. The actual trick would be to position the crossing object before the traffic light, rather than behind it. The traffic light's script would in turn leverage the information relayed by the crossing ("is a vehicle approaching?") in order to estimate how long the vehicle "stayed within" the crossing; i.e., the temporal duration of (tcrossing exit - tcrossing entry). When the elapsed time is found to be lower than a threshold -- which will of course vary based on the crossing's length, its configured [approachdist], and the speed limit that shall be enforced -- the camera can infer that the vehicle's velocity was above the limit, and may flash or otherwise react. And since the camera is to be situated past the crossing, the player (in case of user-controlled vehicles) can still witness the camera's reaction, in spite of having left the crossing.


    Naturally, under high traffic density conditions this workaround will fail, since the TrafficLightApproach flag will remain set until the last vehicle has departed from the crossing, resulting in measurement of the accrued elapsed time between the time of entry of the first vehicle and exit of the last one, rather than between entry and exit of individual ones.

  • Unorthodox Paradox,


    Die Idee ansich ist nicht schlecht. Ich hatte bei meiner Antwort nicht an Rotlichtblitzer gedacht, sondern an eine reine Geschwindigkeitsmessung. Daher kam ich garnicht auf die Idee, mit der Annäherungsampel. Eine reine Topspeedmessung auf einer reinen Busspur macht wenig Sinn und auf allen anderen Straßen würde der andere Verkehr die Messung verhindern.
    Deine Idee könnte man aber eventuell für einen Rotlichtblitzer nutzen. Ist wenigstens ein Anfang.


    Wenn die Annäherungsvariable 1 ist, kann man den Blitzer einschalten lassen und mittels Timer gleich wieder ausmachen. Bei zu geringer FPS sieht man vielleicht nichts, aber rein Theoretisch könnte es sogar funktionieren.

  • I have never tested but I also already thought of a logic of this type, with the traffic lights. It would be possible to use the stop / jumps that are inside the traffic light : I think of two tracks, on a straight road, that changes the state of the traffic light.


    For example the light is always 6:Green, and when a car is detected on track 1, the status of the light changes (via a jump or a stop if no approach)(example : 7:Green). When the car has passed the distance of track 1, the car is detected on track 2 and the status of the light changes (example : returning to 6:Green).


    After that it would be easy to parent an object to this "crossing", script it and to display the speed or a flash after a bit of calculation.


    So by default the light is 6, when a car arrives the light becomes 7 : we start the "counter", when the light becomes 6 we stop the "counter" and we calculate the speed and display it.


    The shorter the tracks, the better the cars will be detected during heavy traffic, but the less the speed will be accurate (because of the shorter length).


    I always wanted to try, so I think I will do it soon.


    Almost anything is possible, like the bikes (that I already did 6 months ago but never published

    :P

    )

  • Tatra,


    I was referring to a speed measurement camera myself. It only needs to be coupled to a crossing in order to be capable of using the approach-variable; it need not otherwise affect traffic, or prioritize a certain track.


    Florito,


    Your approach sounds much more flexible and robust than mine, albeit also more complex to implement. The sole issue I see here, is that the more complex the crossing becomes, the harder it gets to reuse it as-is elsewhere, hence also less likely for map authors out there to actually employ it in their projects (same story as with Maerkertram's enhanced traffic lights, which unfortunately have hardly seen any adoption outside of X10).

  • Well if you want i already have the 3D model. Omsi bus company add-on related about speed cameras that I've never seen(even though i don't have the addon). Maybe by passing by the omsi speed(red characters on the top) and ai-known speed we could set the speed limit(53kph) and then the radar "kicks in" when that speed is higher