Reply To: Scenario Script…

#2424996
Jeff Hall
Participant

If you are wanting to edit the lua script to use the RA signals in other scenarios you can edit the file using a text editor.

Using the Route Editor place the RA signal where you want it and give it a number – say AB123

Copy the lua file from Steam\steamapps\common\RailWorks\Manuals\ATS into the scenario folder you are using.

Open the lua file with a text editor then change the signal numbers as required –

PLUGIN_LOCATION = “plugins/SignalControl.txt”

FALSE = 0
TRUE = 1

function OnEvent ( event )

if (event == “AB123”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“AB123”);
writefile:close();
return 1;
end

if (event == “MN595”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“MN595”);
writefile:close();
return 1;
end

if (event == “MN613”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“MN613”);
writefile:close();
return 1;
end

if (event == “MN657”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“MN657”);
writefile:close();
return 1;
end

if (event == “MP387”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“MP387”);
writefile:close();
return 1;
end

if (event == “MP389”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“MP389”);
writefile:close();
return 1;
end

if (event == “INIT”)then
local writefile = io.open( PLUGIN_LOCATION , “w” );
writefile:write(“INIT”);
writefile:close();
return 1;
end

end

I have only changed the first entry – you can leave the others as they are or add further signals

Edit your scenario as in the manual using your new signal numbers