game.player.force.gettechnologies??

Place to get help with not working mods / modding interface.
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

game.player.force.gettechnologies??

Post by ficolas »

I need to get the technologies that the player has researched, the wiki sais that game.player.force.gettechnologies is a method, but I tested in the game, and it isnt inside the game.player.force table doesnt have any field called gettechnologies D:

Help?

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: game.player.force.gettechnologies??

Post by drs9999 »

This is working:

Code: Select all

if game.player.force.technologies["iron-working"].researched then
  game.player.print("researched")
else
  game.player.print(" not researched")
end
Maybe that will help

kovarex
Factorio Staff
Factorio Staff
Posts: 8193
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: game.player.force.gettechnologies??

Post by kovarex »

Oh, I need to update the wiki, sorry for that.

Edit: Updated (same with recipes)

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: game.player.force.gettechnologies??

Post by ficolas »

Also, is there any way to "hide" technologies until something is made in the code? Not just the recipe, the tech.

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: game.player.force.gettechnologies??

Post by drs9999 »

Do you want to hide it or just disable it?

First: I have no idea.

Second: You can disable the tech in the onInit-event:

Code: Select all

game.player.force.technologies["iron-working"].setenabled(false)
And enable it later in the code like this:

Code: Select all

game.player.force.technologies["iron-working"].setenabled(true)

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: game.player.force.gettechnologies??

Post by ficolas »

dissable it, but I also may want it to be hidden.

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: game.player.force.gettechnologies??

Post by drs9999 »

Oh wait. It is hidden when you do it like I said :D

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: game.player.force.gettechnologies??

Post by ficolas »

thanx!

kovarex
Factorio Staff
Factorio Staff
Posts: 8193
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: game.player.force.gettechnologies??

Post by kovarex »

It is not visible in the technology list, but it is not completely invisible.
It is still visible as continuation of technology when you look at details.

Post Reply

Return to “Modding help”