Page 1 of 1

Creating explosions (entities) from the lua script

Posted: Tue May 21, 2013 6:06 pm
by ficolas
I noticed that there is a type of entity called "explosion"

Code: Select all

  {
    type = "explosion",
    name = "huge-explosion",
    animation_speed = 5,
    animations =
    {
      {
        filename = "__base__/graphics/entity/huge-explosion/huge-explosion.png",
        priority = "extra-high",
        frame_width = 111,
        frame_height = 131,
        frame_count = 24,
        line_length = 5
      }
    },
    light = {intensity = 1, size = 50},
    smoke = "smoke",
    smoke_count = 20,
    smoke_slow_down_factor = 1,
    sound =
    {
      {
        filename = "__base__/sound/huge-explosion.wav",
        volume = 1.25
      }
    }
  },
Is there any way to spawn this like I can spawn a particle?

Re: Creating explosions (entities) from the lua script

Posted: Tue May 21, 2013 6:21 pm
by kovarex
Yes, you can, no special parameters are needed.

Re: Creating explosions (entities) from the lua script

Posted: Tue May 21, 2013 7:16 pm
by ficolas
But I tried and it says that there is no name for that entity.
I will try again...