Page 1 of 1

Modify Improvement Production Cost

Posted: Mon Jun 15, 2020 10:25 pm
by Eldrinarr
Hello! I am looking to modify the production (hammers) cost for the planetary defenses improvement. I have looked all over and can not seem to figure out the value to modify. The "planet_defense_designs.lua" has what I thought should be the line, however, it's labeled as not being used by the game and changing it did nothing.

Can someone point me to how I can increase the cost of Planetary Defenses improvements from 300 hammers to x2 that amount?

Thanks!

Code: Select all

--]]

local function init_planet_specs(design,specs)

  local size, defenses in design.planet_info!

  local s =  size_to_s[size] 

  insert(specs,
    hull=defenses*s*5,
    upkeep=defenses*3,
    crew=defenses*1000,
    speed_class=0,

    -- these are never used, but, whatever.
    hammer_cost = defenses*100,
    metal_cost = 0,

    max_munitions=max_double,
    munitions=max_double,
    power=max_double,
    ..s,
  )

end

Re: Modify Improvement Production Cost

Posted: Thu Jun 18, 2020 2:11 am
by siyoa
file: improvements.lua

Code: Select all

local function calc_value(planet,improvement,inc)

 local base = planet[ planet_improvement[improvement] ] 

 if cheap_improvements[improvement]
  -- formula for a mine/farm/market cost
   return 15 + (base+inc) * 35
 end

 if generic_improvements[improvement]
    -- formula for factory / lab cost
    return 150 + (base+inc)*75
  end

  -- formula for the cost of building planetary defenses.
  return 250 + (base + inc)*50
end

Re: Modify Improvement Production Cost

Posted: Mon Jul 06, 2020 1:37 pm
by Eldrinarr
Thanks!