Re: looking for a 3d moder
Posted: Sun Jul 28, 2013 9:36 am
good launcher.
But I think the fireball isn´t lika a rocket. Maybe the following script entity is more like it:
But I think the fireball isn´t lika a rocket. Maybe the following script entity is more like it:
SpoilerShow
Paste the following in your own spell.lua at mod_assets/scripts/.
-----------------------------------------------------------------------------------------------------------------------------------------
defineObject{
name = "powerbolt",
class = "ProjectileSpell",
particleSystem = "rocket_projectile",
hitParticleEffect = "rocket_projectile_hit",
lightColor = vec(1, 0.67, 0.29),
lightBrightness = 10,
lightRange = 4,
lightHitBrightness = 20,
lightHitRange = 10,
castShadow = true,
launchSound = "fireball_hit",
projectileSound = "fireball",
hitSound = "fireball_hit",
screenEffect = "fireball_screen",
projectileSpeed = 20,
attackPower = 50,
damageType = "physical",
--cameraShake = true,
tags = { "spell" },
}
----------------------------------------------------------------------------------------------------------------------------------------
And the following in an own .lua file (named maybe "rocket_projectile") saved at mod_assets/particles:
----------------------------------------------------------------------------------------------------------------------------------------
defineParticleSystem{
name = "rocket_projectile",
emitters = {
-- smoke
{
emissionRate = 30,
emissionTime = 0,
maxParticles = 10,
boxMin = {0.0, 0.0, 0.0},
boxMax = {0.0, 0.0, 0.0},
sprayAngle = {0,360},
velocity = {0.1,0.1},
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1},
color0 = {0.25, 0.25, 0.25},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.9,
size = {0.1, 0.1},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 1,
blendMode = "Translucent",
},
-- flames
{
emissionRate = 50,
emissionTime = 0,
maxParticles = 50,
boxMin = {-0.0, -0.0, 0.0},
boxMax = { 0.0, 0.0, -0.0},
sprayAngle = {0,360},
velocity = {0.3, 0.3},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 30,
frameCount = 16,
lifetime = {0.8, 0.8},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.125, 0.25},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 1,
blendMode = "Additive",
objectSpace = true,
},
-- flame trail
{
emissionRate = 80,
emissionTime = 0,
maxParticles = 100,
boxMin = {0.0, 0.0, 0.0},
boxMax = {0.0, 0.0, 0.0},
sprayAngle = {0,360},
velocity = {0.1, 0.3},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 30,
frameCount = 16,
lifetime = {0.2, 0.3},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.1, 0.3},
gravity = {0,0,0},
airResistance = 1.0,
rotationSpeed = 1,
blendMode = "Additive",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.3, 0.13, 0.06},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
}
}
}
defineParticleSystem{
name = "rocket_projectile_hit",
emitters = {
{
spawnBurst = true,
maxParticles = 50,
sprayAngle = {0,40},
velocity = {1,3},
objectSpace = false,
texture = "assets/textures/particles/blood.tga",
frameRate = 40,
frameSize = 32,
frameCount = 40,
lifetime = {0.7,1.5},
colorAnimation = true,
color0 = {1, 1, 1},
color1 = {1, 1, 1},
color2 = {1, 1, 1},
color3 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.05, 0.3},
gravity = {0,-10,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Translucent",
clampToGroundPlane = true,
},
{
spawnBurst = true,
maxParticles = 30,
sprayAngle = {0,360},
velocity = {1,4},
objectSpace = false,
texture = "assets/textures/particles/blood.tga",
frameRate = 40,
frameSize = 32,
frameCount = 40,
lifetime = {0.5,0.7},
color0 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.3, 0.5},
gravity = {0,0,0},
airResistance = 7,
rotationSpeed = 2,
blendMode = "Translucent",
clampToGroundPlane = true,
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {0.5, 0.5},
colorAnimation = false,
color0 = {1, 0, 0},
opacity = 0.35,
fadeIn = 0.01,
fadeOut = 0.5,
size = {1.2, 1.2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
},
{
spawnBurst = true,
maxParticles = 200,
sprayAngle = {0,360},
velocity = {1,3},
objectSpace = false,
texture = "assets/textures/particles/blood.tga",
frameRate = 40,
frameSize = 32,
frameCount = 40,
lifetime = {0.5,0.7},
color0 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.05, 0.15},
gravity = {0,-3,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Translucent",
clampToGroundPlane = true,
}
}
}
The only little problem is, that the powerbolt spell isn´t usable in your game anymore. The Power Weapon would shoot now your rocket spell.
-----------------------------------------------------------------------------------------------------------------------------------------
defineObject{
name = "powerbolt",
class = "ProjectileSpell",
particleSystem = "rocket_projectile",
hitParticleEffect = "rocket_projectile_hit",
lightColor = vec(1, 0.67, 0.29),
lightBrightness = 10,
lightRange = 4,
lightHitBrightness = 20,
lightHitRange = 10,
castShadow = true,
launchSound = "fireball_hit",
projectileSound = "fireball",
hitSound = "fireball_hit",
screenEffect = "fireball_screen",
projectileSpeed = 20,
attackPower = 50,
damageType = "physical",
--cameraShake = true,
tags = { "spell" },
}
----------------------------------------------------------------------------------------------------------------------------------------
And the following in an own .lua file (named maybe "rocket_projectile") saved at mod_assets/particles:
----------------------------------------------------------------------------------------------------------------------------------------
defineParticleSystem{
name = "rocket_projectile",
emitters = {
-- smoke
{
emissionRate = 30,
emissionTime = 0,
maxParticles = 10,
boxMin = {0.0, 0.0, 0.0},
boxMax = {0.0, 0.0, 0.0},
sprayAngle = {0,360},
velocity = {0.1,0.1},
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1},
color0 = {0.25, 0.25, 0.25},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.9,
size = {0.1, 0.1},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 1,
blendMode = "Translucent",
},
-- flames
{
emissionRate = 50,
emissionTime = 0,
maxParticles = 50,
boxMin = {-0.0, -0.0, 0.0},
boxMax = { 0.0, 0.0, -0.0},
sprayAngle = {0,360},
velocity = {0.3, 0.3},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 30,
frameCount = 16,
lifetime = {0.8, 0.8},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.125, 0.25},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 1,
blendMode = "Additive",
objectSpace = true,
},
-- flame trail
{
emissionRate = 80,
emissionTime = 0,
maxParticles = 100,
boxMin = {0.0, 0.0, 0.0},
boxMax = {0.0, 0.0, 0.0},
sprayAngle = {0,360},
velocity = {0.1, 0.3},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 30,
frameCount = 16,
lifetime = {0.2, 0.3},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.1, 0.3},
gravity = {0,0,0},
airResistance = 1.0,
rotationSpeed = 1,
blendMode = "Additive",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.3, 0.13, 0.06},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
}
}
}
defineParticleSystem{
name = "rocket_projectile_hit",
emitters = {
{
spawnBurst = true,
maxParticles = 50,
sprayAngle = {0,40},
velocity = {1,3},
objectSpace = false,
texture = "assets/textures/particles/blood.tga",
frameRate = 40,
frameSize = 32,
frameCount = 40,
lifetime = {0.7,1.5},
colorAnimation = true,
color0 = {1, 1, 1},
color1 = {1, 1, 1},
color2 = {1, 1, 1},
color3 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.05, 0.3},
gravity = {0,-10,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Translucent",
clampToGroundPlane = true,
},
{
spawnBurst = true,
maxParticles = 30,
sprayAngle = {0,360},
velocity = {1,4},
objectSpace = false,
texture = "assets/textures/particles/blood.tga",
frameRate = 40,
frameSize = 32,
frameCount = 40,
lifetime = {0.5,0.7},
color0 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.3, 0.5},
gravity = {0,0,0},
airResistance = 7,
rotationSpeed = 2,
blendMode = "Translucent",
clampToGroundPlane = true,
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {0.5, 0.5},
colorAnimation = false,
color0 = {1, 0, 0},
opacity = 0.35,
fadeIn = 0.01,
fadeOut = 0.5,
size = {1.2, 1.2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
},
{
spawnBurst = true,
maxParticles = 200,
sprayAngle = {0,360},
velocity = {1,3},
objectSpace = false,
texture = "assets/textures/particles/blood.tga",
frameRate = 40,
frameSize = 32,
frameCount = 40,
lifetime = {0.5,0.7},
color0 = {1, 1, 1},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.05, 0.15},
gravity = {0,-3,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Translucent",
clampToGroundPlane = true,
}
}
}
The only little problem is, that the powerbolt spell isn´t usable in your game anymore. The Power Weapon would shoot now your rocket spell.

