[Solved]Map editor - Research

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
Myaskol
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Oct 20, 2014 8:20 pm
Contact:

[Solved]Map editor - Research

Post by Myaskol »

Hey guys,

Short: Is there any way to set the research completed in the map editor?

Somewhat longer: I am creating some kind of playground for myself where i have a working factory and can expand from there. At the moment I was looking into oil, steel and therefore creating research pack 3. Now the 'problem' appears. You cannot make steel if you don't have the research for it.

Is there any way to have a research completed when you start the game? In my other post someone said something about a startup script so you can add items to the player. Is this also posible to add certain researches? If so, can someone explain to me how to do this?
Last edited by Myaskol on Sun Oct 26, 2014 11:11 pm, edited 1 time in total.
Devcod
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Aug 08, 2014 8:14 pm
Contact:

Re: Map editor - Research

Post by Devcod »

You can not do it in map editor (or i don't know how :) ). Yes, you can do it via script/mod
Here you have working (probably) script/mod:

Code: Select all

require "defines"
local techs = {
"laser",
"steel-processing"
}
for tech in techs do
game.player.force.technologies[tech].researched = true
end
The technologies you want to have at game start should be enclosed with "" and separated with "," char. The code above will research Laser and Steel processing technologies - technologies names are all lower-caps + - instead of space.
The issue is you need to create new mod that will run it (or modify code to make it work in single line and then use console). You can also use following code directly in console, without any scripts:

Code: Select all

game.player.force.technologies["technology-name"].researched = true
If you want all technologies researched then use in console:

Code: Select all

game.player.force.researchalltechnologies()
User avatar
Myaskol
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Oct 20, 2014 8:20 pm
Contact:

Re: Map editor - Research

Post by Myaskol »

Thank you for the fast answer!

Where should I have posted this then? isnt the map editor gameplay as well? ( needed help with map editing right :mrgreen: )

I think i ll just stick with the command codes then. seems a lot easyer *lazy*
Thanks again!
neetzow
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Jan 03, 2015 4:40 pm
Contact:

Re: [Solved]Map editor - Research

Post by neetzow »

Where I should put the file?
Is it a txt or I must put a different termination?
Will the game recognize it as a mod automatically, or there is more missing?
ozcolemans
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Apr 01, 2016 2:36 am
Contact:

Re: [Solved]Map editor - Research

Post by ozcolemans »

hey guys

I have made a world on map editor is it possible for me to play that word. :D thx
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: [Solved]Map editor - Research

Post by daniel34 »

ozcolemans wrote:hey guys

I have made a world on map editor is it possible for me to play that word. :D thx
After saving the map in the map editor go to Play --> Custom scenario, your map is then listed in the User scenarios.
quick links: log file | graphical issues | wiki
Post Reply

Return to “Gameplay Help”