Hello fellow Factorio fans,
Two questions regarding the Scenario Editor:
1. How do I Set a tech as "researched" in the Editor.
2. How do I modify the availible techs for a scenario in the Editor.
I hope I posted this in the right spot.
thanks in advance!
Set tech status in Editor
Re: Set tech status in Editor
As far as I know this is not possible with the editor, you'd need to add a control.lua file like the devs did in the campaigns
quick example code taken from data\base\campaigns\beta\level-01\control.luaI'd give a bit more info but I've got to go in just a second sorry, if you need more information I'm sure someone else will be able to help
quick example code taken from data\base\campaigns\beta\level-01\control.lua
Code: Select all
game.oninit(function() -- when the game is started
game.player.force.disableallprototypes() -- disable all of the tech and recipes, etc.
local recipelist = game.player.force.recipes -- set a variable to save some typing :)
recipelist["iron-plate"].enabled = true -- enable iron-plate recipe, this is the name in the prototypes
local technologies = game.player.force.technologies -- see above, but this time for technologies
technologies["steel-processing"].enabled = true
end)
Re: Set tech status in Editor
Hm, not sure if you found this helpful, I should also mention that you can make a technology researched by usingIf you want more specific information then let me know
Code: Select all
local technologies = game.player.force.technologies -- variable to save typing
technologies["name-of-tech-in-prototype-file"].researched = true
Re: Set tech status in Editor
oh, it helps as now I don't have to press randoms keys in the editor
Ha, It worked, this was easier than I had thought, many thanks!
Is it always necessary to deactivate all Techs/recipes, or is it just far more convenient when doing "lowtech" games? I made a quick run with
and it worked out sofar.
Ha, It worked, this was easier than I had thought, many thanks!
Is it always necessary to deactivate all Techs/recipes, or is it just far more convenient when doing "lowtech" games? I made a quick run with
Code: Select all
local recipelist = game.player.force.recipes
recipelist["repair-pack"].enabled = false
Re: Set tech status in Editor
There is no need to disable the techs and recipes if that's not what you want to do, it just makes it easier to restrict what the player can do (and makes sure players can't cheat their way through with mods.)