Request minimize turret mod

This is the place to request new mods or give ideas about what could be done.
Post Reply
Nebbeh
Inserter
Inserter
Posts: 48
Joined: Sat Apr 16, 2016 1:46 pm
Contact:

Request minimize turret mod

Post by Nebbeh »

I have tried to search and google to the best of my abillites but I could not find a mod for this. Is anyone here able to make a small mod just to minimize turrets to 1x1? No other changes just the size?

Would be super appreciated!

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Request minimize turret mod

Post by prg »

Code: Select all

for _, turret in pairs({{"ammo-turret", "gun-turret"}, {"electric-turret", "laser-turret"}}) do
    local t = data.raw[turret[1]][turret[2]]
    t.collision_box = {{-.45, -.45}, {.45, .45}}
    t.selection_box = {{-.5, -.5}, {.5, .5}}
    for _, img in pairs({"folded_animation", "preparing_animation", "prepared_animation", "attacking_animation", "folding_animation", "base_picture"}) do
        if t[img] then
            for _, layer in pairs(t[img].layers) do
                layer.scale = .5
                layer.shift[2] = layer.shift[2]/2
            end
        end
    end
end
if you don't mind the hovering shadows.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Nebbeh
Inserter
Inserter
Posts: 48
Joined: Sat Apr 16, 2016 1:46 pm
Contact:

Re: Request minimize turret mod

Post by Nebbeh »

prg wrote:

Code: Select all

for _, turret in pairs({{"ammo-turret", "gun-turret"}, {"electric-turret", "laser-turret"}}) do
    local t = data.raw[turret[1]][turret[2]]
    t.collision_box = {{-.45, -.45}, {.45, .45}}
    t.selection_box = {{-.5, -.5}, {.5, .5}}
    for _, img in pairs({"folded_animation", "preparing_animation", "prepared_animation", "attacking_animation", "folding_animation", "base_picture"}) do
        if t[img] then
            for _, layer in pairs(t[img].layers) do
                layer.scale = .5
                layer.shift[2] = layer.shift[2]/2
            end
        end
    end
end
if you don't mind the hovering shadows.

Well that doesnt matter, tho what do I do with this? :P

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Request minimize turret mod

Post by prg »

Throw it into a data-updates.lua alongside a valid info.json in the proper directory structure.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Nebbeh
Inserter
Inserter
Posts: 48
Joined: Sat Apr 16, 2016 1:46 pm
Contact:

Re: Request minimize turret mod

Post by Nebbeh »

Ok, I tried my best without luck, could you or someone have a look at it?
Attachments
Turret-Minimize_0.1.0.zip
(978 Bytes) Downloaded 46 times

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Request minimize turret mod

Post by prg »

It works with a properly named data-updates.lua (instead of data-update.lua)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Nebbeh
Inserter
Inserter
Posts: 48
Joined: Sat Apr 16, 2016 1:46 pm
Contact:

Re: Request minimize turret mod

Post by Nebbeh »

Oh such a small mistake. Thanks for the help prg!

Post Reply

Return to “Ideas and Requests For Mods”