Modify Improvement Production Cost

A place for discussion of making game modifications.
Eldrinarr
Posts: 2
Joined: Mon Jun 15, 2020 10:15 pm

Modify Improvement Production Cost

Postby Eldrinarr » Mon Jun 15, 2020 10:25 pm

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

User avatar
siyoa
Posts: 181
Joined: Fri Apr 21, 2017 3:19 pm

Re: Modify Improvement Production Cost

Postby siyoa » Thu Jun 18, 2020 2:11 am

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
How did YOU get a key? All right, go in.

Eldrinarr
Posts: 2
Joined: Mon Jun 15, 2020 10:15 pm

Re: Modify Improvement Production Cost

Postby Eldrinarr » Mon Jul 06, 2020 1:37 pm

Thanks!


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 3 guests