Code: Select all
global.waypoints = {}
function compilatron()
local s = game.surfaces[1]
local non_colliding = s.find_non_colliding_position("compilatron", {0,0}, 10, 1)
local compilatron = s.create_entity{name = "compilatron", position=non_colliding, force="player"}
global.waypoints[#global.waypoints+1] = {target = compilatron ,transition_time = 500,time_to_wait = 100}
end
Code: Select all
function cutscene(player_index)
game.players[player_index].set_controller{
type = defines.controllers.cutscene,
waypoints = global.waypoints,
final_transition_time = 300}
end
Code: Select all
function character()
global.waypoints[#global.waypoints+1] = {target = game.players[player_index].character ,transition_time = 500,time_to_wait = 100}
end
Code: Select all
function player()
local s = game.surfaces[1]
local non_colliding = s.find_non_colliding_position("player", {0,0}, 10, 1)
local player = s.create_entity{name = "player", position=non_colliding, force="player"}
global.waypoints[#global.waypoints+1] = {target = player ,transition_time = 500,time_to_wait = 100}
end
Code: Select all
s.set_multi_command{
command = {
type=defines.command.attack,
target=game.players[1].character,
distraction=defines.distraction.by_enemy},
unit_count = 1,
unit_search_distance = 2000}