Structure Functions

Aus EEP Handbuch
Version vom 8. September 2018, 09:41 Uhr von Marc Horstmann (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche
EEPStructureSetSmoke() EEPStructureSetSmoke("Lua-Name",true|false)
type: function
    EEPStructureSetSmoke("#1_Lauscha_trainstation", true)
                
caller: script
defined in: EEP
parameters: two
returns: one
requires: EEP 11.1 Plug-in 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
    Name = "#1_Lauscha_train station"

    hResult, hData = EEPStructureGetSmoke(Name)
                
caller: script
defined in: EEP
parameters: one
returns: two
requires: EEP 11.1 Plug-in 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.


EEPStructureSetLight() EEPStructureSetLight("Lua-Name",true|false)
type: function
    EEPStructureSetLight("#B52_LoveShack", true)
                
caller: script
defined in: EEP
parameters: two
returns: one
requires: EEP 11.1 Plug-in 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 light feature, else false.


EEPStructureGetLight() EEPStructureGetLight("Lua-Name")
type: function
    myName = "#B52_LoveShack"

    hResult, hData = EEPStructureGetLight(myName)
                
caller: script
defined in: EEP
parameters: one
returns: two
requires: EEP 11.1 Plug-in 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.


EEPStructureSetFire() EEPStructureSetFire("Lua-Name",true|false)
type: function
    EEPStructureSetFire("#1_Brandhaus_01_SB1", true)
                
caller: script
defined in: EEP
parameters: two
returns: one
requires: EEP 11.1 Plug-in 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
    Name = "#1_Brandhaus_01_SB1"

    hResult, hData = EEPStructureGetFire(Name)
                
caller: script
defined in: EEP
parameters: one
returns: two
requires: EEP 11.1 Plug-in 1
purpose: Enquires if the fire feature 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 fire feature, else false.
  • Second return value is true if the fire is turned on and false if it is off.


EEPStructureAnimateAxis() EEPStructureAnimateAxis("Lua-Name","Axis",Position)
type: function
    EEPStructureAnimateAxis("#1_Windmill","Rotor", 1000)
                
caller: script
defined in: EEP
parameters: three
returns: one
requires: EEP 11.1 Plug-in 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.


EEPStructureIsAxisAnimate() EEPStructureIsAxisAnimate("Lua_Name","Achse")
type: function
    hResult, Status = EEPStructureIsAxisAnimate("#1","Bridge") 
    if Status > 0 then 
        print( "The turntable is moving." )
    end
                
caller: script
defined in: EEP
parameters: two
returns: two
requires: EEP 14.2 Plug-In 2
purpose:
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:
    • 0 = the axis is not moving.
    • 1 = the axis is moving in an infinite loop.
    • 2 = the axis is moving but will come to rest in finite time.


EEPStructureSetAxis() EEPStructureSetAxis("Lua-Name","Axis",Position)
type: function
    EEPStructureSetAxis("#1_Turntable", "Bridge", 50)
                
caller: script
defined in: EEP
parameters: three
returns: one
requires: EEP 11.1 Plug-in 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.


EEPStructureGetAxis() EEPStructureGetAxis("Lua-Name","Axis")
type: function
    hResult, hData = EEPStructureGetAxis("#1_Turntable","Bridge")
                
caller: script
defined in: EEP
parameters: two
returns: two
requires: EEP 11.1 Plug-in 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.


EEPStructureSetPosition() EEPStructureSetPosition("Lua-Name",PosX,PosY,PosZ)
type: function
    EEPStructureSetPosition("#1_Strawball", 1, 2, 3)
                
caller: script
defined in: EEP
parameters: four
returns: one
requires: EEP 11.1 Plug-in 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.


EEPStructureGetPosition() EEPStructureGetPosition("Lua_Name")
type: function
    hResult, Pos_X, Pos_Y, Pos_Z = EEPStructureGetPosition("#1") 
                
caller: script
defined in: EEP
parameters: one
returns: four
requires: EEP 14.2 Plug-In 2
purpose: Enquires the position of a structure or a landscape element.
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.
  • First return value is true if the method was successfully executed; false otherwise.
  • Second return value is the x position of the structure.
  • Third return value is the y position of the structure.
  • Fourth return value is the z position of the structure.


EEPStructureSetRotation() EEPStructureSetRotation("Lua-Name",RotX,RotY,RotZ)
type: function
    EEPStructureSetRotation("#1_Strawball", 0, 0, 25)
                
caller: script
defined in: EEP
parameters: four
returns: one
requires: EEP 11.1 Plug-in 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.


EEPStructureGetModelType() EEPStructureGetModelType("Lua_Name")
type: function
    hResult , Typ = EEPStructureGetModelType( "#1" )
                
caller: script
defined in: EEP
parameters: one
returns: two
requires: EEP14.2 Plug-In 2
purpose: Enquires the model type category of the structure.
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 method was successfully executed; false otherwise.
  • Second return value is the category the designer of the model assigned to it:
    • 16 = Tracks/Track objects
    • 17 = Tramtracks/Tramtrack objects
    • 18 = Streets/Street objects
    • 19 = Other/Other objects
    • 22 = Real estate
    • 23 = landscape elements/Fauna
    • 24 = landscape elements/Flora
    • 25 = landscape elements/Terra
    • 38 = landscape elements/Instancing