Hi.
I modified my mod to create a new technology.
But now one of my custom technologies needs to require this one first.
Will it work directly in old saves or do I have to reset the tech somehow so that players will have to research the previous tech first before having access to this one ?
Thanks
Resetting technology
Re: Resetting technology
game.player.force.technologies["name"].reset()
Where name is the name of your tech.
Add this to the migration script.
Where name is the name of your tech.
Add this to the migration script.
Re: Resetting technology
I don't know wht a migration file is
Edit : found out how to make a migration file.
Now the problem is, i want the previous tech to be already researched if the other one is, how do I do this ?
the field "researched" is read only.
enable() will only allow players to research it ..
Edit : found out how to make a migration file.
Now the problem is, i want the previous tech to be already researched if the other one is, how do I do this ?
the field "researched" is read only.
enable() will only allow players to research it ..
-
- Filter Inserter
- Posts: 559
- Joined: Mon Mar 04, 2013 9:23 am
- Contact:
Re: Resetting technology
In migration script first check to see if the other techonology is already researched by the player.Nirahiel wrote:Now the problem is, i want the previous tech to be already researched if the other one is, how do I do this ?
the field "researched" is read only.
enable() will only allow players to research it ..
If it is you do nothing if it is not then you call "game.player.force.technologies["name"].reset()"
Re: Resetting technology
You don't get it, so i'll explain :
Before I had technology A.
Now I added technology B that's REQUIRED to even be able to research A.
I want to make it so everyone with already A don't have to research B. using reset() won't enable B is they already have A. That's what I want to do.
Before I had technology A.
Now I added technology B that's REQUIRED to even be able to research A.
I want to make it so everyone with already A don't have to research B. using reset() won't enable B is they already have A. That's what I want to do.
Re: Resetting technology
to set whether it is enabled or not you can use game.player.force.technologies["name"].setresearched(true) or false if you needed to do that later.
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
Re: Resetting technology
That's what I wanted ! ThanksFreeER wrote:to set whether it is enabled or not you can use game.player.force.technologies["name"].setresearched(true) or false if you needed to do that later.