Giter Site home page Giter Site logo

lshallo / advanced-electric Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 3.0 2.29 MB

Factorio modification that adds new tiers of solar panels and accumulators. Makes solar farms more space efficient and not as repetitive to build.

Home Page: https://mods.factorio.com/mod/Advanced-Electric-Revamped-v16

License: MIT License

Lua 100.00%
factorio factorio-mod mod accumulators electric solar-panels

advanced-electric's Introduction

advanced-electric's People

Contributors

jar349 avatar k98a avatar lshallo avatar viamonte4652 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

advanced-electric's Issues

Add `next_upgrade` to entities

When using the upgrade planner, it currently won't automatically upgrade the solar panels or accumulators unless they are specifically set in the upgrade planner. This is because entities have a next_upgrade property, which, went set, will tell the upgrade planner what to default to. https://wiki.factorio.com/Prototype/Entity#next_upgrade

I tested it today to make sure it would work, and it does. Below are the changes I made:

in data.lua (approx line 48):

-- add these lines so that the regular solar panel and accumulator upgrade to the advanced ones
data.raw["accumulator"]["accumulator"].next_upgrade = "advanced-accumulator"
data.raw["solar-panel"]["solar-panel"].next_upgrade = "advanced-solar"

in entity/advanced-solar.lua

-- line 2
tier=settings.startup["advanced-electric-enabled-tiers"].value
-- approx line 50, only set next upgrade if additional tiers are unlocked
if tier == "elite" or tier == "ultimate" then
	advanced_solar.next_upgrade = "elite-solar"
end

in entity/elite-solar.lua

-- line 2
tier=settings.startup["advanced-electric-enabled-tiers"].value
-- approx line 50, only set next upgrade if additional tiers are unlocked
if tier == "ultimate" then
	elite_solar.next_upgrade = "ultimate-solar"
end

in entity/advanced-accumulator.lua

-- line 2
tier=settings.startup["advanced-electric-enabled-tiers"].value
-- approx line 134, only set next upgrade if additional tiers are unlocked
if tier == "elite" or tier == "ultimate" then
	advanced_accumulator.next_upgrade = "elite-accumulator"
end

in entity/elite-accumulator.lua

-- line 2
tier=settings.startup["advanced-electric-enabled-tiers"].value
-- approx line 134, only set next upgrade if additional tiers are unlocked
if tier == "ultimate" then
	elite_accumulator.next_upgrade = "ultimate-accumulator"
end

That should do the trick!

Multiplier settings do not scale costs relative to other multiplier settings

Using the multiplier settings to change the values of the solar panels/accumulators causes the costs of an ultimate panel to scale exponentially with the multiplier, since the cost of each tier is hardcoded as dividing by 10, not the previous multiplier.

For example, changing the accumulator values from 10/100/1000 to 20/200/2000, to match Krastorio's accumulators, causes the costs to become 21 basic accumulators per advanced, 22 advanced per elite, and 25 elite per ultimate. Each accumulator is still 10x more powerful than the previous, but the costs are multiplied by 20x instead.

When calculating costs of each tier, the formula should scale as (Multiplier[Tier] / Multiplier[Tier-1]), not (Multiplier[Tier] / 10), as currently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.