SnC Platforms have station.gs which includes GenericPassengerStation.gs they are Boodnoks creations. I'll leave deciphering up to those who's coding is not as out of date and rusty as mine. station.gs copied below if it helps
Code:
include "GenericPassengerStation.gs"
class Station isclass GenericPassengerStation {
// Controls where the train stops
bool TriggerSupportsMassStoppedLoad(Vehicle vehicle, string triggerName) {
Interface.Log("TriggerSupportsMassStoppedLoad called with triggerName " + triggerName);
bool vehicleToTrain = vehicle.GetDirectionRelativeToTrain();
int lengthOfTrain = vehicle.GetMyTrain().GetVehicles().size();
// BEWARE! GROSS HACK ALERT: Hardcoded to match my naming scheme for triggers...
int platformnumber = Str.ToInt(triggerName[1,2]);
int triggerNumber = Str.ToInt(triggerName[8,10]);
// AI case, control the stopping point
// BEWARE! GROSS HACK ALERT: Assumes that the triggers are laid in rising
// numerical order along the direction of the track
int direction = vehicle.GetRelationToTrack(me, "track_" + platformnumber);
if (!vehicleToTrain) {
direction = -direction;
}
// catchall at the "end" of the platform
if ((direction == Vehicle.DIRECTION_FORWARD and triggerNumber > 5) or
(direction == Vehicle.DIRECTION_BACKWARD and triggerNumber < 2)) {
return true;
}
// stop AI trains at the station building end of the platforms
// car length, direction, platform #, stop point
// <3 forward 1 >2
// <3 backward 2 <5
// <4 forward 2 >4
// <4 backward 1 <3
// <6 forward 1 >3
// <6 backward 2 <4
// <8 forward 1 >4
// <8 backward 2 <3
if(lengthOfTrain < 3 and ((direction == Vehicle.DIRECTION_FORWARD and platformnumber == 1 and triggerNumber > 2) or
(direction == Vehicle.DIRECTION_BACKWARD and platformnumber == 2 and triggerNumber < 5))) {
return true;
}
if(lengthOfTrain < 4 and ((direction == Vehicle.DIRECTION_FORWARD and platformnumber == 2 and triggerNumber > 4) or
(direction == Vehicle.DIRECTION_BACKWARD and platformnumber == 1 and triggerNumber < 3))) {
return true;
}
if(lengthOfTrain < 6 and ((direction == Vehicle.DIRECTION_FORWARD and platformnumber == 1 and triggerNumber > 3) or
(direction == Vehicle.DIRECTION_BACKWARD and platformnumber == 2 and triggerNumber < 4))) {
return true;
}
if(lengthOfTrain < 8 and ((direction == Vehicle.DIRECTION_FORWARD and platformnumber == 1 and triggerNumber > 4) or
(direction == Vehicle.DIRECTION_BACKWARD and platformnumber == 2 and triggerNumber < 3))) {
return true;
}
// manual case - the train has been stopped anywhere along the platform
if (vehicle.GetMyTrain().IsStopped()) {
Interface.Log("Train is stopped");
return true;
}
return false;
}
// controls which side the doors open on
// BEWARE! GROSS HACK ALERT: assumes track laid with platform on left side
// this will be true for all my stations, as my 3rd rail track requires that too...
void GetTrackAndSide(Vehicle vehicle, string triggerName, TrackLoadInfo retInfo) {
// BEWARE! GROSS HACK ALERT: Hardcoded to match my naming scheme for triggers...
int platformnumber = Str.ToInt(triggerName[1,2]);
retInfo.trackName = "track_" + platformnumber;
retInfo.trainLeftSide = (vehicle.GetRelationToTrack(me, retInfo.trackName) != Vehicle.DIRECTION_BACKWARD) == vehicle.GetDirectionRelativeToTrain();
retInfo.platformIndex = platformnumber - 1;
}
public void Init(void)
{
inherited();
Interface.Log("Init called");
// number of platforms?
InitPassengerStation(2);
Interface.Log("Calling StationMain...");
StationMain();
}
public void AppendDriverDestinations(string[] destNames, string[] destTracks)
{
StringTable stringTable = GetAsset().GetStringTable();
int i;
for (i = 1; i <= 2; i++) {
destNames[destNames.size()] = stringTable.GetString("platform") + " " + i;
destTracks[destTracks.size()] = "track_" + i;
}
}
};