Hey there! I'm in the very early stages of creating a free roam city map/track and I'm planning the implementation of working traffic lights. As far as I'm aware, there are two possible approaches: Through conditions (see https://github.com/ac-custom-shader...ob/master/config/tracks/common/conditions.ini) Through animating the light meshes. Option 1 seems to be the more reasonable approach. This involves using one of the conditions and its values to resemble the signal cycle of their real life counterparts. But it seems to be very tailored to street lights among other emissive sources like building facade lighting. Option 2 seems to be a bolder and questionable approach. This involves me animating each light mesh within their Traffic light modules to "move into the traffic light housing" when turned off, and then reveal itself when turned on; again, according to the signal cycle of their real life counterparts. Both approaches I feel are very hacked together (albeit, as with most things). The main concern for Option 2 is how much animation Assetto Corsa can handle. I can simplify each light down to just a triangle, and a rough ChatGPT estimate suggests 1,911 individual lights, which would mean 5,733 animated triangles/light-meshes, so who knows, it might crash, it might not, but I'd love to hear your thoughts. I also don't see any way of integrating these light cycles with mods like CSP traffic tool, so that's another concern. All in all, I'd like to get an idea of how to best approach this project, any pointers to resources or anything that may be of interest is also greatly appreciated. Thank you for your generosity
Hello. I am at the same point with the intention of create some functional traffic lights so that them also work with the traffic planner. I thought it would be as simple as editing an object by telling it when to turn on and off on a timeline, but I see that it is not that simple. I thought that using Condition "Blink" it would be possible, but I see that it is not possible. On the other hand, thanks to the link that you shared on Github, there is a condition 70 to turn on depending on the temporary time, but it only has one time slot: [CONDITION_70] ; active at 17:30–07:00 NAME=NIGHT_FLICK INPUT=TIME ... It occurred to me that I could vary that time and even make different on and off conditions for one of the lights, but I think this is programmed in a .LUT or .LUA and I have no idea how to modify those scripts. I don't see it very clearly about animating the lights and it would be very difficult to edit them later to synchronize the signals. Have you achieved any results, have you solved the problem? It would be appreciated if you managed to do it or if someone knows how to do it. All the best Xuacu My traffic light modeling process:
Hello! here is my current traffic light status with some problems Problem explained in this post: https://assettocorsamods.net/threads/working-starting-timer-for-my-track.2409/page-2#post-22636
Isn't it realistic for the red light to last forever? Sorry I cannot help, I did not used the script for this.
Yes this is the problem that I have (explained in the other post) the calculations of the on/off lights are correct but the en of the loop looks like it goes on for a long time before starting again, I don't know why happend. I have managed to get closer to real time but the calculations have been by trial and error and I do not think it is the most correct solution
You are further than I am - I have not gotten to creating my traffic lights yet. However... If working out the programming logic - there should be 1 central timer that governs the whole AC session. Can that be queried? If so, then a simple formula can be derived that queries the current time in the Assetto Corsa timing clock (time elapsed) and the adds a variable to cycle the light changes. GREEN 3 minutes, ORANGE - 5 seconds, RED 3 minutes (or less). That would look like... 1 - Query current time 2 - Turn GREEN 3 - End of GREEN = Current time + 3 minutes (probably in seconds) 4 - If current time = End of GREEN - turn ORANGE 5 - End of ORANGE = Current time + 5 Seconds 6 - If Current time = End of ORANGE, turn RED 7 - END of RED = Current time + 3 minutes (probably in seconds) 8 - If current time = End of RED - turn GREEN 9 - Repeat Loop 3-9 Then have each traffic light execute its own timing loop. Then you can sequence the traffic lights to time light changes for a specific driving speed - like in real municipal light timing scenarios. There is a LUA tutorial on YouTube.
Hi! I decided to try asking chat GPT how to make a functional traffic light and it described a logical programming code to me. It also talked about LUA files but I have no idea about programming, although I would be interested in seeing that tutorial you mentioned about LUA. I suppose that traffic planner will work with logical code, but I already told you that I am not a programmer, at the moment it eludes me, I dedicate myself more to the visual and artistic issue.
Here's a link to a short course... I find this instructor to be pretty good. "Steve's Teacher" also has a much more indepth course on LUA, with a video on each part of the language and how it use it. You can find that on his YouTube channel as well - just a bit more buried. Programming is not difficult, it's the 'code' words and what they do/how to use them that needs a bit of practice. I equate programming to teaching a 5-6 year old simple steps to accomplish a certain task.