Search found 113 matches

by hgschmie
Thu Mar 20, 2025 3:33 am
Forum: Duplicates
Topic: [2.0.42] Landfill from a 1.1 save can not be removed
Replies: 1
Views: 83

[2.0.42] Landfill from a 1.1 save can not be removed

Contrary to the FFF where landfill is described as removable, when loading a 1.1 save and migrating it to 2.0, the landfill that was placed with the 1.1 version of the game can not be removed.

Screenshot 2025-03-19 at 20.31.49.png

(I marked all the landfill for deletion but only the landfill ...
by hgschmie
Sun Mar 16, 2025 5:55 am
Forum: Modding interface requests
Topic: [2.0.41] pre_entity_died event
Replies: 1
Views: 140

[2.0.41] pre_entity_died event

There are "pre" events for all "mining" ways in which an entity can be removed:

- on_pre_player_mined_item -> on_player_mined_entity
- on_robot_pre_mined -> on_robot_mined_entity
- on_space_platform_pre_mined -> on_space_platform_mined_entity

However, there is no pre-event for on_entity_died. So ...
by hgschmie
Fri Mar 14, 2025 4:04 pm
Forum: Not a bug
Topic: [2.0.41] Stuff three rockets in a silo with space age
Replies: 2
Views: 175

Re: [2.0.41] Stuff three rockets in a silo with space age

Works for me. It is more a curious corner case than anything else.
by hgschmie
Fri Mar 14, 2025 5:09 am
Forum: Not a bug
Topic: [2.0.41] Stuff three rockets in a silo with space age
Replies: 2
Views: 175

[2.0.41] Stuff three rockets in a silo with space age

- Create a new game without space age. Create a rocket silo. Start building rockets until both green bars are full (one rocket on the launch pad, one "in the silo").
- Save the game.
- Enable space age
- Load the game.

The silo still contains a rocket on the launch pad. But "in the silo" are now ...
by hgschmie
Thu Mar 06, 2025 5:58 am
Forum: Resolved Requests
Topic: AddRecordData rail_direction documentation issue
Replies: 2
Views: 185

Re: AddRecordData rail_direction documentation issue

Thanks for adding that explanation. I will update my code accordingly.
by hgschmie
Thu Mar 06, 2025 5:56 am
Forum: Resolved Problems and Bugs
Topic: [2.0.38] changing train schedule at current stop does not work
Replies: 4
Views: 270

Re: [2.0.38] changing train schedule at current stop does not work

I can reproduce the issue with 2.0.38 and confirm that it is gone in 2.0.39. So some change there made it go away.

The attached map, when loaded with 2.0.38, needs either the attached LTN 2.2.5 or 2.2.6 installed locally (sorry, can't download that from the portal).

2.2.5 uses the add_wait ...
by hgschmie
Thu Mar 06, 2025 2:18 am
Forum: Resolved Problems and Bugs
Topic: [2.0.38] changing train schedule at current stop does not work
Replies: 4
Views: 270

Re: [2.0.38] changing train schedule at current stop does not work

I want to say that this seems to be fixed with 2.0.39 but I am at an airport right now. Will verify when I get back home and post a save if needed.
by hgschmie
Wed Mar 05, 2025 6:00 am
Forum: Logistic Train Network
Topic: Upcoming changes for LTN 2.3.0 (not yet released!)
Replies: 0
Views: 303

Upcoming changes for LTN 2.3.0 (not yet released!)

Hi,

With the release of the LuaSchedule API in 2.0.36 (and its various iterations until currently 2.0.39), it is now possible to influence train schedules much more than with the limited 1.1 (and the previous 2.0 API).

I have put together a number of things for the 2.3.0 release of LTN that will ...
by hgschmie
Wed Mar 05, 2025 4:17 am
Forum: Resolved Problems and Bugs
Topic: [2.0.38] changing train schedule at current stop does not work
Replies: 4
Views: 270

Re: [2.0.38] changing train schedule at current stop does not work

I can not really make sense of this. I have trains with schedules that look like this:
Screenshot 2025-03-04 at 20.16.04.png
Screenshot 2025-03-04 at 20.16.04.png (60.49 KiB) Viewed 254 times
which got added with a single add_record call (to the end of the schedule) and here both the "time" and "inactivity" wait condition work just fine.
by hgschmie
Wed Mar 05, 2025 3:41 am
Forum: Resolved Problems and Bugs
Topic: [2.0.38] changing train schedule at current stop does not work
Replies: 4
Views: 270

[2.0.38] changing train schedule at current stop does not work

WIth 2.0.38:

Scenario:

Train sits at a station (just arrived)
Schedule was cleaned (all records removed)
Re-adding a new stop at index 1

This works:

train_schedule.add_record {
station = stop.entity.backer_name,
rail_direction = stop.entity.connected_rail_direction,
temporary = false ...
by hgschmie
Wed Mar 05, 2025 1:45 am
Forum: Resolved Requests
Topic: AddRecordData rail_direction documentation issue
Replies: 2
Views: 185

AddRecordData rail_direction documentation issue

AddRecordData uses "RailDirection?" as the attribute definition, this should probably be defines.rail_direction as e.g. https://lua-api.factorio.com/latest/cla ... _direction
by hgschmie
Fri Feb 28, 2025 4:13 pm
Forum: Resolved Problems and Bugs
Topic: [2.0.37] LuaSchedule::add_record adds temporary stops with a wait condition
Replies: 19
Views: 1167

Re: [2.0.37] LuaSchedule::add_record adds temporary stops with a wait condition

Understood. But now I have to call get_record_count if I added at the end unless I keep track of the schedule size.
by hgschmie
Fri Feb 28, 2025 2:43 pm
Forum: Resolved Problems and Bugs
Topic: [2.0.37] LuaSchedule::add_record adds temporary stops with a wait condition
Replies: 19
Views: 1167

Re: [2.0.37] LuaSchedule::add_record adds temporary stops with a wait condition

Thanks, this sounds great! Can you make it return the actual index where the record was inserted? It would make subsequent modifications of the created record easier.
by hgschmie
Fri Feb 28, 2025 3:35 am
Forum: Duplicates
Topic: [2.0.37] LuaSchedule::add_record adds temporary stops at the beginning of the schedule
Replies: 4
Views: 263

Re: [2.0.37] LuaSchedule::add_record adds temporary stops at the beginning of the schedule

It seems slightly more complicated. If the first stop is a temporary stop, then the new stop is put *behind* that temporary stop but *before* the first permanent stop:


> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
(nil ...
by hgschmie
Fri Feb 28, 2025 3:32 am
Forum: Resolved Problems and Bugs
Topic: [2.0.37] LuaSchedule::add_record adds temporary stops with a wait condition
Replies: 19
Views: 1167

[2.0.37] LuaSchedule::add_record adds temporary stops with a wait condition

Any temporary stop that is added with the add_record API looks like this:


> 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 { station = "test", temporary = true }
(nil)
> train_schedule.add ...
by hgschmie
Fri Feb 28, 2025 3:24 am
Forum: Duplicates
Topic: [2.0.37] LuaSchedule::add_record can not add permanent rail stops
Replies: 1
Views: 143

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

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

Adding a temporary rail stop:

> 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 ...
by hgschmie
Fri Feb 28, 2025 3:20 am
Forum: Duplicates
Topic: [2.0.37] LuaSchedule::add_record adds temporary stops at the beginning of the schedule
Replies: 4
Views: 263

[2.0.37] LuaSchedule::add_record adds temporary stops at the beginning of the schedule

( this is a debugging session with an actual train and schedule )

> 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 { station = 'zzz_first' }
> train_schedule.add_record { station = 'aaa ...
by hgschmie
Thu Feb 27, 2025 7:25 pm
Forum: Resolved Problems and Bugs
Topic: [2.0.37] LuaSchedule lacks rail direction
Replies: 1
Views: 402

[2.0.37] LuaSchedule lacks rail direction

The (old?) train schedule API allows setting the rail direction (see https://lua-api.factorio.com/latest/concepts/ScheduleRecord.html)

The new LuaSchedule API offers AddRecordData for adding a record: https://lua-api.factorio.com/latest/concepts/AddRecordData.html which does not contain the rail ...
by hgschmie
Thu Feb 27, 2025 7:12 am
Forum: Modding interface requests
Topic: LuaSchedule API
Replies: 2
Views: 216

LuaSchedule API

Thank you for adding this to Factorio!

A few comments:

- LuaSchedule::add_record should either return the index at which the record was inserted *or* have a parameter that allows defining where the record goes in the schedule. Currently I do

schedule.add_record { ... }
local index = schedule.get ...

Go to advanced search