negative bonus from research

Place to get help with not working mods / modding interface.
User avatar
demongo
Inserter
Inserter
Posts: 25
Joined: Sat Apr 13, 2019 11:09 pm
Contact:

negative bonus from research

Post by demongo »

I know it seems crazy but I am trying to have a research slow attack speed while increasing damage for my unique towers I am making, it shows in game but the speed is having no effect, am i missing something or do i have to do this another way? and yes tower uses a unique ammo/damage type:

Code: Select all

  {
    type = "technology",
    name = "photon-upgrade-1",
    icon = "__protossbuildings__/icons/PCUP1.png",
	icon_size = 128,
    effects =
    {
      {
        type = "ammo-damage",
        ammo_category = "photon",
        modifier = 0.5
      },
      {
        type = "gun-speed",
        ammo_category = "photon",
        modifier = -0.1
      },
    },
    prerequisites = {"photon-cannon-T1"},
    unit =
    {
      count = 15,
      ingredients =
      {
        {"automation-science-pack", 1}
      },
      time = 10
    },
    order = "e-a-za"
  },
    
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 539
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: negative bonus from research

Post by Silari »

On a whim, have you tried it when the forces speed bonus is already above 0% to see if the negative value works then? It might be a restriction on a net bonus of less than 0.

Actually, just tried it out, and it works fine. Setting laser speed -10% after getting all the normal laser techs brings the bonus down from +3.33 to +3.15. Researching a minus tech then a plus tech uses both, regardless of the research order so the negative isn't ignored when it's 0, it's just clamped to 0. Possibly to prevent situations where bonuses lead to 0 or negative numbers in things, like an inventory bonus of -50 slots.

So a simple way around this would be to set the shooting speed of your turret prototype to half of what you actually want it to be and start each force with a tech that increases it by 100% - then your techs can bring that number down to 0% bonus and half the starting speed.
User avatar
demongo
Inserter
Inserter
Posts: 25
Joined: Sat Apr 13, 2019 11:09 pm
Contact:

Re: negative bonus from research

Post by demongo »

aww, copy that, thanks i will just rebalence around that :)
User avatar
demongo
Inserter
Inserter
Posts: 25
Joined: Sat Apr 13, 2019 11:09 pm
Contact:

Re: negative bonus from research

Post by demongo »

second question is there a way to effect A: the amount of energy per shot OR B: energy input rate via upgrades? I'm not sure what the effect would be of it, my scripting skill is next to none :/
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: negative bonus from research

Post by FuryoftheStars »

demongo wrote: Thu May 12, 2022 2:35 am second question is there a way to effect A: the amount of energy per shot OR B: energy input rate via upgrades? I'm not sure what the effect would be of it, my scripting skill is next to none :/
A, I don't know. But B, I believe the answer is no:
viewtopic.php?f=23&t=102281
Rseding91 wrote: Laser turrets have an input flow limit of 9600kW so this is correct. The reason it's so high is; at higher research the laser shoots faster and uses more power. But the input flow limit is static for the lifetime of all turrets so it starts with enough input in mind to make sure the technology effects work when researched.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Post Reply

Return to “Modding help”