0% found this document useful (0 votes)
21 views35 pages

EEP Functions Reference Guide

The document is a reference guide detailing EEP-specific Lua variables and functions for versions up to 13, including system, signal, switch point, storage, train, rolling stock, structure, track, camera, layout, and virtual train depot functions. Each function and variable is described with its purpose, parameters, return values, and usage notes. The guide serves as a comprehensive resource for developers working with EEP scripting.

Uploaded by

nalinew756
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views35 pages

EEP Functions Reference Guide

The document is a reference guide detailing EEP-specific Lua variables and functions for versions up to 13, including system, signal, switch point, storage, train, rolling stock, structure, track, camera, layout, and virtual train depot functions. Each function and variable is described with its purpose, parameters, return values, and usage notes. The guide serves as a comprehensive resource for developers working with EEP scripting.

Uploaded by

nalinew756
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Reference Guide to EEP functions

EEP-specific Lua variables and functions


For EEP up to and including version 13
EEP-specific Lua variables and functions .................................................................................... 1
System variables ............................................................................................................................................ 2
EEPVer, EEPTime
EEPTimeH, EEPTimeM, EEPTimeS

System functions ............................................................................................................................................ 4


clearlog, print
EEPMain

Signal functions .............................................................................................................................................. 5


EEPSetSignal, EEPGetSignal
EEPRegisterSignal, EEPOnSignal

Switch point functions ..................................................................................................................................... 7


EEPSetSwitch, EEPGetSwitch
EEPRegisterSwitch, EEPOnSwitch

Storage functions ............................................................................................................................................ 9


EEPSaveData, EEPLoadData

Train functions ...............................................................................................................................................10


EEPSetTrainSpeed, EEPGetTrainSpeed
EEPSetTrainRoute EEPGetTrainRoute
EEPSetTrainLight, EEPSetTrainSmoke, EEPSetTrainHorn
EEPSetTrainCouplingFront EEPSetTrainCouplingRear, EEPTrainLooseCoupling
EEPSetTrainHook, EEPSetTrainAxis

Rolling stock functions ...................................................................................................................................15


EEPRollingstockSetCouplingFront, EEPRollingstockGetCouplingFront
EEPRollingstockSetCouplingRear, EEPRollingstockGetCouplingRear
EEPRollingstockSetAxis, EEPRollingstockGetAxis,
EEPRollingstockSetSlot

Structure functions .........................................................................................................................................19


EEPStructureSetSmoke, EEPStructureGetSmoke
EEPStructureSetLight EEPStructureGetLight
EEPStructureSetFire, EEPStructureGetFire
EEPStructureAnimateAxis, EEPStructureSetAxis, EEPStructureGetAxis
EEPStructureSetPosition, EEPStructureSetRotation

Track functions ..............................................................................................................................................25


EEPRegisterRailTrack, EEPIsRailTrackReserved
EEPRegisterRoadTrack, EEPIsRoadTrackReserved
EEPRegisterTramTrack, EEPIsTramTrackReserved
EEPRegisterAuxiliaryTrack, EEPIsAuxiliaryTrackReserved
EEPRegisterControlTrack, EEPIsControlTrackReserved

Camera functions...........................................................................................................................................30
EEPSetCamera, EEPSetPerspectiveCamera

Layout functions.............................................................................................................................................31
EEPLoadProject

Virtual train depot functions ...........................................................................................................................32


EEPGetTrainFromTrainyard

Tip text functions............................................................................................................................................33


EEPChangeInfoStructure, EEPShowInfoStructure
EEPChangeInfoSignal, EEPShowInfoSignal
EEPChangeInfoSwitch, EEPShowInfoSwitch

page 1
Reference Guide to EEP functions
System variables

EEPVer EEPVer

type variable

used in script if EEPVer < 11 then


print("No train functions in this EEP version!")
source EEP end

requires EEP 10.2 plug-in 2

purpose Detecting the version number of EEP

EEPTime EEPTime

type variable if EEPTime == oldTime + 50 then


print("50 seconds have passed")
used in script oldTime = EEPTime
elseif EEPTime > oldTime + 50 then
source EEP print("More than 50 seconds have passed")
oldTime = EEPTime
else
requires EEP 10.2 plug-in 2 print("50 seconds haven’t passed yet")
end

purpose EEPTime provides a variable that represents the current time within the EEP layout.
The value equals the seconds passed since midnight (EEP time).

page 2
Reference Guide to EEP functions

EEPTimeH EEPTimeH

type variable

used in script
print("The time now is: ",EEPTimeH,":",EEPTimeM)
source EEP

requires EEP 10.2 plug-in 2

purpose Returns the hour component of EEPTime, expressed as a value between 0 and 23.

EEPTimeM EEPTimeM

type variable

used in script
print("The time now is: ",EEPTimeH,":",EEPTimeM)
source EEP

requires EEP 10.2 plug-in 2

purpose Returns the minute component of EEPTime, expressed as a value between 0 and 59.

EEPTimeS EEPTimeS

type variable
if EEPTimeS == 15 then
used in script EEPSetSignal(1, 1) -- traffic light goes green
elseif EEPTimeS == 45 then
source EEP EEPSetSignal(1, 2) -- traffic light goes red
end
requires EEP 10.2 plug-in 2

purpose Returns the second component of EEPTime, expressed as a value between 0 and 59.

page 3
Reference Guide to EEP functions

System functions
clearlog() clearlog()

type function

caller script

defined in EEP
clearlog()
parameters none

returns none

requires EEP 10.2 plug-in 2

purpose Clears the Lua event window.

print() print("Text1", "Text2", ..., TextN)

type function

caller script

defined in EEP
print("The time now is: ",EEPTimeH,":",EEPTimeM)
parameters multiple

returns one

requires EEP 10.2 plug-in 2

purpose Writes arguments to Lua event window (activate window in EEP properties)

notes  Number types are converted to strings.


 Accepts multiple arguments. Use comma as separator. Line feed with \n.
 Returns the entire print text as one string.

EEPMain() EEPMain()

type function

caller EEP

defined in script function EEPMain()


return 1
parameters none end

returns one

requires EEP 10.2 plug-in 2

purpose This function is called by EEP 5 times per second (i.e. every 200 milliseconds)
Useful for all actions that require constant repeats.

notes  Declaration of this function is mandatory in every script..


 The function is called by EEP without any parameters.
 The function must return any number other than 0 to be called again.
 Returning a 0 turns off the repeated calling of this function. Any other functions in your
script remain active.
 If this function returns something other than a number, EEP will cease to use the script.

page 4
Reference Guide to EEP functions

Signal functions

EEPSetSignal() EEPSetSignal(ID, Aspect, Callback)

type function

caller script
-- switch signal 0023 to 1 (aspect depends on signal)
defined in EEP EEPSetSignal(23, 1)

parameters two or three -- switch signal 0045 to 1 and call EEPOnSignal_45()


EEPSetSignal(45, 1, 1)
returns one

requires EEP 10.2 plug-in 2

purpose Switches a signal

notes  First argument is a numeric value representing the signal’s ID.


 Second argument is the signal’s aspect.
 If a 1 is entered as a third (optional) argument, the EEPOnSignal_x() function for this
signal is called when the signal’s aspect has changed. Use with care! The signal must
be registerd and the corresponding function must be declared. (see next page). Careless
use of this function may result in infinite loops.
 The function returns a 1 if the signal and the demanded aspect exist. It returns a 0 if
either one of the two could not be found.

EEPGetSignal() EEPGetSignal(ID)

type function
currentAspect = EEPGetSignal(1)
caller script
if currentAspect == 0 then
print("Signal 1 doesn’t exist")
defined in EEP elseif currentAspect == 1 then
print("Signal 1 set to Danger")
parameters one elseif currentAspect == 2 then
print("Signal 1 set to Clear")
returns one end

requires EEP 10.2 plug-in 2

purpose Provides the current state of a signal

notes  Argument is the signal’s ID.


 Return value is a numeric representation of the signal’s current aspect. The value reflects
the aspect’s position in the effects list of the signal’s properties.
 The return value is 0 if the signal doesn’t exist.

page 5
Reference Guide to EEP functions

EEPRegisterSignal() EEPRegisterSignal(ID)

type function

caller script
EEPRegisterSignal(1)
defined in EEP
function EEPOnSignal_1(newAspect)
parameters one print("Signal 1 switched to ", newAspect)
end
returns one

requires EEP 10.2 plug-in 2

purpose Registers a signal for the callback function EEPOnSignal_x()


The requirement of a registration prevents signals from triggering a callback when no
appropriate function was declared.

notes  The registration is mandatory for those signals which you want to trigger the
EEPOnSignal_x() function whenever the aspect changes.
 Argument is the signal’s ID.
 Return value is 1, if the signal exists or 0 if it doesn’t exist.

EEPOnSignal_x() EEPOnSignal_x(Aspect)

type function

caller EEP
EEPRegisterSignal(1)
defined in script
function EEPOnSignal_1(newAspect)
parameters one print("Signal 1 switched to ", newAspect)
end
returns none

requires EEP 10.2 plug-in 2

purpose Every aspect change induced by a contact or by manual operation (directly or in a link
chain) triggers this callback function if the signal has been registerd for callbacks.
However: Changing this or a linked signal’s state by Lua function will not trigger the
callback, unless the third argument in that function was a 1.

notes  The name of the function must not end in _x but with the signal’s ID. For signal 0012 the
correct name of the function would be EEPOnSignal_12().
Please note: The leading zeroes must be omitted in the function’s name!
 The function is called with the new signal aspect as an argument. The number matches
the position in the signal’s aspect list as found in the signal’s properties. Use a variable of
your choosing to store this value.
 EEP requires no return value when calling this function.

page 6
Reference Guide to EEP functions

Switch point functions

EEPSetSwitch() EEPSetSwitch(ID, Direction, Callback)

type function

caller script
-- set switch point 0067 to 1 (main line)
defined in EEP EEPSetSwitch(67, 1)

parameters two or three -- set switch point 0089 to 1 and call EEPOnSwitch_89()
EEPSetSwitch(89, 1, 1)
returns one

requires EEP 10.2 plug-in 2

purpose Switches a switch-point

notes  First argument is a numeric value representing the switch point’s ID.
 Second argument is the switch point’s aspect.
 If a 1 is entered as a third (optional) argument, the EEPOnSwitch_x() function for this
switch is called when the direction of the switch has changed. Use with care! The switch
must be registerd and the corresponding function must be declared. (see next page).
Careless use of this function may result in infinite loops.
 The function returns a 1 if the switch and the demanded direction exist. It returns a 0 if
either one of the two could not be found.

EEPGetSwitch() EEPGetSwitch(ID)

type function
currentDirection = EEPGetSwitch(1)
caller script if currentDirection == 0 then

defined in print("Switch point 1 doesn’t exist")


EEP
elseif currentDirection == 1 then
parameters one print("Switch point 1 set to main line")
elseif currentDirection == 2 then
returns print("Switch point 1 set to branch line")
one
end
requires EEP 10.2 plug-in 2

purpose Provides the current state of a switch point

notes  Argument is the switch point’s ID.


 Return value is a numeric representation of the switch’s current state. The value reflects
the state’s position in the effects list of the switch point’s properties.
 The return value is 0 if the switch doesn’t exist.

page 7
Reference Guide to EEP functions

EEPRegisterSwitch() EEPRegisterSwitch(ID)

type function

caller script
EEPRegisterSwitch(1)
defined in EEP
function EEPOnSwitch_1(Direction)
parameters one print("switch point 1 changed to ", Direction)
end
returns one

requires EEP 10.2 plug-in 2

purpose Registers a switch for the callback function EEPOnSwitch_x()


The requirement of a registration prevents switches from triggering a callback when no
appropriate function was declared.

notes  The registration is mandatory for those switches which you want to trigger the
EEPOnSwitch_x() function whenever the direction changes.
 Argument is the switch’s ID.
 Return value is 1, if the switch exists or 0 if it doesn’t exist.

EEPOnSwitch_x() EEPOnSwitch_x(Direction)

type function

caller EEP
EEPRegisterSwitch(1)
defined in script
function EEPOnSwitch_1(Direction)
parameters one print("switch point 1 changed to ", Direction)
end
returns none

requires EEP 10.2 plug-in 2

purpose Every aspect change induced by a contact or by manual operation (directly or in a link
chain) triggers this callback function if the switch has been registerd for callbacks.
However: Changing this or a linked switch’s state by Lua function will not trigger the
callback, unless the third argument in that function was a 1.

notes  The name of the function must not end in _x but with the switch’s ID. For switch 0034 the
correct name of the function would be EEPOnSwitchl_34().
Please note: The leading zeroes must be omitted in the function’s name!
 The function is called with the new switch direction as an argument. The number
matches the position in the switch’s direction list as found in the switch’s properties. Use
a variable of your choosing to store this value.
 EEP requires no return value when calling this function.

page 8
Reference Guide to EEP functions

Storage functions

EEPSaveData() EEPSaveData(Slot, Value|"String"|Boolean|nil)

type function
EEPSaveData(1, 42) -- store value
caller script
EEPSaveData(2, "I am slot 2") -- store string
defined in EEP
EEPSaveData(3, true) -- store boolean
parameters two
EEPSaveData(4, nil) -- delete
returns one

requires EEP 11.0

purpose Permanent data storage.


The saved data is stored in the same file as the user’s Lua program but isn’t visible in the
EEP Lua editor.
Prevents data loss when script is re-loaded.

notes  Provides a means for the Lua code to store data in slots that are numbered 1 to 1000.
 Each slot may contain a numeric, string or Boolean value. Strings must not contain
formatting characters (e.g. quotes).
 First argument is the slot ID
 Second argument is the data to be stored. Delete slot by assigning nil to it.
 Return value is true when storing was successful (i.e. target slot found), else false.
 Each slot is written to using the EEPSaveData() function and read from using the
EEPLoadData() function. The current value of each slot will also be saved with the user’s
Lua program when the layout is saved. This will maintain sync between layout condition
and data. The section of the script containing this data is not visible in EEP’s Lua editor.

EEPLoadData() EEPLoadData(Slot)

type function

caller script hResult, hData = EEPLoadData(1)

defined in EEP if hResult then


print("Slot 1 contains: "..hData)
parameters one else
print("Slot 1 is empty")
returns two end

requires EEP 11.0

purpose Loads contents from data slot.


Use this function to restore data when you re-load your script.

notes  Provides a means for the Lua code to read data from slots that are numbered 1 to 1000.
 Each slot may contain a numeric, string or Boolean value. Strings must not contain
formatting characters (e.g. quotes).
 Argument is the slot ID.
 First return value is true, if the slot contains data, else false.
 Second return value is the data contained in this slot.
 Slot data is transferred from the script to memory when a layout is loaded.

page 9
Reference Guide to EEP functions

Train functions

EEPSetTrainSpeed() EEPSetTrainSpeed("#Name", TargetSpeed)

type function

caller script

defined in EEP
EEPSetTrainSpeed("#Passenger train", 80)
parameters two

returns one

requires EEP 11.0

purpose Assigns new target speed to the specified train.

notes  First argument is the entire train name as a string.


 Second argument is the desired speed. Use negative values for opposite direction.
 A possible current signal influence is cancelled (i.e. a train currently stopped by a signal
will move!).
 Return value is true if the targeted train exists, else false.

EEPGetTrainSpeed() EEPGetTrainSpeed("#Name")

type function

caller script

defined in EEP
hResult, hData = EEPGetTrainSpeed("#VT98;001")
parameters one

returns two

requires EEP 11.0

purpose Enquires the current speed of the specified train.

notes  Argument is the complete train name as a string.


 First return value is true if the targeted train exists, else false.
 Second return value is the train’s current speed.

page 10
Reference Guide to EEP functions

EEPSetTrainRoute() EEPSetTrainRoute("#Name", "Route")

type function

caller script

defined in EEP
EEPSetTrainRoute("#Passenger train", "Route")
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Assigns a route to the specified train.

notes  First argument is the entire train name as a string.


 Second argument is the desired Route as a string.
 Return value is true if the specified route and train exist, false if either one doesn’t exist.

EEPGetTrainRoute() EEPGetTrainRoute("#Name")

type function

caller script

defined in EEP
hResult, hData = EEPGetTrainRoute("#Personenzug")
parameters one

returns two

requires EEP 11.2 Plugin 2

purpose Enquires the current route of the specified train.

notes  Argument is the entire train name as a string.


 First return value is true if the targeted train exists, else false.
 Second return value is the train’s current route as a string..

page 11
Reference Guide to EEP functions

EEPSetTrainLight() EEPSetTrainLight("#Name", true|false)

type function

caller script

defined in EEP
EEPSetTrainLight("#Passenger train", true)
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Turns the lights of the specified train on or off.

notes  First argument is the entire train name as a string.


 Second argument is either true (i.e. lights on) or false (i.e. lights off).
 Return value is true if the targeted train exists, else false.

EEPSetTrainSmoke() EEPSetTrainSmoke("#Name", true|false)

type function

caller script

defined in EEP
EEPSetTrainSmoke("#Passenger train", true)
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Turns the smoke and steam of the specified train on or off.

notes  First argument is the entire train name as a string.


 Second argument is either true (i.e. smoke on) or false (i.e. smoke off).
 Return value is true if the targeted train exists, else false.

EEPSetTrainHorn() EEPSetTrainHorn("#Name", true|false)

type function

caller script

defined in EEP
EEPSetTrainHorn("#Passenger train", true)
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Turns the warning sound of the specified train on or off.

notes  First argument is the entire train name as a string.


 Second argument is true to sound the horn, whistle etc. and false to mute it
 Return value is true if the targeted train exists, else false.

page 12
Reference Guide to EEP functions

EEPSetTrainCouplingFront() EEPSetTrainCouplingFront("#Name", true|false)

type function

caller script

defined in EEP
EEPSetTrainCouplingFront("#Freight train", true)
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Activates or deactivates the front coupler of a train consist.

notes  First argument is the entire train name as a string.


 Second argument is true (i.e. couple on contact) or false (i.e. don’t couple).
 Return value is true if the targeted train exists, else false.

EEPSetTrainCouplingRear() EEPSetTrainCouplingRear("#Name" , true|false)

type function

caller script

defined in EEP
EEPSetTrainCouplingRear("#Freight train", true)
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Activates or deactivates the rear coupler of a train consist.

notes  First argument is the entire train name as a string.


 Second argument is true (i.e. couple on contact) or false (i.e. don’t couple).
 Return value is true if the targeted train exists, else false.

EEPTrainLooseCoupling() EEPTrainLooseCoupling("#Name",true|false,Position)

type function

caller script

defined in EEP
EEPTrainLooseCoupling("#Freight train", true, 3)
parameters three

returns one

requires EEP 11.2 Plugin 2

purpose Separates a train consist after the specified number of vehicles.

notes  First argument is the entire train name as a string.


 Second argument defines if you count vehicles from the front or the rear
 Third argument defines the position at which the train is split.
 Return value is true if the targeted train and the specified position exist, else false.

page 13
Reference Guide to EEP functions

EEPSetTrainHook() EEPSetTrainHook("#Name", true|false)

type function

caller script

defined in EEP
EEPSetTrainHook("#Rail Crane", true)
parameters two

returns one

requires EEP 11.2 Plugin 2

purpose Activates or deactivates the hook of the specified train for lifting goods.

notes  First argument is the entire train name as a string.


 Second argument is true (i.e. hook) or false (i.e unhook).
 Return value is true if the targeted train exists, else false.

EEPSetTrainAxis() EEPSetTrainAxis("#Name", "Axis", Position)

type function

caller script

defined in EEP
EEPSetTrainAxis("#Rail Crane", "Drehung nach links”, 100)
parameters three

returns one

requires EEP 11.2 Plugin 2

purpose Animates the specified axis of the specified train.

notes  First argument is the entire train name as a string.


 Second argument is the name of the axis as a string.
 Third argument is the target position of the axis.
 Return value is true if the targeted train and the axis exist, else false.

page 14
Reference Guide to EEP functions

Rolling stock functions

EEPRollingstockSetCouplingFront() EEPRollingstockSetCouplingFront("Name", Coupler)

type function

caller script

defined in EEP
EEPRollingstockSetCouplingFront("Castor 1;001", 1)
parameters two

returns one

requires EEP 11.0

purpose Activates or deactivates the front coupler of the specified rolling stock.

notes  First argument is the entire name of the rolling stock as a string.
 Second argument is the desired condition of the front coupler.
1 = activate coupler (couples on contact when opposing coupler is also active)
2 = deactivate coupler
 Return value is true if the targeted rolling stock exists, else false.

EEPRollingstockGetCouplingFront() EEPRollingstockGetCouplingFront("Name")

type function

caller script

defined in EEP hResult, hData =


EEPRollingstockGetCouplingFront("Castor 1;001")
parameters two

returns one

requires EEP 11.0

purpose Enquires the current condition of the front coupler of the specified rolling stock.

notes  Argument is the entire name of the rolling stock as a string.


 First return value is true if the targeted rolling stock exists, else false.
 Second return value is the condition of the front coupler.
1 = active
2 = inactive
3 = coupled

page 15
Reference Guide to EEP functions

EEPRollingstockSetCouplingRear() EEPRollingstockSetCouplingRear("Name", Coupler)

type function

caller script

defined in EEP
EEPRollingstockSetCouplingRear("fals 175 Kalk", 1)
parameters two

returns one

requires EEP 11.0

purpose Activates or deactivates the rear coupler of the specified rolling stock.

notes  First argument is the entire name of the rolling stock as a string.
 Second argument is the desired condition of the rear coupler.
1 = activate coupler (couples on contact when opposing coupler is also active)
2 = deactivate coupler
 Return value is true if the targeted rolling stock exists, else false.

EEPRollingstockGetCouplingRear() EEPRollingstockGetCouplingRear("Name")

type function

caller script

defined in EEP Name = "fals 175 Kalk"


hResult, hData = EEPRollingstockGetCouplingRear(Name)
parameters two

returns one

requires EEP 11.0

purpose Enquires the current condition of the rear coupler of the specified rolling stock.

notes  Argument is the entire name of the rolling stock as a string.


 First return value is true if the targeted rolling stock exists, else false.
 Second return value is the condition of the rear coupler.
1 = active
2 = inactive
3 = coupled

page 16
Reference Guide to EEP functions

EEPRollingstockSetAxis() EEPRollingstockSetAxis("Name", "Axis", Position)

type function

caller script
Name = "Bekohlungskranbrücke 1"
defined in EEP Axis = "Drehung links"
parameters two EEPRollingstockSetAxis(Name, Axis, 50)
returns one

requires EEP 11.0

purpose Moves the specified axis of the specified rolling stock to the desired position.

notes  First argument is the entire name of the rolling stock as a string.
 Second argument is the entire name of the axis as a string.
 Third argument is the target position for the axis.
 Return value is true if the targeted rolling stock and axis exist, else false.

EEPRollingstockGetAxis() EEPRollingstockGetAxis("Name", "Axis")

type function

caller script
Name = "Bekohlungskranbrücke 1"
defined in EEP Axis = "Drehung links"
parameters two hResult, hData = EEPRollingstockGetAxis(Name, Axis)
returns one

requires EEP 11.0

purpose Enquires the current position of the specified axis of the specified rolling stock.

notes  First argument is the entire name of the rolling stock as a string.
 Second argument is the entire name of the axis as a string.
 First return value is true if the targeted rolling stock and axis exist, else false.
 Second return value is the current position.

page 17
Reference Guide to EEP functions

EEPRollingstockSetSlot() EEPRollingstockSetSlot("Name", Slot)

type function

caller script

defined in EEP
EEPRollingstockSetSlot("Ladekran2 Greifer", 1)
parameters two

returns one

requires EEP 11.0

purpose Moves all axiis of the specified rolling stock to the position saved in a slot.

notes  First set all axiis to the wanted position and store this condition in one of 16 slots (context
menu). Now you can use this Lua function to trigger an animation from the current setting
of all axiis to the stored position.
 First argument is the entire name of the rolling stock as a string.
 Second argument is the number of the slot in which the wanted position was stored.
 Return value is true if the targeted rolling stock and the slot exist, else false.
It is not verified that slot actually contains any settings.

page 18
Reference Guide to EEP functions

Structure functions

EEPStructureSetSmoke() EEPStructureSetSmoke("Lua-Name", true|false)

type function

caller script

defined in EEP
EEPStructureSetSmoke("#1_Lauscha_train station", true)
parameters two

returns one

requires EEP 11.1 Plugin 1

purpose Turns the smoke (e.g. chimney smoke) of a structure on or off.

notes  First argument is the Lua name of the structure as string. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is true to turn the smoke on or false to turn it off.
 Return value is true if the targeted structure exists and has a smoke feature, else false.

EEPStructureGetSmoke() EEPStructureGetSmoke("Lua-Name")

type function

caller script

defined in EEP Name = " #1_Lauscha_train station"

parameters one hResult, hData = EEPStructureGetSmoke(Name)

returns two

requires EEP 11.1 Plugin 1

purpose Enquires if the smoke (e.g. chimney smoke) of a structure is currently turned on or off.

notes  Argument is the Lua name of the structure as string. The significant differences are the
preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 First return value is true if the targeted structure exists and has a smoke feature, else
false.
 Second return value is true if the smoke is turned on and false if it is off.

page 19
Reference Guide to EEP functions

EEPStructureSetLight() EEPStructureSetLight("Lua-Name", true|false)

type function

caller script

defined in EEP
EEPStructureSetLight("#1_Betriebsdienstgebaeude", true)
parameters two

returns one

requires EEP 11.1 Plugin 1

purpose Turns the lights of a structure on or off.

notes  First argument is the Lua name of the structure as string. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is true to turn the lights on or false to turn them off.
 Return value is true if the targeted structure exists and has a smoke feature, else false.

EEPStructureGetLight() EEPStructureGetLight("Lua-Name")

type function

caller script

defined in EEP meinName = "#1_Betriebsdienstgebaeude"

parameters one hResult, hData = EEPStructureGetLight(meinName)

returns two

requires EEP 11.1 Plugin 1

purpose Enquires if the lights of a structure are currently turned on or off.

notes  Argument is the Lua name of the structure as string. The significant differences are the
preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 First return value is true if the targeted structure exists and has a light feature, else false.
 Second return value is true if the lights are turned on and false if they are off or in
automatic mode.

page 20
Reference Guide to EEP functions

EEPStructureSetFire() EEPStructureSetFire("Lua-Name", true|false)

type function

caller script

defined in EEP
EEPStructureSetFire("#1_Brandhaus_01_SB1", true)
parameters two

returns one

requires EEP 11.1 Plugin 1

purpose Turns the fire feature of a structure on or off.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is true to activate the fire or false to deactivate it.
 Return value is true if the targeted structure exists and has a fire feature, else false.

EEPStructureGetFire() EEPStructureGetFire("Lua-Name")

type function

caller script

defined in EEP Name = "#1_Brandhaus_01_SB1"

parameters one hResult, hData = EEPStructureGetFire(Name)

returns two

requires EEP 11.1 Plugin 1

purpose Enquires if the smoke (e.g. chimney smoke) of a structure is currently turned on or off.

notes  Argument is the Lua name of the structure as a string. The significant differences are the
preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 First return value is true if the targeted structure exists and has a fire feature, else false.
 Second return value is true if the fire is turned on and false if it is off.

page 21
Reference Guide to EEP functions

EEPStructureAnimateAxis() EEPStructureAnimateAxis("Lua-Name", "Axis", Position)

type function

caller script

defined in EEP
EEPStructureAnimateAxis("#1_Windmühle", "Muehlrad", 1000)
parameters three

returns one

requires EEP 11.1 Plugin 1

purpose Moves the specified axis of the specified structure or track-side object.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is the entire name of the axis as a string.
 The third argument is the (positive or negative) number of steps the axis shall move. A
value of 1000 bzw. -1000 starts an endless motion if the model was built for it (e.g. sails
of a windmill). A value of 0 stops any motion.
 Return value is true if the targeted structure and the targeted axis exist, else false.

EEPStructureSetAxis() EEPStructureSetAxis("Lua-Name", "Axis", Position)

type function

caller script

defined in EEP
EEPStructureSetAxis("#1_Drehscheibe", "Brücke", 50)
parameters three

returns one

requires EEP 11.1 Plugin 1

purpose Sets the specified axis of the specified structure or track-side object to a new position.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is the entire name of the axis as a string.
 Third argument is the new position of the specified axis.
 Return value is true if the targeted structure and the targeted axis exist, else false.

page 22
Reference Guide to EEP functions

EEPStructureGetAxis() EEPStructureGetAxis("Lua-Name", "Axis")

type function

caller script

defined in EEP hResult, hData =


EEPStructureGetAxis("#1_Drehscheibe", "Brücke")
parameters two

returns two

requires EEP 11.1 Plugin 1

purpose Enquires the position of the specified axis of the specified structure or track-side object.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is the entire name of the axis as a string.
 First return value is true if the targeted structure and the targeted axis exist, else false.
 Second return value is the current position of the specified axis.

page 23
Reference Guide to EEP functions

EEPStructureSetPosition() EEPStructureSetPosition("Lua-Name", PosX, PosY, PosZ)

type function

caller script

defined in EEP
EEPStructureSetPosition("#1_Strohballen", 1, 2, 3)
parameters four

returns one

requires EEP 11.1 Plugin 1

purpose Places the specified structure or track-side object at a new position.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is the new x position of the structure.
 Third argument is the new y position of the structure.
 Fourth argument is the new z position of the structure.
 Structures cannot be placed outside a layout’s boundaries.
 Return value is true if the targeted structure exists and the new position is within the
layout’s boundaries, else false.
 Function can also be used for landscape elements because both, structures and
landscape elements, share a common set of IDs.

EEPStructureSetRotation() EEPStructureSetRotation("Lua-Name", RotX, RotY, RotZ)

type function

caller script

defined in EEP
EEPStructureSetRotation("#1_Strohballen", 0, 0, 25)
parameters four

returns one

requires EEP 11.1 Plugin 1

purpose Rotates the specified structure or track-side object to a new position.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is the new x rotation of the structure.
 Third argument is the new y rotation of the structure.
 Fourth argument is the new z rotation of the structure.
 Return value is true if the targeted structure exists, else false.
 Function can also be used for landscape elements because both, structures and
landscape elements, share a common set of IDs.

page 24
Reference Guide to EEP functions

Track functions
Rail tracks

EEPRegisterRailTrack() EEPRegisterRailTrack(ID)

type function

caller script

defined in EEP
EEPRegisterRailTrack(1)
parameters one

returns one

requires EEP 11.3 Plugin 3

purpose Registers a rail track element for “occupied” enquiries

notes  Argument is the ID of the rail track element.


 Return value is true, if the targeted track exists, else false
 Registration is mandatory for EEPIsRailTrackReserved() function.

EEPIsRailTrackReserved() EEPIsRailTrackReserved(ID)

type function

caller script

defined in EEP
hResult, hData = EEPIsRailTrackReserved(1)
parameters one

returns two

requires EEP 11.3 Plugin 3

purpose Enquires if the specified rail track element is occupied by any rolling stock.

notes  Argument is the ID of the rail track element.


 First return value is true, if the targeted track element exists and has been registered
prior to the enquiry.
 Second return value is true, if the track element is occupied, else false.
 Remember to register track before using this function!

page 25
Reference Guide to EEP functions

Roads

EEPRegisterRoadTrack() EEPRegisterRoadTrack(ID)

type function

caller script

defined in EEP
EEPRegisterRoadTrack(1)
parameters one

returns one

requires EEP 11.3 Plugin 3

purpose Registers a road element for “occupied” enquiries

notes  Argument is the ID of the road element.


 Return value is true, if the targeted track exists, else false
 Registration is mandatory for EEPIsRoadTrackReserved() function.

EEPIsRoadTrackReserved() EEPIsRoadTrackReserved(ID)

type function

caller script

defined in EEP
hResult, hData = EEPIsRoadTrackReserved(1)
parameters one

returns two

requires EEP 11.3 Plugin 3

purpose Enquires if the specified road element is occupied by any rolling stock.

notes  Argument is the ID of the road element.


 First return value is true, if the targeted track element exists and has been registered
prior to the enquiry.
 Second return value is true, if the track element is occupied, else false.
 Remember to register track before using this function!

page 26
Reference Guide to EEP functions

Tram tracks

EEPRegisterTramTrack() EEPRegisterTramTrack(ID)

type function

caller script

defined in EEP
EEPRegisterTramTrack(1)
parameters one

returns one

requires EEP 11.3 Plugin 3

purpose Registers a tram track element for “occupied” enquiries

notes  Argument is the ID of the tram track element.


 Return value is true, if the targeted track exists, else false
 Registration is mandatory for EEPIsTramTrackReserved() function.

EEPIsTramTrackReserved() EEPIsTramTrackReserved(ID)

type function

caller script

defined in EEP
hResult, hData = EEPIsTramTrackReserved(1)
parameters one

returns two

requires EEP 11.3 Plugin 3

purpose Enquires if the specified tram track element is occupied by any rolling stock.

notes  Argument is the ID of the tram track element.


 First return value is true, if the targeted track element exists and has been registered
prior to the enquiry.
 Second return value is true, if the track element is occupied, else false.
 Remember to register track before using this function!

page 27
Reference Guide to EEP functions

Auxiliary tracks (waterways, airways etc.)

EEPRegisterAuxiliaryTrack() EEPRegisterAuxiliaryTrack(ID)

type function

caller script

defined in EEP
EEPRegisterAuxiliaryTrack(1)
parameters one

returns one

requires EEP 11.3 Plugin 3

purpose Registers an auxiliary track element for “occupied” enquiries

notes  Argument is the ID of the auxiliary track element.


 Return value is true, if the targeted track exists, else false
 Registration is mandatory for EEPIsAuxiliaryTrackReserved() function.

EEPIsAuxiliaryTrackReserved() EEPIsAuxiliaryTrackReserved(ID)

type function

caller script

defined in EEP
hResult, hData = EEPIsAuxiliaryTrackReserved(1)
parameters one

returns two

requires EEP 11.3 Plugin 3

purpose Enquires if the specified auxiliary track element is occupied by any rolling stock.

notes  Argument is the ID of the auxiliary track element.


 First return value is true, if the targeted track element exists and has been registered
prior to the enquiry.
 Second return value is true, if the track element is occupied, else false.
 Remember to register track before using this function!

page 28
Reference Guide to EEP functions

Control tracks

EEPRegisterControlTrack() EEPRegisterControlTrack(ID)

type function

caller script

defined in EEP
EEPRegisterControlTrack(1)
parameters one

returns one

requires EEP 11.3 Plugin 3

purpose Registers a control track element for “occupied” enquiries

notes  Argument is the ID of the control track element.


 Return value is true, if the targeted track exists, else false
 Registration is mandatory for EEPIsControlTrackReserved() function.

EEPIsControlTrackReserved() EEPIsControlTrackReserved(ID)

type function

caller script

defined in EEP
hResult, hData = EEPIsControlTrackReserved(1)
parameters one

returns two

requires EEP 11.3 Plugin 3

purpose Enquires if the specified control track element is occupied by any rolling stock.

notes  Argument is the ID of the control track element.


 First return value is true, if the targeted track element exists and has been registered
prior to the enquiry.
 Second return value is true, if the track element is occupied, else false.
 Remember to register track before using this function!

page 29
Reference Guide to EEP functions

Camera functions

EEPSetCamera() EEPSetCamera(Type, "Name")

type function

caller script

defined in EEP
EEPSetCamera(0,"Station")
parameters two

returns one

requires EEP 11.3 Plugin 3

purpose Activates a stored camera position.

notes  First argument is the type of camera: 0=static, 1=dynamic, 2= mobile camera
 Second argument is the name of the camera as a string.
 Return value is true if the targeted camera exists, else false.

EEPSetPerspectiveCamera() EEPSetPerspectiveCamera(ID, "TrainName")

type function

caller script

defined in EEP
EEPSetPerspectiveCamera(1,"#Passenger train")
parameters two

returns one

requires EEP 11.3 Plugin 3

purpose Activates a camera connected to the specified train.

notes  First argument is the relative position of the camera and matches selection 1 to 9 on your
keyboard (i.e. 1 = straight left, 2 = straight right, …, 8 = cockpit camera etc.).
 Second argument is the train name as a string.
 Return value is true, if the targeted train and camera exist, else false.
 Calling this camera while it is already active turns off the follow mode.

page 30
Reference Guide to EEP functions

Layout functions

EEPLoadProject() EEPLoadProject("FileName")

type function

caller script

defined in EEP
EEPLoadProject("Tutorials\\Tutorial_54_LUA.anl3")
parameters two

returns one

requires EEP 11.3 Plugin 3

purpose Loads another layout from the specified subfolder of “Anlagen”.

notes  Argument is the path (if needed) inside the folder “Anlagen” and the file name including
the .anl3 suffix.
 Separating character between folder and file name is a double backslash.
 Return value is true if the required layout exists, else false.

page 31
Reference Guide to EEP functions

Virtual train depot functions

EEPGetTrainFromTrainyard() EEPGetTrainFromTrainyard(Depot, "TrainName", Num)

type function

caller script

defined in EEP
EEPGetTrainFromTrainyard(1,"#Rheingold",1)
parameters three

returns one

requires EEP 11.3 Plugin 2

purpose Sends a specified train from the specified virtual train depot.

notes  First argument is the ID of the train depot. You can find the ID in the header of the
depot’s properties window.
 Second argument is the entire train name as a string. If you enter an empty string as a
train name, the train is specified by the third argument.
 Third argument is the position in the depot list. The train name in the second argument
takes precedence over this number and must be an empty string for this number to take
effect. However, a number must always be given. Enter 0 if you use the train’s name.
 Return value is true if the targeted depot and train exist, regardless if the train is currently
in the depot and available or not! It is false if either the depot doesn’t exist or the
specified train is not listed in this depot.

page 32
Reference Guide to EEP functions

Tip text functions

EEPChangeInfoStructure() EEPChangeInfoStructure("Lua-Name", "Text")

type function

caller script

defined in EEP
EEPChangeInfoStructure("#1", "Hallo")
parameters two

returns one

requires EEP 13

purpose Assigns new text to the tip text of a structure.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is the new text. Use \n for line feeds.
 Return value is true if the targeted structure exists, else false.
 This function can also be used for landscape elements because both, structures and
landscape elements, share a common set of IDs.

EEPShowInfoStructure() EEPShowInfoStructure("Lua-Name", true|false)

type function

caller script

defined in EEP
EEPShowInfoStructure("#1", true)
parameters two

returns one

requires EEP 13

purpose Turns the tip text of the specified structure on or off.

notes  First argument is the Lua name of the structure as String. The significant differences are
the preceding hash sign and ID. These are sufficient as a Lua name and everything that
follows may be omitted.
 Second argument is true for turning the tip text on and false for turning it off.
 Return value is true if the targeted structure exists, else false.
 This function can also be used for landscape elements because both, structures and
landscape elements, share a common set of IDs.

page 33
Reference Guide to EEP functions

EEPChangeInfoSignal() EEPChangeInfoSignal(ID, "Text")

type function

caller script

defined in EEP
EEPChangeInfoSignal(1, "Hallo")
parameters two

returns one

requires EEP 13

purpose Assigns new text to the tip text of a signal.

notes  First argument is the ID of the signal.


 Second argument is the new text. Use \n for line feeds.
 Return value is true if the targeted signal exists, else false.

EEPShowInfoSignal() EEPShowInfoSignal(ID, true|false)

type function

caller script

defined in EEP
EEPShowInfoSignal(1, true)
parameters two

returns one

requires EEP 13

purpose Turns the tip text of the specified signal on or off.

notes  First argument is the ID of the signal.


 Second argument is true for turning the tip text on and false for turning it off.
 Return value is true if the targeted signal exists, else false.

page 34
Reference Guide to EEP functions

EEPChangeInfoSwitch() EEPChangeInfoSwitch(ID, "Text")

type function

caller script

defined in EEP
EEPChangeInfoSwitch(1, "Hallo")
parameters two

returns one

requires EEP 13

purpose Assigns new text to the tip text of a switch.

notes  First argument is the ID of the switch.


 Second argument is the new text. Use \n for line feeds.
 Return value is true if the targeted switch exists, else false.

EEPShowInfoSwitch() EEPShowInfoSwitch(ID, true|false)

type function

caller script

defined in EEP
EEPShowInfoSwitch(1, true)
parameters two

returns one

requires EEP 13

purpose Turns the tip text of the specified switch on or off.

notes  First argument is the ID of the switch.


 Second argument is true for turning the tip text on and false for turning it off.
 Return value is true if the targeted switch exists, else false.

page 35

You might also like