ned help with making mod

Place to get help with not working mods / modding interface.
speedy45
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Fri Aug 08, 2014 11:48 am
Contact:

ned help with making mod

Post by speedy45 »

I am trying make a mod by editing mod I download. So I am trying to make a mod that research all research in the game, So I try that and get the following error:

Error while running the oninit...n\Application Data\Factorio\mods\quick-start\control.lua:34:attempt to index field "advanced-chemistry" (a nil value)

So my question I get this error with any of the research that is in the game, so why I am getting this error?
Devcod
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Aug 08, 2014 8:14 pm
Contact:

Re: ned help with making mod

Post by Devcod »

If you would share code that you are using, then someone could help you. Right now we don't know anything.
speedy45
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Fri Aug 08, 2014 11:48 am
Contact:

Re: ned help with making mod

Post by speedy45 »

ok here is the code I am using for each research in the game:

game.player.force.technologies["advanced-chemistry"].researched = true
Turtle
Fast Inserter
Fast Inserter
Posts: 240
Joined: Sat May 31, 2014 9:45 pm
Contact:

Re: ned help with making mod

Post by Turtle »

You don't really need a mod for this. Just run this command:

Code: Select all

for _, tech in pairs(game.player.force.technologies) do tech.researched = true end
Devcod
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Aug 08, 2014 8:14 pm
Contact:

Re: ned help with making mod

Post by Devcod »

You are right Turtle, there is no need to use a mod, unless if he want it for every game / future mod techs, then mod would be ok.

Speedy45, if you want to have all technologies researched every time with modification turned on, you should do it like this:

Code: Select all

require "defines"

game.oninit(function()
 for _, tech in pairs(game.player.force.technologies) do tech.researched = true end
end)
I am not sure if defines is needed but I will leave it. It should work without any modification.
If you want to unlock technologies only for single game/map then you should use console and code that Turtle gave you.
You can open console with ` (or ~) button. You just need to write it there and it will work.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: ned help with making mod

Post by rk84 »

There is also this.

Code: Select all

game.player.force.researchalltechnologies()
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
speedy45
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Fri Aug 08, 2014 11:48 am
Contact:

Re: ned help with making mod

Post by speedy45 »

ok I will test this and let you know:

yeah it work just fine. So thanks for your help.
Post Reply

Return to “Modding help”