I'm migrating old mods from 1.1 game version to 2.0.
As new feature TRT (Technology Research Trigger) was added I try to integrate it into mod.
The code can be seen in mod file: `apm_power_ldinc/prototypes/main/tech.lua`.
Steps (Example of actions can be found at `00_partial_works_no_exceptions.mkv`):
1) Starts Factorio with mods (attachments folder: mods).
2) Default game settings.
3) Default mod's settings.
4) Starts "New game"->"Freeplay"
5) Default map settings.
6) Click button "Start"
7) If game not crushes after generating new map:
7.1) Check technology tree (visual + debug mode F4)
7.2) Mine nearest stone ore to trigger technology "apm_crusher_machine_1"
7.3) If game not crushes after trigger, try research other "apm_crusher_machine_0" and "apm_crusher_machine_2" by crafting "iron-gear-wheel" and "apm_wood_board". (with cheat mode eneabled or without).
2. What happened?
Starting new freeplay game with mods on default settings lead to 3 results without obvious correlation between actions.
1) The game crushes on starting map, after successfully generation it. (logs/video `01_crash_on_new_map_startup`)
2) The new game starts fine. Starting mine trigger resource (stone ore) leads to crash. (logs/video `02_crash_on_mine_research_trigger`)
3) The new game starts fine. Starting mine trigger resource (stone ore) is fine. The technology has been researched successfully. But other two custom technologies with `craft-item` triggers not works.
3. What did I expect to happen instead?
Technology triggers works fine, similar to original technologies with research triggers instead research units ('steam-engine', 'electronics' and etc).
If stone ore mined, custom technology "apm_crusher_machine_1" researched.
If i've crafted "iron-gear-wheel" or "apm_wood_board" I expected to observe research progress bar on top right game corner.
And after crafting needed count og items - succsessfully research the technology in T-tree.
4. Does it happen always, once, or sometimes?
Randomly. I didn't notice special condition leads to stable reproduce crashes after mining ore.
But broken custom technologies with item-craft research triggers can be reproduce more than stable.
Notices:
The log file has targeting to `TechnologyTriggerProcessor::checkItems`
Code: Select all
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\Technology\TechnologyTrigger\TechnologyTriggerProcessor.cpp(98): TechnologyTriggerProcessor::checkItems
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\Force\ForceData.cpp(898): ForceData::update
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\Map\Map.cpp(1280): Map::updateEntities
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\Game.cpp(175): Game::update
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\Scenario\Scenario.cpp(1159): Scenario::updateStep
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\MainLoop.cpp(1400): MainLoop::gameUpdateStep
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\MainLoop.cpp(1209): MainLoop::gameUpdateLoop
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\functional(823): std::_Func_impl_no_alloc<`MainLoop::mainLoopStep'::`2'::<lambda_1>,void>::_Do_call
C:\Users\build\AppData\Local\Temp\factorio-build-4AGbzM\src\Util\WorkerThread.cpp(71): WorkerThread::loop
The videos can be found in folder `video`.
The logs can be found in folder `logs`.
Mods provided by folder `mods`.
description.txt - copy of this message.
The files can be found at Google Drive by URL: https://drive.google.com/drive/folders/ ... sp=sharing