Jump to content
Het is nu mogelijk om te stemmen op de Screenshot van het Jaar 2024! It is now possible to vote for the Screenshot of the Year 2024! ×
  • 0

SGMm koersborden werken niet met LUA script


Question

Als ik de koersborden van een AI SGMm trein wil wijzigen door middel van een LUA script, werkt dat niet. Het koersbord blijft op "Extra trein" staan. Hoe kan ik dit oplossen?

 

De code:

function OnEvent(event)
  _G["OnEvent" .. event]();
end

-- Train ID's
TrainA_id = "4027a" -- ICM 4027 first carriage
TrainB_id = "4055a" -- ICM 4055 first carriage
TrainC_id = "4240a" --ICM 4240 first carriage
TrainD_id = "10412B112" -- GTW Herman Brood first carriage
TrainE_id = 3622122  --SGMm 2122 first carriage
TrainF_id = 957887272273  -- VIRM 9578 first carriage
TrainG_id = "4011a" -- ICMm 4011 first carriage
TrainH_id = "4094a" -- ICMm 4094 first carriage
TrainI_id = "10367O123" -- Arriva APD first carriage

-- Destination ID's
BLANCO = 0  -- Blanco

ICM_AS  = 7  -- Amsterdam
ICM_LW  = 28 -- Leeuwarden
IC_AM   = 6  -- Amersfoort Schothorst
ICM_NI  = 1  -- Niet Instappen
ICM_DH  = 12 -- Den Haag Centraal
ICM_LW  = 28 -- Leeuwarden
ICM_RT  = 38 -- Rotterdam Centraal
ICM_ZW  = 50 -- Zwolle

IRM_ZL  = 133 -- Zwolle

SLT_N_I = 1  -- Niet Instappen
SLT_TT  = 16 -- Tiel
SLT_ALC = 5  -- Almere Centrum
SLT_AMS = 8  -- Amsterdam Centraal
SLT_RH  = 42 -- Rhenen

DDZ_AH  = 9  -- Arnhem Centraal
SGM_ZL  = 53 -- Zwolle
DDZ_RTD = 35 -- Rotterdam Centraal
GTW_EM  = 16 -- Emmen
GTW_AP  = 7  -- Apeldoorn

SGM_GR  = 23 -- Groningen
-- Events
function OnEvent(event)
  _G["OnEvent" .. event]();
end

function OnEventTrainAdest1()
  SysCall ( TrainA_id .. ":SetControlValue", "DestinationBoards", 0, ICM_DH );
  SysCall ( TrainA_id .. ":SetControlTargetValue", "DestinationBoards", 0, ICM_DH );
end

function OnEventTrainBdest1()
  SysCall ( TrainB_id .. ":SetControlValue", "DestinationBoards", 0, ICM_LW);
  SysCall ( TrainB_id .. ":SetControlTargetValue", "DestinationBoards", 0, ICM_LW );
end

function OnEventTrainCdest1()
  SysCall ( TrainC_id .. ":SetControlValue", "DestinationBoards", 0, ICM_RT );
  SysCall ( TrainC_id .. ":SetControlTargetValue", "DestinationBoards", 0, ICM_RT );
end

function OnEventTrainDdest1()
  SysCall ( TrainD_id .. ":SetControlValue", "DestinationBoards", 0, GTW_EM );
  SysCall ( TrainD_id .. ":SetControlTargetValue", "DestinationBoards", 0, GTW_EM );
end

function OnEventTrainEdest1()
  SysCall ( TrainE_id .. ":SetControlValue", "DestinationBoards", 0, SGM_GR );
  SysCall ( TrainE_id .. ":SetControlTargetValue", "DestinationBoards", 0, SGM_GR );
end

function OnEventTrainFdest1()
  SysCall ( TrainF_id .. ":SetControlValue", "DestinationBoards", 0, IRM_ZL );
  SysCall ( TrainF_id .. ":SetControlTargetValue", "DestinationBoards", 0, IRM_ZL );
end

function OnEventTrainGdest1()
  SysCall ( TrainG_id .. ":SetControlValue", "DestinationBoards", 0, ICM_ZW );
  SysCall ( TrainG_id .. ":SetControlTargetValue", "DestinationBoards", 0, ICM_ZW );
end

function OnEventTrainHdest1()
  SysCall ( TrainH_id .. ":SetControlValue", "DestinationBoards", 0, ICM_AS );
  SysCall ( TrainH_id .. ":SetControlTargetValue", "DestinationBoards", 0, ICM_AS );
end

function OnEventTrainIdest1()
  SysCall ( TrainI_id .. ":SetControlValue", "DestinationBoards", 0, GTW_AP );
  SysCall ( TrainI_id .. ":SetControlTargetValue", "DestinationBoards", 0, GTW_AP );
end

 

Alvast bedankt voor de hulp!

1 answer to this question

Recommended Posts

  • 0

Als dat, net als bij de VIRM, door een update van het materieel komt, heb je geen keuze anders dan in plaats van de control te wijzigen, direct de betreffende geometrie in/uit te schakelen.

 

Heb je precies de handleiding op DutchSims gevolgd?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Home
Activities
Sign In

Sign In



×
    Search In
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Privacy Policy