how can be a particle (like blob) spawned after shooting with a gun (defined like a firearms)?
while defining a sci fi gun I use that spawning command: (it's log1 script)
Code: Select all
onAttack = function(self)
spawn("ion_object", self.level, self.x, self.y)
end,
Code: Select all
-- ion gun
defineObject{
name = "ion_gun",
baseObject = "base_item",
components = {
{
class = "Model",
model = "mod_assets/sci_fi_gun/ion_gun.fbx",
},
{
class = "Item",
uiName = "Ion Canon",
description = "A powerful weapon made with old technology, it fires high energetic particles.",
gfxAtlas = "mod_assets/sci_fi_gun/oliveitem.tga",
gfxIndex = 30,
-- gfxIndexPowerAttack = 432,
impactSound = "impact_blade",
weight = 3.0,
secondaryAction = "ions_rapid",
},
{
class = "FirearmAttack",
attackPower = 500,
cooldown = 0.4,
attackSound = "laser01",
ammo = "power",
jamChance = 0,
backfireChance = 0,
requirements = { "firearms", 5 },
onAttack = function(self)
spawn("ion_object", self.level, self.x, self.y)
end,
},
{
class = "FirearmAttack",
name = "ions_rapid",
uiName = "Rapid Fire",
gameEffect = "Quickly Fires 5 Ions Shots.",
energyCost = 50,
attackPower = 500,
cooldown = 3,
attackSound = "laser01",
ammo = "power",
repeatCount = 5,
repeatDelay = 0.10,
jamChance = 0,
backfireChance = 0,
requirements = { "firearms", 5 },
},
},
tags = { "weapon" },
}
Code: Select all
defineObject{
name = "ion_object",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "ions",
},
{
class = "Light",
color = vec(1.0, 1.0, 0.0),
brightness = 100,
range = 10,
fadeOut = 0.5,
disableSelf = true,
},
{
class = "Projectile",
spawnOffsetY = 1.35,
velocity = 20,
radius = 0.1,
hitEffect = "ions_blast",
},
{
class = "Sound",
sound = "laser01",
},
{
class = "Sound",
name = "launchSound",
sound = "laser01",
},
},
}
Is it possible to increase the range of any firearm to 15 or more square?
while testing, without any firearms level required, It shoot only on 3 squares max in front of the party.
I had to set the requirements = { "firearms", 5 }, so the range is naturally increased, but is there any way to do this without defining it like so?
finaly:
how can be the particle firearm_hit changed by another particle?