Set tech status in Editor

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Ca_Putt
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 31, 2014 9:44 am
Contact:

Set tech status in Editor

Post by Ca_Putt »

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!

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Set tech status in Editor

Post by FreeER »

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.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)
I'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 :)

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Set tech status in Editor

Post by FreeER »

Hm, not sure if you found this helpful, I should also mention that you can make a technology researched by using

Code: Select all

  local technologies = game.player.force.technologies -- variable to save typing
  technologies["name-of-tech-in-prototype-file"].researched = true
If you want more specific information then let me know :)

Ca_Putt
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 31, 2014 9:44 am
Contact:

Re: Set tech status in Editor

Post by Ca_Putt »

oh, it helps as now I don't have to press randoms keys in the editor :D

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
and it worked out sofar.

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Set tech status in Editor

Post by Rahjital »

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.)

Post Reply

Return to “Gameplay Help”