I am using SCS2006 to run AI trains in my session. I have a station with 6 platforms. When an AI train arrives at a signal outside the station I want it to be able to determine in a loop which platforms are available and which ones are occupied before using Path Set to the right platform.
The way I want to do this is to have a Yes/No variable for each platform that indicates if it is occupied or not. However, I don't want this variable to be set or unset by trains that arrive/leave the platform using On Trigger Enter/Leave because I would have to do this for every possible train that can arrive at the station. I would also have to do this for every possible train for every possible trigger. I would also not know which platform the train arrived at and is leaving from and which On Trigger to listen for. Basically doing this from each train seems very complex.
Is there a way to Set or Unset these variables on a scenario thread by detecting the presence of trains on a trigger or trackmark? If so, how would I make this run in a loop for the lifetime of my scenario. Is that even advisable? From what I understand scenario threads are non-train specific and there can be one dedicated to monitor these platform triggers. But how do I keep that thread going for the liftime of the scenario? Also even though scenario threads are non-trian specific it looks like On Trigger and On Trackmark are train specific and cannot be used in a scenario thread?
Any suggestions of how to approach this are greatly appreciated.
The way I want to do this is to have a Yes/No variable for each platform that indicates if it is occupied or not. However, I don't want this variable to be set or unset by trains that arrive/leave the platform using On Trigger Enter/Leave because I would have to do this for every possible train that can arrive at the station. I would also have to do this for every possible train for every possible trigger. I would also not know which platform the train arrived at and is leaving from and which On Trigger to listen for. Basically doing this from each train seems very complex.
Is there a way to Set or Unset these variables on a scenario thread by detecting the presence of trains on a trigger or trackmark? If so, how would I make this run in a loop for the lifetime of my scenario. Is that even advisable? From what I understand scenario threads are non-train specific and there can be one dedicated to monitor these platform triggers. But how do I keep that thread going for the liftime of the scenario? Also even though scenario threads are non-trian specific it looks like On Trigger and On Trackmark are train specific and cannot be used in a scenario thread?
Any suggestions of how to approach this are greatly appreciated.
Last edited: