Search found 5 matches

by Infiniti
Wed Feb 22, 2017 5:55 pm
Forum: Modding help
Topic: Adding in New Weapons
Replies: 10
Views: 2139

Re: Adding in New Weapons

This is where you will need a migration file.

create /migrations/migration_0.0.1.lua

and put this in it.

for _, force in pairs(game.forces) do
for i = 1, 1000 do
local tech = force.technologies["bullet-damage-"..i] --Local reference to the tech
if tech then
if tech.researched then
force ...
by Infiniti
Wed Feb 22, 2017 5:39 pm
Forum: Modding help
Topic: Adding in New Weapons
Replies: 10
Views: 2139

Re: Adding in New Weapons

Don't be afraid to read the error It is telling you that the "for" loop is missing an "end".

Which is saying oops, I forgot to add the end for the for loop, after the end for the if check. (updating post above)

I tried changing the break to an end to see if that would work, but it didn't, but ...
by Infiniti
Wed Feb 22, 2017 5:18 pm
Forum: Modding help
Topic: Adding in New Weapons
Replies: 10
Views: 2139

Re: Adding in New Weapons

I created data-updates.lua in the same folder as data.lua, and added this code:


for i=1, 1000 do
local tech = data.raw["technology"]["bullet-damage-"..i] --Local reference to the tech
if tech then --If this tech exists add to it, otherwise break out of the loop
tech.effects[#tech.effects+1 ...
by Infiniti
Wed Feb 22, 2017 4:43 pm
Forum: Modding help
Topic: Adding in New Weapons
Replies: 10
Views: 2139

Re: Adding in New Weapons

For #1 just add your information to the existing technologies preferably in data-updates.lua. Doing it this way should mostly guarantee that your modifier gets added to mod added increased tech counts

for i=1, 1000 do
local tech = data.raw["technology"]["bullet-damage-"..i] --Local reference to ...
by Infiniti
Wed Feb 22, 2017 4:13 pm
Forum: Modding help
Topic: Adding in New Weapons
Replies: 10
Views: 2139

Adding in New Weapons

Hopefully someone here has dealt with this before! My friends and I didn't really like the current weapons in the game, so I decided to add an Assault Rifle and a Sniper Rifle. Everything is working 100% perfectly except for the research. Since they use bullets and are magazine-fed, I figured it ...

Go to advanced search