Changing another mods tech prerequisites

Place to get help with not working mods / modding interface.
Post Reply
Shapeshifters
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sun Nov 27, 2016 12:25 pm
Contact:

Changing another mods tech prerequisites

Post 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

User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 315
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: Changing another mods tech prerequisites

Post 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 :)
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby

User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 315
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: Changing another mods tech prerequisites

Post 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
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby

Post Reply

Return to “Modding help”