Page 1 of 1

How to wait for entry sequence to finish?

Posted: Sun Sep 26, 2021 4:22 am
by mrvn
At the start of the game I create a compilatron in on_player_created:

Code: Select all

      bot = surface.create_entity{
         name="compilatron",
         position=player.position,
         force=player.force,
         player=player,
         raise_built=false,
         create_build_effect_smoke=true,
         move_stuck_players=true,
         --item=
      }
Compilatron appears and then the game scrolls to the side to show the crashed spaceship. Compilatron is then nowhere near the player.

What I want to happen is for compilatron to appear next to the crashed spaceship or emerge from it after the explosion sequence is done and the player has started the game by pressing "tab". Ideas?

Re: How to wait for entry sequence to finish?

Posted: Sun Sep 26, 2021 4:26 am
by DaveMcW
https://lua-api.factorio.com/latest/eve ... _cancelled

See data/base/scenarios/freeplay.lua for an example.

Re: How to wait for entry sequence to finish?

Posted: Mon Sep 27, 2021 10:03 am
by mrvn
thanks,