Trigger to get driver name / train name

BtGio99

New member
Hello everyone, I know this is the wrong forum to ask, but I seem unable to post in the Scenario Scripting forum.

I'd like to have a trigger, that activates a script where I get either the Driver's name or the Train name, so that I can set visible a certain mesh based on that name.
I know how to show/hide meshes and all that jazz, but I can't find a way to put this together:


  1. train.GetTrainDisplayName();
  2. DriverCharacter driver = train.GetActiveDriver();
  3. Loco = Train.GetFrontmostLocomotive();
I thought something like:

include "gs.gs" include "world.gs" include "train.gs" include "MapObject.gs"

class xx isclass Train {

public void Init(void) {
inherited();
}
public native string GetTrainDisplayName(void){
string trainName = Train.GetTrainDisplayName();

if (trainName == "something") {
then do xy;
} else {
do yx;
}
}
}

I can't understand what's missing.. I know the script is too short to work, but still:confused:

Thanks for everybody who can reply, and help me. Any advice, new idea, or critic is well appreciated.
 
If it is a trigger you write script for


Code:
class xx isclass Trigger {


void TrainnameHandler(Message msg) {
//here what you want to happen if the train reaches the trigger
}


public void Init(void) {
    AddHandler(me,"Object","Enter","TrainnameHandler");
    inherited();
}
};


there is sub forum where we discuss scripts here
greetings GM
 
Back
Top