Page 1 of 1

[0.17.66] /cheat doesn't research technologies in order with respect to pre-requisites.

Posted: Tue Aug 20, 2019 10:16 am
by PyroFire
/cheat doesn't research technologies in order with respect to pre-requisites.

I know this because my mod is throwing an error when /cheat is used, but not when researching normally.
/c game.player.force.research_progress= 1

Re: [0.17.66] /cheat doesn't research technologies in order with respect to pre-requisites.

Posted: Tue Aug 20, 2019 11:40 am
by Klonan
PyroFire wrote: Tue Aug 20, 2019 10:16 am I know this because my mod is throwing an error when /cheat is used
Can you attach the mod

What error is it throwing?
Can you attach a log file?

Re: [0.17.66] /cheat doesn't research technologies in order with respect to pre-requisites.

Posted: Tue Aug 20, 2019 1:47 pm
by PyroFire
https://mods.factorio.com/mod/warptorio2

Base mod only 0.7.7

The offending research:
warptorio-teleporter-portal being script.raise_event'd before warptorio-teleporter-1.

The -1 etc research accesses a variable in the global table that is created by -portal.
It is throwing an error because this hasn't happened yet, despite pre-requisites.

Proof:
Image

Image

Re: [0.17.66] /cheat doesn't research technologies in order with respect to pre-requisites.

Posted: Tue Aug 20, 2019 2:13 pm
by Rseding91
Thanks for the report however that's not a bug. Technologies can be researched in what ever order anyone wants them to be by just setting ".researched = true" on any of them at any time using the Lua API. You'll need to fix your mod to account for that.