1. Welcome to the Starbound support forums. Please check the support FAQs before posting: http://playstarbound.com/support

Closed Bug in standingturret.lua (and how to fix it)

Discussion in 'Starbound Support' started by LoPhatKao, Feb 16, 2016.

Thread Status:
Not open for further replies.
  1. LoPhatKao

    LoPhatKao Space Kumquat

    turret projectile power does not scale up with planet difficulty, even though code is (mostly) there
    affects Glad Giraffe and Cheerful (up to at least Feb 10th nightly)

    Code:
    function autoFire()
      local level = math.max(1.0, world.threatLevel())
      local power = entity.configParameter("power", 2)
      power = root.evalFunction("monsterLevelPowerMultiplier", level) * power
      local fireTime = entity.configParameter("fireTime", 0.1)
      local projectileParameters = entity.configParameter("projectileParameters", {})
      local energyUsage = entity.configParameter("energyUsage")
    
    {snip}
    end
    
    
    fixed version
    Code:
    function autoFire()
      local level = math.max(1.0, world.threatLevel())
      local power = entity.configParameter("power", 2)
      power = root.evalFunction("monsterLevelPowerMultiplier", level) * power
      local fireTime = entity.configParameter("fireTime", 0.1)
      local projectileParameters = entity.configParameter("projectileParameters", {})
      local energyUsage = entity.configParameter("energyUsage")
      projectileParameters.power = power -- lpk: fixed power
    
    {snip}
    end
    
    
    found it while looking for examples of "root.evalFunction()"
     
    Last edited: Feb 16, 2016
    lazarus78 likes this.
Thread Status:
Not open for further replies.

Share This Page