Newb question about character control
Posted: Fri May 07, 2021 12:42 pm
I am exploring creating a mod to control the character and possibly TAS / speedrun. I am aware of
https://github.com/gotyoke/Factorio-AnyPct-TAS
Which did this for version 0.18. I am looking through that mod to see how it works, and running into an issue
it has a section
script.on_event(defines.events.on_tick, function(event)
local p = game.players[1]
....
p.begin_crafting(...)
On my 1.1 copy, this fails with an error
Error while running event tas-speedrun::on_tick (ID 0)
No manual crafter.
After reading a bit, I believe that this is because it starts when the cutscene is running (see viewtopic.php?f=25&t=87938&p=507525 ), so the player is not necessarily a character. I looked to check the controller_type of the player but when I print it out, it's just nil
Can anyone point me to a simple mod that does something like this, or help me know what to check?
https://github.com/gotyoke/Factorio-AnyPct-TAS
Which did this for version 0.18. I am looking through that mod to see how it works, and running into an issue
it has a section
script.on_event(defines.events.on_tick, function(event)
local p = game.players[1]
....
p.begin_crafting(...)
On my 1.1 copy, this fails with an error
Error while running event tas-speedrun::on_tick (ID 0)
No manual crafter.
After reading a bit, I believe that this is because it starts when the cutscene is running (see viewtopic.php?f=25&t=87938&p=507525 ), so the player is not necessarily a character. I looked to check the controller_type of the player but when I print it out, it's just nil
Can anyone point me to a simple mod that does something like this, or help me know what to check?