Modding Help standing turret "projectileConfig"

Discussion in 'Starbound Modding' started by Shadowblitz16, Nov 22, 2018.

  1. Shadowblitz16

    Shadowblitz16 Pangalactic Porcupine

    can someone explain to me where the "projectileConfig" parameter is defined in standing turret?
    it is not defined in "/interface/turret/standingturret.config" or "/objects/wired/standingturret/standingturret.object" but it is used in "/objects/wired/standingturret/standingturret.lua".

    I see nothing linking the standingturret.config's itemgrid to the standingturret.lua
    I am currently trying to use it as a reference for making a keypad and keypad ui.
     
  2. bk3k

    bk3k Oxygen Tank

    The script doesn't have "projectileConfig" anywhere within it. However it does have this line -
    Code:
    local projectileParameters = config.getParameter("projectileParameters", {})
    Which in turn pulls the parameters from the JSON "projectileParameters". Except the vanilla turret doesn't have this defined, thus it defaults to an empty table.

    edit:
    This line
    Code:
     world.spawnProjectile("standardbullet", firePosition(), entity.id(), aimVector, false, projectileParameters)
    That would use any alternate parameters, but since the table is empty, it will use the unaltered configurations for the "standardbullet".
     
  3. Shadowblitz16

    Shadowblitz16 Pangalactic Porcupine

    ok thankyou so much i was a little confused on where it was reading it from
     
  4. bk3k

    bk3k Oxygen Tank

    Yeah the second (optional) argument to config.getParameter() is a default return supposing it doesn't find what you're looking for. Otherwise it would return nil in that case.
     

Share This Page