You do not need your if statements in the onTrainEntering and onTrainLeaving. The only time you would need those is if any trigger behaves differently from the others, but in your case they all do exactly the same thing.
I also see you are only having onInit return false if it doesn't find one trigger, not all 8 that you have. Therefore, you don't actually know that the script is not finding the triggers, because onInit returns true even if Trig2 through Trig8 aren't there. A quick work-around that reduces a lot of lines is to implement an array. See below:
import com.nolimitscoaster.*;
import nlvm.math3d.*;
public class Station extends Script implements TrackTriggerListener
{
StaticSound sSound;
Coaster cMyCoaster;
private TrackTrigger[] Trig = new TrackTrigger[8];
public bool onInit()
{
cMyCoaster = sim.getCoaster("Zeus");
for (i = 0; i < 8; i++) {
Trig[i] = coaster.getTrackTrigger("Trig" + (i+1));
if (Trig[i] == null) {
System.err.println("Trigger " + (i+1) + " not found");
return false;
}
}
sSound = StaticSound.loadFromFile("StationClick.ogg", StaticSound.E_ENVMODE_GLOBAL);
sSound.setPosition(new Vector3f(-263.0f, 12.0f, -207.35f));
sSound.setGain(10.0f);
if(sSound == null) {
System.err.println("Sound file not found");
return false;
}
return true;
}
public void onTrainEntering(TrackTrigger trigger, Train train)
{
sSound.play();
}
public void onTrainLeaving(TrackTrigger trigger, Train train)
{
sSound.play();
}
}
Therefore, you have a 45 line code instead of an 80 line code. Also notice I removed sCoasterName and sSoundFile, because they are unnecessary and that just puts two extra objects in memory that don't need to be there and makes your code 2 lines longer.