Train Order Board aspect scripts.
Posted: Fri May 19, 2017 10:40 pm
Been messing about with this script a while now and I can't quite figure it out. Considering I've no idea what I'm doing, suggest whatever, but I'm specifically looking at or above the bold line. For the sake of keeping this short, I'm only posting from the start of the script to the end of my new section.
include "World.gs" //included this for world functions
include "Browser.gs" //included this for making browser elements
class trainorder isclass Industry
{
//standard scenery piece so im making this class MapObject
Soup mySoup;
int i;
//browser name
Browser info;
//operable animation values
float[] anim = new float[0];
//animation frame counts
float[] animFrame = new float[0];
//names of anims
int[] frame = GetMeshAnimationFrame();
Numbers[0] = 0;
Numbers[1] = 1;
Numbers[15] = 15;
Numbers[30] = 30;
string[] animName = new string[0];
bool AspectGreen = false;
bool AspectYellow = false;
bool AspectRed = true;
Asset m_coronaGreen, m_coronaYellow, m_coronaRed;
define int ASPECT_RED = 1;
define int ASPECT_YELLOW = 2;
define int ASPECT_GREEN = 3;
int m_signalAspects;
void ConfigureSignalAspects() {
switch (m_signalAspects) {
case ASPECT_GREEN:
AspectYellow = false;
AspectGreen = true;
AspectRed = false;
break;
case ASPECT_YELLOW:
AspectYellow = true;
AspectGreen = false;
AspectRed = false;
break;
case ASPECT_RED:
default:
AspectYellow = false;
AspectGreen = false;
AspectRed = true;
}
}
// ============================================================================
// Name: SigController
// Desc: Controls signal aspect
// ============================================================================
thread void SigController(void) {
if(frame = 1) {
SetFXCoronaTexture("light1", m_coronaRed);
SetFXCoronaTexture("light2", m_coronaRed);
}
else if(frame = 15) {
SetFXCoronaTexture("light1", m_coronaYellow);
SetFXCoronaTexture("light2", m_coronaYellow);
}
else if(frame = 30) {
SetFXCoronaTexture("light1", m_coronaGreen);
SetFXCoronaTexture("light2", m_coronaGreen);
}
else {
SetFXCoronaTexture("light1", null);
SetFXCoronaTexture("light2", null);
}
}
I know SigController can/does run because when I originally set it up it was arranged differently, and it did select all the correct coronas. That part seems to be fine. The problem is I need to get them to change - the signal is up(red) at frame 1, halfway(yellow) at frame 15, and down(green) at frame 30. Accordingly I've tried to set up so the script will pick up the animation frame and select the appropriate coronas, being null at all points in between. Unfortunately I'm currently getting a parse error reported on the bold line. Any suggestions, either for what is causing the parse error or whether or not this script will achieve what I want it to?
include "World.gs" //included this for world functions
include "Browser.gs" //included this for making browser elements
class trainorder isclass Industry
{
//standard scenery piece so im making this class MapObject
Soup mySoup;
int i;
//browser name
Browser info;
//operable animation values
float[] anim = new float[0];
//animation frame counts
float[] animFrame = new float[0];
//names of anims
int[] frame = GetMeshAnimationFrame();
Numbers[0] = 0;
Numbers[1] = 1;
Numbers[15] = 15;
Numbers[30] = 30;
string[] animName = new string[0];
bool AspectGreen = false;
bool AspectYellow = false;
bool AspectRed = true;
Asset m_coronaGreen, m_coronaYellow, m_coronaRed;
define int ASPECT_RED = 1;
define int ASPECT_YELLOW = 2;
define int ASPECT_GREEN = 3;
int m_signalAspects;
void ConfigureSignalAspects() {
switch (m_signalAspects) {
case ASPECT_GREEN:
AspectYellow = false;
AspectGreen = true;
AspectRed = false;
break;
case ASPECT_YELLOW:
AspectYellow = true;
AspectGreen = false;
AspectRed = false;
break;
case ASPECT_RED:
default:
AspectYellow = false;
AspectGreen = false;
AspectRed = true;
}
}
// ============================================================================
// Name: SigController
// Desc: Controls signal aspect
// ============================================================================
thread void SigController(void) {
if(frame = 1) {
SetFXCoronaTexture("light1", m_coronaRed);
SetFXCoronaTexture("light2", m_coronaRed);
}
else if(frame = 15) {
SetFXCoronaTexture("light1", m_coronaYellow);
SetFXCoronaTexture("light2", m_coronaYellow);
}
else if(frame = 30) {
SetFXCoronaTexture("light1", m_coronaGreen);
SetFXCoronaTexture("light2", m_coronaGreen);
}
else {
SetFXCoronaTexture("light1", null);
SetFXCoronaTexture("light2", null);
}
}
I know SigController can/does run because when I originally set it up it was arranged differently, and it did select all the correct coronas. That part seems to be fine. The problem is I need to get them to change - the signal is up(red) at frame 1, halfway(yellow) at frame 15, and down(green) at frame 30. Accordingly I've tried to set up so the script will pick up the animation frame and select the appropriate coronas, being null at all points in between. Unfortunately I'm currently getting a parse error reported on the bold line. Any suggestions, either for what is causing the parse error or whether or not this script will achieve what I want it to?