Making projectiles shrink with time?

Place to get help with not working mods / modding interface.
20percenttaco
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat May 21, 2016 8:32 pm
Contact:

Making projectiles shrink with time?

Post by 20percenttaco »

Heya!

I have tried to create a flame turret mod, and want the fire projectiles to decrease in size with time. I thought I could use the speed variable for this, since there's acceleration.
So what I did was add this to my projectiles.lua file -


(everything that's there - this stuff works)

data:extend({

{
type = "projectile",
name = "flame",
flags = {"not-on-map"},
acceleration = 0.003,
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "flame-bubble"
},
{
type = "damage",
damage = { amount = 5, type = "laser"}
}
}
}
},
light = {intensity = 1.0, size = 20},
animation =
{
filename = "__NewEnemies__/graphics/flame/flame.png",
tint = {r=1.0, g=1.0, b=1.0},
frame_count = 1,
width = 24,
height = 66,
priority = "high",
blend_mode = "additive"
},
speed = 1.00
},




{
type = "explosion",
name = "flame-bubble",
flags = {"not-on-map"},
animation_speed = 1,
animations =
{
{
filename = "__NewEnemies__/graphics/flame/flame-bubble.png",
priority = "extra-high",
width = 8,
height = 8,
frame_count = 5
}
},
light = {intensity = 1, size = 10},
smoke = "smoke-fast",
smoke_count = 2,
smoke_slow_down_factor = 1
}



if (flame.speed >= 0.06) then
flame.animation.height = flame.animation.height - 1
flame.animation.width = flame.animation.width - 1
end


})



this doesn't work though, I get an error saying I'm missing the } to close the { on line 3. Anyone have an idea how to do this?

Thanks :3
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5410
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Making projectiles shrink with time?

Post by Klonan »

20percenttaco wrote:
if (flame.speed >= 0.06) then
flame.animation.height = flame.animation.height - 1
flame.animation.width = flame.animation.width - 1
end
You can't do scripting like this in a prototype definition,
And also we are making our own flamethrower turret so it might not be worth your time to work on your own version
20percenttaco
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat May 21, 2016 8:32 pm
Contact:

Re: Making projectiles shrink with time?

Post by 20percenttaco »

Klonan wrote:
20percenttaco wrote:
if (flame.speed >= 0.06) then
flame.animation.height = flame.animation.height - 1
flame.animation.width = flame.animation.width - 1
end
You can't do scripting like this in a prototype definition,
And also we are making our own flamethrower turret so it might not be worth your time to work on your own version
ah, I had no idea. thanks
Post Reply

Return to “Modding help”