Who need help with menu simulations you need -
To record it:
1. Make location with your factory or what you want
2. Save as game (Not scenario!) and find it in folder "saves"
3. Make in folder of your mode new folder. Rename it in menu-simulations
4. Make in menu-simulations folder menu-simulations.lua
5. Move your saved game in menu-simulations folder
Now coding:
1. Use example of this code (You can read comments it will help you):
Code: Select all
local menu_simulations = {}
menu_simulations["Yoursimulation"] = -- Simulation name
{
checkboard = false,
save = "__Yourmodname__/menu-simulations/Simulation.zip", -- Path of your simulation
length = 60 * 20, -- How much it will be recording (60 * 20 = 20 seconds)
init =
[[
game.simulation.camera_position = {-89, -28} -- Position of camera
game.simulation.camera_zoom = 1 -- Zoom of camera
game.tick_paused = false
game.surfaces.nauvis.daytime = 0
]],
update =
[[
local dx = 0
local dy = 0
if game.tick % 3000 < 1000 then
dx = 0.01
elseif game.tick % 3000 < 2000 then
dx = -0.01
end
if (game.tick + 1500) % 3000 < 1000 then
dy = 0.01
elseif (game.tick + 1500) % 3000 < 2000 then
dy = -0.01
end
game.simulation.camera_position = {game.simulation.camera_position.x + dx*0, game.simulation.camera_position.y + dy*0}
]]
}
How to make correct position of camera:
1. Press F4
2. Press on button "show detailed info"
3. Close F4 mode
4. Move your mouse to right position
5. Photo your position of mouse (Example x = -12, y = 20)
6. In menu-simulation.lua in camera position write "x" and "y"
Code: Select all
game.simulation.camera_position = {-12, 20}
Now make data-final-fixes.lua:
1. Make it in folder of your mode
2. Use this example:
Code: Select all
local menu_simulations = require("__Yourmodename__/menu-simulations/menu-simulations")
data.raw["utility-constants"]["default"].main_menu_simulations = {
your_simulation_name = menu_simulations["Yoursimulation"]
}
Test it!
