How to wait for entry sequence to finish?

Place to get help with not working mods / modding interface.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

How to wait for entry sequence to finish?

Post 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?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: How to wait for entry sequence to finish?

Post by DaveMcW »

https://lua-api.factorio.com/latest/eve ... _cancelled

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

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to wait for entry sequence to finish?

Post by mrvn »

thanks,

Post Reply

Return to “Modding help”