Page 1 of 1

negative bonus from research

Posted: Wed May 11, 2022 9:30 pm
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"
  },
    

Re: negative bonus from research

Posted: Thu May 12, 2022 2:13 am
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.

Re: negative bonus from research

Posted: Thu May 12, 2022 2:27 am
by demongo
aww, copy that, thanks i will just rebalence around that :)

Re: negative bonus from research

Posted: Thu May 12, 2022 2:35 am
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 :/

Re: negative bonus from research

Posted: Thu May 12, 2022 2:41 am
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.