Page 1 of 1

game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 10:22 am
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?

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 10:35 am
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

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 11:51 am
by kovarex
Oh, I need to update the wiki, sorry for that.

Edit: Updated (same with recipes)

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 4:31 pm
by ficolas
Also, is there any way to "hide" technologies until something is made in the code? Not just the recipe, the tech.

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 5:18 pm
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)

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 5:22 pm
by ficolas
dissable it, but I also may want it to be hidden.

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 5:29 pm
by drs9999
Oh wait. It is hidden when you do it like I said :D

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 5:33 pm
by ficolas
thanx!

Re: game.player.force.gettechnologies??

Posted: Fri Apr 19, 2013 5:37 pm
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.