Page 1 of 1

Combat drone animation

Posted: Wed Jun 14, 2017 5:29 pm
by dewast
hi,
is combat drone animation in .lua fix for :
--
idle =
{
layers =
--

I try borrow:
--
render_layer = "air-object",
final_render_layer = "air-object",
animation =
--
and got
Error while loading entity prototype "guardian-robot" (combat-robot): No such node (idle)
Modifications: Guardian

Re: Combat drone animation

Posted: Wed Jun 14, 2017 11:28 pm
by 321freddy
You cannot use animation as a parameter for combat drones.
You have to use idle and in_motion which are animations for the two different states. (not moving and moving)

It has to look like this: (taken from defender drone prototype)

Code: Select all

    idle =
    {
      layers =
      {
        {
          filename = "__base__/graphics/entity/defender-robot/defender-robot.png",
          priority = "high",
          line_length = 16,
          width = 32,
          height = 33,
          frame_count = 1,
          direction_count = 16,
          shift = {0, 0.015625}
        },
        {
          filename = "__base__/graphics/entity/defender-robot/defender-robot-mask.png",
          priority = "high",
          line_length = 16,
          width = 18,
          height = 16,
          frame_count = 1,
          direction_count = 16,
          shift = {0, -0.125},
          apply_runtime_tint = true
        },
      }
    },
    shadow_idle =
    {
      filename = "__base__/graphics/entity/defender-robot/defender-robot-shadow.png",
      priority = "high",
      line_length = 16,
      width = 43,
      height = 23,
      frame_count = 1,
      direction_count = 16,
      shift = {0.859375, 0.609375}
    },
    in_motion =
    {
      layers =
      {
        {
          filename = "__base__/graphics/entity/defender-robot/defender-robot.png",
          priority = "high",
          line_length = 16,
          width = 32,
          height = 33,
          frame_count = 1,
          direction_count = 16,
          shift = {0, 0.015625},
          y = 33
        },
        {
          filename = "__base__/graphics/entity/defender-robot/defender-robot-mask.png",
          priority = "high",
          line_length = 16,
          width = 18,
          height = 16,
          frame_count = 1,
          direction_count = 16,
          shift = {0, -0.125},
          apply_runtime_tint = true,
          y = 16
        },
      }
    },
    shadow_in_motion =
    {
      filename = "__base__/graphics/entity/defender-robot/defender-robot-shadow.png",
      priority = "high",
      line_length = 16,
      width = 43,
      height = 23,
      frame_count = 1,
      direction_count = 16,
      shift = {0.859375, 0.609375}
    }
Also the render layers can't be changed for combat drones, but I think they default to "air-object" so you're fine.