[2.0.37] LuaSchedule::add_record can not add permanent rail stops

Things that has been reported already before.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 113
Joined: Tue Feb 06, 2024 5:18 am
Contact:

[2.0.37] LuaSchedule::add_record can not add permanent rail stops

Post by hgschmie »

(not sure if this is a bug or an API limitation)

Adding a temporary rail stop:

Code: Select all

> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
(nil)
> train_schedule.add_record { rail = rail, temporary = true }
(nil)
> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
{allows_unloading = true, created_by_interrupt = false, rail = "[LuaEntity: legacy-straight-rail at [gps=227.0,-1.0]]", temporary = true, wait_conditions = {{compare_type = "and", ticks = 300, type = "time"}}}
(nil)
Doing the same thing for a permanent stop:

Code: Select all

> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
(nil)
> train_schedule.add_record { rail = rail }
(nil)
> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
{allows_unloading = true, created_by_interrupt = false, station = "", temporary = false, wait_conditions = {}}
(nil)
The created record will not work (there is no stop called ""). This should either error out, or not add a record.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15224
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.37] LuaSchedule::add_record can not add permanent rail stops

Post by Rseding91 »

See 127180 which will be able to do that. I have no idea what will break by doing that but we'll find out I guess :)
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Duplicates”