Page 1 of 1

Changing another mods tech prerequisites

Posted: Thu Feb 03, 2022 9:39 am
by Shapeshifters
Total noob here at modding, but I'm determined.

I'm playing with AAI vehicles, however I dislike their implementation in the tech tree not being locked behind vanilla vehicle tech requirements. So essentially I'm trying to create a standalone mod that adds prerequisites to them. I think I understand the basics of how the order of the data.lua scripts work.

So what I've got so far is a proper info.json with dependencies, and a data-final-fixes.lua with a few lines of code. Doesnt seem to be working so far though. As in, the game isnt registering my mod exists for some reason.

info.json

Code: Select all

{
  "name": "AAI-tech-tweak",
  "version": "0.1.0",
  "title": "AAITT",
  "author": "You",
  "factorio_version": "1.1",
  "dependencies": ["base >= 1.1"],["?aai-vehicles-hauler >= 0.6.1"],
    	["?aai-vehicles-flame-tank >= 0.5.1"],
    	["?aai-vehicles-miner >= 0.6.3"],
    	["?aai-vehicles-chaingunner >= 0.6.1"],
        ["?aai-programmable-vehicles >= 0.7.20]"
  "description": "This mod changes the requirements for AAI vehicles"
}
data-final-fixes.lua

Code: Select all


do
--Miner
if data.raw.technology["vehicle-miner"] and data.raw.technology["automobilism"] then
  table.insert(data.raw.technology["vehicle-miner"].prerequisites, ["automobilism"])
end

Re: Changing another mods tech prerequisites

Posted: Thu Feb 03, 2022 12:20 pm
by Stringweasel
What is the folder structure of your mod?

It could also be that your info.json is malformed. Pretty sure that will cause your mod to be ignored.

Code: Select all

        ["?aai-programmable-vehicles >= 0.7.20]"		<-- The quotation mark doesn't look right
  "description": "This mod changes the requirements for AAI vehicles"
}
As a final approach you could copy a mod from the mod portal, and start from that as foundation.

Hope this helps :)

Re: Changing another mods tech prerequisites

Posted: Thu Feb 03, 2022 12:23 pm
by Stringweasel
Looking at it again, and comparing it to Krastorio's info.json it should probably be:

Code: Select all

{
  "name": "AAI-tech-tweak",
  "version": "0.1.0",
  "title": "AAITT",
  "author": "You",
  "factorio_version": "1.1",
  "dependencies": [
  	"base >= 1.1",
  	"?aai-vehicles-hauler >= 0.6.1",
   	"?aai-vehicles-flame-tank >= 0.5.1",
    	"?aai-vehicles-miner >= 0.6.3",
    	"?aai-vehicles-chaingunner >= 0.6.1",
        "?aai-programmable-vehicles >= 0.7.20"],
  "description": "This mod changes the requirements for AAI vehicles"
}
And make sure the folder name in mods is:

Code: Select all

AAI-tech-tweak_0.1.0