Vehicle Wagon 2


Take with you a fully charged and battle-ready vehicle and take it on a rail trip. --------------------------------------------------------------------------------- Возьмите с собой полностью заряженный и готовый к бою транспорт и отправьте его в путешествие по железной дороге.

Content
4 days ago
0.17 - 2.0
21.2K
Transportation Trains Combat

b Incorrect parameter passed to script.raise_event

5 years ago

I got a crash in the Disco Science mod when unloading a wagon, and tracked down the cause to one line of code in Vehicle Wagon.

The Factorio API is inconsistent in how it names parameters of the events "on_built" and "script_raised_built". "on_built" stores the created entity in "event.created_entity", while "script_raised_built" stores the created entity in "event.entity".

Control.lua line 224:
script.raise_event(defines.events.script_raised_built, {created_entity = vehicle, player_index = player_index})

Should instead be:
script.raise_event(defines.events.script_raised_built, {entity = vehicle, player_index = player_index})

5 years ago

Hey. Thank you for reporting this error and immediately providing a solution for fixing it, since I cannot, at this time, address the problems myself.

I released an update that uses the solution you provided, please check the performance.

New response