The schedule of a particular LuaTrain or LuaSpacePlatform.
LuaTrain | LuaSpacePlatformunknowntrueThe owner of this schedule.
uint32unknownfalseuint32unknownfalseThe schedule index of the current destination.
MapTickunknownfalseMapTickMapTickfalseThe time when the train or space platform was last considered active for the inactivity condition.
Note: when writing, value must not be larger than LuaGameScript::tick
MapTickunknownfalseHow long this train or space platform has been in the current station.
stringstringtrueThe group this schedule is part of, if any.
booleanunknownfalseIs this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
stringunknownfalseThe class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
LuaSchedule.add_wait_condition(record_position: ScheduleRecordPosition, condition_index: uint32, type: WaitConditionType)
schedule.add_wait_condition(record_position, condition_index, type)
takes_table: falsetable_optional: falseAdds the given wait condition to the given record.
record_position: ScheduleRecordPositioncondition_index: uint32type: WaitConditionTypeLuaSchedule.remove_wait_condition(record_position: ScheduleRecordPosition, condition_index: uint32)
schedule.remove_wait_condition(record_position, condition_index)
takes_table: falsetable_optional: falseRemoves the given wait condition from the given record.
record_position: ScheduleRecordPositioncondition_index: uint32LuaSchedule.set_wait_condition_mode(record_position: ScheduleRecordPosition, condition_index: uint32, mode: string)
schedule.set_wait_condition_mode(record_position, condition_index, mode)
takes_table: falsetable_optional: falseSets the comparison on the given wait condition.
record_position: ScheduleRecordPositioncondition_index: uint32mode: string — "and", or "or"LuaSchedule.change_wait_condition(record_position: ScheduleRecordPosition, condition_index: uint32, wait_condition: WaitCondition)
schedule.change_wait_condition(record_position, condition_index, wait_condition)
takes_table: falsetable_optional: falseChanges the wait condition on the given record to the new values.
record_position: ScheduleRecordPositioncondition_index: uint32wait_condition: WaitConditionLuaSchedule.add_record(data: AddRecordData) -> uint32?
schedule.add_record(data)
takes_table: falsetable_optional: falseAdds the given record to the end of the current schedule or at the given index using the provided data.
data: AddRecordDatauint32? — The index the record was added at.LuaSchedule.remove_record(record_position: ScheduleRecordPosition)
schedule.remove_record(record_position)
takes_table: falsetable_optional: falseRemoves the record at the given record position, if the record position is valid.
record_position: ScheduleRecordPositionLuaSchedule.copy_record(source_schedule: LuaSchedule, source_index: uint32, destination_index: uint32)
schedule.copy_record(source_schedule, source_index, destination_index)
takes_table: falsetable_optional: falseCopies the record from the given schedule at the given index into this schedule at the given index.
source_schedule: LuaSchedulesource_index: uint32destination_index: uint32LuaSchedule.add_interrupt(interrupt: ScheduleInterrupt)
schedule.add_interrupt(interrupt)
takes_table: falsetable_optional: falseAdds the given interrupt to the schedule if an interrupt with the given name does not already exist.
interrupt: ScheduleInterruptLuaSchedule.remove_interrupt(index: uint32)
schedule.remove_interrupt(index)
takes_table: falsetable_optional: falseRemoves the interrupt at the given index, if the index is valid.
index: uint32LuaSchedule.activate_interrupt(index: uint32)
schedule.activate_interrupt(index)
takes_table: falsetable_optional: falseActivates the interrupt at the given index, if the index is valid.
index: uint32LuaSchedule.change_interrupt(index: uint32, interrupt: ScheduleInterrupt)
schedule.change_interrupt(index, interrupt)
takes_table: falsetable_optional: falseChanges the interrupt at the given index to the provided values. Note, the names must match.
index: uint32interrupt: ScheduleInterruptLuaSchedule.rename_interrupt(old_name: string, new_name: string)
schedule.rename_interrupt(old_name, new_name)
takes_table: falsetable_optional: falseold_name: string — The interrupt to renamenew_name: string — The new name - if it already exists, does nothing.LuaSchedule.go_to_station(schedule_index: uint32)
schedule.go_to_station(schedule_index)
takes_table: falsetable_optional: falseSets the train or space platform to go to a destination, including changing the train/space platform to automatic mode.
schedule_index: uint32 — The schedule indexLuaSchedule.set_stopped(stopped: boolean)
schedule.set_stopped(true)
takes_table: falsetable_optional: falseSets whether this train is in manual mode or this space platform is paused.
stopped: booleanLuaSchedule.set_allow_unloading(record_position: ScheduleRecordPosition, allow: boolean)
schedule.set_allow_unloading(record_position, true)
takes_table: falsetable_optional: falseSets if unloading is allowed at the given schedule record position. Only relevant for space platforms.
record_position: ScheduleRecordPositionallow: booleanLuaSchedule.drag_record(from: uint32, to: uint32, interrupt_index?: uint32)
schedule.drag_record(from, to, interrupt_index)
takes_table: falsetable_optional: falsefrom: uint32to: uint32interrupt_index?: uint32 — The interrupt to operate on, if any.LuaSchedule.drag_interrupt(from: uint32, to: uint32)
schedule.drag_interrupt(from, to)
takes_table: falsetable_optional: falsefrom: uint32to: uint32LuaSchedule.drag_wait_condition(record_position: ScheduleRecordPosition, from: uint32, to: uint32)
schedule.drag_wait_condition(record_position, from, to)
takes_table: falsetable_optional: falserecord_position: ScheduleRecordPosition — The record to change.from: uint32to: uint32LuaSchedule.get_record(record_position: ScheduleRecordPosition) -> ScheduleRecord?
schedule.get_record(record_position)
takes_table: falsetable_optional: falserecord_position: ScheduleRecordPositionScheduleRecord?LuaSchedule.get_records(interrupt_index?: uint32) -> Array<ScheduleRecord>?
schedule.get_records()
takes_table: falsetable_optional: falseinterrupt_index?: uint32 — If provided, gets the records for this interrupt.Array<ScheduleRecord>?LuaSchedule.set_records(records: Array<ScheduleRecord>, interrupt_index?: uint32)
schedule.set_records(records, interrupt_index)
takes_table: falsetable_optional: falserecords: Array<ScheduleRecord>interrupt_index?: uint32 — If provided, the records will be set on this interrupt.LuaSchedule.clear_records(interrupt_index?: uint32)
schedule.clear_records()
takes_table: falsetable_optional: falseinterrupt_index?: uint32 — If provided, clears the records for this interrupt.LuaSchedule.get_interrupt(index: uint32) -> ScheduleInterrupt?
schedule.get_interrupt(index)
takes_table: falsetable_optional: falseindex: uint32ScheduleInterrupt?LuaSchedule.get_interrupts() -> Array<ScheduleInterrupt>
schedule.get_interrupts()
takes_table: falsetable_optional: falseArray<ScheduleInterrupt>LuaSchedule.set_interrupts(interrupts: Array<ScheduleInterrupt>)
schedule.set_interrupts(interrupts)
takes_table: falsetable_optional: falseinterrupts: Array<ScheduleInterrupt>LuaSchedule.clear_interrupts()
schedule.clear_interrupts()
takes_table: falsetable_optional: falseRemoves all interrupts.
LuaSchedule.get_wait_condition(record_position: ScheduleRecordPosition, condition_index: uint32) -> WaitCondition?
schedule.get_wait_condition(record_position, condition_index)
takes_table: falsetable_optional: falseGets the wait condition at the given record position if one exists.
record_position: ScheduleRecordPositioncondition_index: uint32WaitCondition?LuaSchedule.get_wait_conditions(record_position: ScheduleRecordPosition) -> Array<WaitCondition>?
schedule.get_wait_conditions(record_position)
takes_table: falsetable_optional: falseGets the wait conditions at the given record position if they exist.
record_position: ScheduleRecordPositionArray<WaitCondition>?LuaSchedule.get_wait_condition_count(record_position: ScheduleRecordPosition) -> uint32?
schedule.get_wait_condition_count(record_position)
takes_table: falsetable_optional: falseThe number of wait conditions in the given schedule record.
record_position: ScheduleRecordPositionuint32?LuaSchedule.get_inside_interrupt(interrupt_index: uint32) -> boolean
schedule.get_inside_interrupt(interrupt_index)
takes_table: falsetable_optional: falseGets if the given interrupt can be triggered inside other interrupts.
interrupt_index: uint32booleanLuaSchedule.set_inside_interrupt(interrupt_index: uint32, value: boolean)
schedule.set_inside_interrupt(interrupt_index, true)
takes_table: falsetable_optional: falseSets if the given interrupt can be triggered inside other interrupts.
interrupt_index: uint32value: booleanLuaSchedule.get_record_count(interrupt_index?: uint32) -> uint32?
schedule.get_record_count()
takes_table: falsetable_optional: falseIf the given index is invalid, nil is returned.
interrupt_index?: uint32 — If provided, the record count in this interrupt is read.uint32?