Page 1 of 1
Re researcher
Posted: Thu Jan 14, 2016 10:10 pm
by Bl4ckmail
I was wondering if ther would be a way to re reseach all things with a script. So you could ad a mod later in game.
With re research i mean whenn you haf automation researched and you add a mod the unlocks stuff at automation you normaly wouldn't have accses to that stuff so by re researching a script would delet all researches and research them again so you have the same ass before.
Hope it made sens.
Mfg Bl4ckmail
Edit found it out by myself here is the comand for anyone that is interested
Code: Select all
for k, v in pairs(game.player.force.technologies) do
if(v.researched == true)then
v.researched = false
v.researched = true
end
end
Re: Re researcher
Posted: Thu Jan 14, 2016 10:54 pm
by Koub
Re: Re researcher
Posted: Fri Jan 15, 2016 12:58 am
by daniel34
Moved to Gameplay Help.
Re: Re researcher
Posted: Fri Jan 15, 2016 7:38 am
by Bl4ckmail
I konw that but i am talking about a script or something like that to automaticly delet all research that has been made an then research it to this point again. Becouse some mods add recepies to aerly game technologies and whenn you add them later you have no accses to that receoie. i know it would be possible to do it by hand but i want to ad in dytech to my existing midgame gameplay so there would be many technologies so i thought a generell scipt to do that would be usefull for many people. But i dont now lua to well so i am asking if someone could do something like that.
Re: Re researcher
Posted: Fri Jan 15, 2016 11:04 am
by DaveMcW
Code: Select all
/c for _, player in pairs(game.players) do player.force.reset_technologies() end
Mods that add stuff to existing technologies should be doing this in on_init() already. If not, complain in the mod thread.
Re: Re researcher
Posted: Wed Jan 20, 2016 8:07 pm
by Bl4ckmail
DaveMcW wrote:Code: Select all
/c for _, player in pairs(game.players) do player.force.reset_technologies() end
Mods that add stuff to existing technologies should be doing this in on_init() already. If not, complain in the mod thread.
I tried this but it doesnot give me my recipe in the inventory.
Re: Re researcher
Posted: Wed Jan 20, 2016 10:45 pm
by ssilk
So it seems not to have a recipe?
Give use a little bit more information. Which mod? What recipe? What needed technology? ....
Re: Re researcher
Posted: Thu Jan 21, 2016 2:56 pm
by Bl4ckmail
I have bobs mod and 5 dim mods on my savegame i researched the automation 4 and it gave me accses to the assembling machine 4 of 5 dim becouse the 5 dim mod overwrote the bob mods assebling achines. Now i would like to remove the 5 dim mods becouse i wnat hte stuff from bobs mod but after removing it the research automation 4 said it would give me accses to bobs assemblin machine but i cannot find it in the crafting window. the only may of solving the problem i found is
Code: Select all
game.local_player.force.technologies["automation-4"].researched = false
game.local_player.force.technologies["automation-4"].researched = true
this is a way but whenn der are more things like this it would be cool to have a script that automaticly does that.
At the time i am trieng to write a script mysef but i dont know how to get a list of all resaerch in the game(includig mods).
Thanks for your halp
Re: Re researcher
Posted: Thu Jan 21, 2016 3:03 pm
by prg
Maybe
Code: Select all
for k,v in pairs(game.local_player.force.technologies) do v.researched=false end
game.local_player.force.research_all_technologies()
would help?
Re: Re researcher
Posted: Thu Jan 21, 2016 3:22 pm
by Bl4ckmail
prg wrote:Maybe
Code: Select all
for k,v in pairs(game.local_player.force.technologies) do v.researched=false end
game.local_player.force.research_all_technologies()
would help?
This would research it all.
I finaly made it my self
Code: Select all
for k, v in pairs(game.local_player.force.technologies) do
if(v.researched == true)then
v.researched = false
v.researched = true
end
end
Thanks for all your help and sugestions