Jump to content

Serenity424

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by Serenity424

  1. So, reworked the TurretFactory to create big weaponry , as of now only the laser is added and just the main proprieties  (size/range/damage)

    I'm looking forward to add more weapons to the list.

    For now the biggest laser look like this

    20180929233000_1.jpg

    (it's in front of the ship which you have the stats)

    It's 300as size , I need to rework the propriety upgrade schematics to have something bit more realistic.

  2. WORK RESUMED

     

    Sooo, found a way around using the rarity this time, it does work I'll need to make a mod for each weapons (at least the main types) and rework the ui to help.

    But you can have pretty big weapons, to have to note the ship has 300M Hp +, the plat where the coax big gun is mounted is 100*100

    20180922000358_1.jpg

  3. Okay someone need to point out the problem here I'm giving up, I looked into again to find who/what what bugging the mod.

    If I let a if loop in the turret making function it will never build a turret, like if I let only the if loop without instructions in it, and even turret that does not trigger the IF.

     

    If I try to printlog anything in the "buildturret" function it's just like the game is blind to this, like nothings happens, wtf ?

  4. Yeah I checked ingame (client log ?) and server log nothing appear, if I cut out the "displayChatMessage" the code will execute all the way down to removing the ingredients but not making the turret and it doesn't make any sense :/  like :

    -If the message function make the code go wrong why no sign of error ?

    -Why does the code just stop like this, like there is no break, return of any shouldn't it bug ?

    -And the maketurret work since it display the turret with the value I gave it.

    So still searching of why, but without anything to work with I'm stuck :/

  5. So here is a catch I have no idea why,

     

    	displayChatMessage('good god3', 'the code', 0)
        if missing then
            sendError(player, "You need more %s."%_t, missing)
            return
        end
    
        local canPay, msg, args = buyer:canPay(price)
        if not canPay then
            sendError(player, msg, unpack(args))
            return
        end
    displayChatMessage('good god2', 'the code', 0)
        local errors = {}
        errors[EntityType.Station] = "You must be docked to the station to build turrets."%_T
        errors[EntityType.Ship] = "You must be closer to the ship to build turrets."%_T
        if not CheckPlayerDocked(player, station, errors) then
            return
        end
    
        -- pay
        receiveTransactionTax(station, taxAmount)
    displayChatMessage('good god1', 'the code', 0)
        buyer:pay("Paid %1% credits to build a turret."%_T, price)
    -- displayChatMessage(ingredient,'the code',0)
        for i, ingredient in pairs(ingredients) do
            local g = goods[ingredient.name]:good()
            ship:removeCargo(g, ingredient.amount)
    	-- displayChatMessage('good god', 'the code', 0)
        end
    displayChatMessage('good god', 'the code', 0) 
        local turret = makeTurret(weaponType, rarity, material, ingredients)
    displayChatMessage(' bad god', 'the code', 0) 
        buyer:getInventory():add(InventoryTurret(turret))
    
        invokeClientFunction(player, "refreshUI")

     

    As you can see I put more display stuff, and nothing happen, like the message thingy make avorion refuse to execute anything apparently, like nada.

    I did few test with basic turret (no mod implication) and right now when I try to make a turret nothing happen and no bug.

     

    So why ?

     

    here is the log of the server, where should appear something, anything

    2018-09-18 00-14-21| Starting thread [LoadingScreen Plan]...

    2018-09-18 00-14-21| Started thread [LoadingScreen Plan] with id 23

    2018-09-18 00-14-21| <Server> Player XXXXX joined the galaxy

    2018-09-18 00-14-21| Player XXXXX joined the galaxy

    2018-09-18 00-15-54| <> You paid 575403456 credits to pay the crew of B.

    2018-09-18 00-15-54| You paid 575403456 credits to pay the crew of B.

    2018-09-18 00-15-54| <> The crew of your ship 'B' was paid.

    2018-09-18 00-15-54| The crew of your ship 'B' was paid.

  6. So I found the culprit but I have no idea of why, here is the thing

    buyer:pay("Paid %1% credits to build a turret."%_T, price)
    
        for i, ingredient in pairs(ingredients) do
            local g = goods[ingredient.name]:good()
            ship:removeCargo(g, ingredient.amount)
    	displayChatMessage('good god', 'the code', 0)
        end
    displayChatMessage('good god', 'the code', 0) 
        local turret = makeTurret(weaponType, rarity, material, ingredients)
    displayChatMessage(' bad god', 'the code', 0) 
        buyer:getInventory():add(InventoryTurret(turret))
    
        invokeClientFunction(player, "refreshUI")

     

    it's in the function when you clic on "buy" now if I remove the first display call (btw this work nice for display )  it take me the ingredients and the money but turret is nowhere to be found. Now if I let it, it will take only the first kind and stop but no message nor turret. There is no return, no bug logged in the server so why ?

  7. Thanks for the feed back, yeah since I haven't spawned one yet I haven't any idea of how the size reflect on the ship.

    If you talk about custom turret I haven't tried to build one (like on the ship editor UI) dunno how this work. I haven't found a proper "display" function to send a chat message for debugging purposes so don't really know what's happening in the if loops.

     

    I tried (after trying to build a big one) to build a normal one same thing happen no turret :/ .

    So yeah for the stats I just tried which property can be changed and which is not, the doc is not completely accurate or  I missed something.

  8. Inserting a quick question here,  your code mean on that the

    function MyModNamespace.onBlockDamaged(objectIndex, blockIndex, inflictorId, damage, damageType)
        local entity = Entity(objectIndex)
        entity:heal(damage, blockIndex, vec3(), entity.factionIndex) 
    end

    overwrite the original callback ?  How do you know (or where) the original content of the function  ?

     

  9. Hello guys ,

     

    Working on the creation of bigger guns with the factory but there is a catch, it display correctly the gun that should be purchased but when I try to create it it don't add to my inventory :'( had to wreck many systems to get the components for it.

     

    Except for the checkbox initialization and changed the ingredients amounts there is nothing too wild that would prevent the turret from being made, and the server doesn't show errors, someone have an idea ?

     

     

    function makeTurret(weaponType, rarity, material, ingredients)
    
        local turret = makeTurretBase(weaponType, rarity, material)
        local weapons = {turret:getWeapons()}
    
        turret:clearWeapons()
    
        for _, weapon in pairs(weapons) do
            -- modify weapons
            for _, ingredient in pairs(ingredients) do
                if ingredient.weaponStat then
                    -- add one stat for each additional ingredient
                    local additions = math.max(ingredient.minimum - ingredient.default, math.min(ingredient.maximum - ingredient.default, ingredient.amount - ingredient.default))
    
                    local value = weapon[ingredient.weaponStat]
                    if type(value) == "boolean" then
                        if value then
                            value = 1
                        else
                            value = 0
                        end
                    end
    
                    value = value + ingredient.statDelta * additions
                    weapon[ingredient.weaponStat] = value
    
                end
            end
    
            turret:addWeapon(weapon)
        end
    
        for _, ingredient in pairs(ingredients) do
            if ingredient.turretStat then
                -- add one stat for each additional ingredient
                local additions = math.max(ingredient.minimum - ingredient.default, math.min(ingredient.maximum - ingredient.default, ingredient.amount - ingredient.default))
    
                local value = turret[ingredient.turretStat]
                if type(value) == "boolean" then
                    if value then
                        value = 1
                    else
                        value = 0
                    end
                end
    
                value = value + ingredient.statDelta * additions
    
                turret[ingredient.turretStat] = value
            end
        end
    
        -- if the automatic property was set, we must adjust damage of the turret
        if turret.automatic then
            local weapons = {turret:getWeapons()}
            turret:clearWeapons()
    
            for _, weapon in pairs(weapons) do
                weapon.damage = weapon.damage / 2.0
                if weapon.hullRepair > 0.0 then
                    weapon.hullRepair = weapon.hullRepair / 2.0
                end
                if weapon.shieldRepair > 0.0 then
                    weapon.shieldRepair = weapon.shieldRepair / 2.0
                end
    
                turret:addWeapon(weapon)
            end
        end
    
    if biggunCheckBox.checked and weaponType == WeaponType.Cannon then
    turret.size=70
    turret.slots=70
    -- turret.Crew=round(totalcomp)
    turret.turningSpeed=0.05
    turret:clearWeapons()	
    for _, weapon in pairs(weapons) do
            weapon.reach=9500
    	-- weapon.heatPerShot=1000
    	weapon.otherForce=10^8
    	weapon.damage=1000*1000^6
    	weapon.hullDamageMultiplicator=2
    	weapon.shieldDamageMultiplicator=0.7
    	weapon.shieldPenetration=1500
    	-- weapon.maxHeat	=1000
    
    	weapon.recoil=10^5
    	-- weapon.baseEnergyPerSecond=10^6
    	-- weapon.automatic=false
    	weapon.psize = weapon.psize * turret.size/10 * 1 --Projectile size, change this for fun :D
    	weapon.pvelocity = weapon.pvelocity /10
    	weapon.pmaximumTime = weapon.reach / weapon.pvelocity --Leave this alone for accurate range, projectile lifetime calculated after the altered velocity
    	weapon.pcolor =ColorRGB(0.1, 0.3, 1.2)
    	weapon.fireRate =0.1
            turret:addWeapon(weapon)
    	sendError("This turret should be here."%_t)
        end
        
            --Range for beam weapons
    				-- if weapontype == WeaponType.Laser or weapontype == WeaponType.MiningLaser or weapontype == WeaponType.RailGun  or weapontype == WeaponType.RepairBeam or weapontype == WeaponType.LightningGun or weapontype == WeaponType.TeslaGun or weapontype == WeaponType.ForceGun or weapontype == WeaponType.SalvagingLaser then
    					-- weapon.blength = weapon.blength * rangemul
    					-- weapon.reach = weapon.blength
    					-- weapon.bwidth = weapon.bwidth * sizemul * math.sqrt(dpsmul) * 1 --Size of beam
    					-- weapon.bshapeSize = weapon.bshapeSize * sizemul * math.sqrt(dpsmul) * 1 --Size of beam
    				-- else --Range / projectile properties for Physical weapon
    					-- weapon.reach = weapon.reach * rangemul * 1
    					-- weapon.psize = weapon.psize * sizemul * math.sqrt(dpsmul) * 1 --Projectile size, change this for fun :D
    					-- weapon.pvelocity = weapon.pvelocity * math.sqrt(dpsmul)
    					-- weapon.pmaximumTime = weapon.reach / weapon.pvelocity --Leave this alone for accurate range, projectile lifetime calculated after the altered velocity
    				-- end
    
    end
    
    
        return turret;
    end

     

  10. Torpedoes modifications

     

     

    package.path = package.path .. ";data/scripts/lib/?.lua"
    
    require ("galaxy")
    require ("randomext")
    
    local rand = random()
    
    local TorpedoGenerator =  {}
    
    local blue = ColorRGB(0.2, 0.2, 1.0)
    local red = ColorRGB(1.0, 0.2, 0.2)
    local yellow = ColorRGB(0.8, 0.8, 0.2)
    
    local BodyType =
    {
        Orca = 1,
        Hammerhead = 2,
        Stingray = 3,
        Ocelot = 4,
        Lynx = 5,
        Panther = 6,
        Osprey = 7,
        Eagle = 8,
        Hawk = 9,
    }
    TorpedoGenerator.BodyType = BodyType
    
    local Bodies = {}
    table.insert(Bodies, {type = BodyType.Orca,        name = "Orca"%_T,        velocity = 1, agility = 1, stripes = 1, size = 1.0, reach = 4, color = blue})
    table.insert(Bodies, {type = BodyType.Hammerhead,  name = "Hammerhead"%_T,  velocity = 1, agility = 2, stripes = 2, size = 1.5, reach = 5, color = blue})
    table.insert(Bodies, {type = BodyType.Stingray,    name = "Stingray"%_T,    velocity = 1, agility = 3, stripes = 3, size = 2.5, reach = 6, color = blue})
    table.insert(Bodies, {type = BodyType.Ocelot,      name = "Ocelot"%_T,      velocity = 2, agility = 1, stripes = 1, size = 1.5, reach = 5, color = red})
    table.insert(Bodies, {type = BodyType.Lynx,        name = "Lynx"%_T,        velocity = 2, agility = 2, stripes = 2, size = 2.5, reach = 6, color = red})
    table.insert(Bodies, {type = BodyType.Panther,     name = "Panther"%_T,     velocity = 2, agility = 3, stripes = 3, size = 3.5, reach = 7, color = red})
    table.insert(Bodies, {type = BodyType.Osprey,      name = "Osprey"%_T,      velocity = 3, agility = 1, stripes = 1, size = 2.5, reach = 6, color = yellow})
    table.insert(Bodies, {type = BodyType.Eagle,       name = "Eagle"%_T,       velocity = 3, agility = 2, stripes = 2, size = 3.5, reach = 7, color = yellow})
    table.insert(Bodies, {type = BodyType.Hawk,        name = "Hawk"%_T,        velocity = 3, agility = 3, stripes = 3, size = 5.0, reach = 8, color = yellow})
    
    local WarheadType =
    {
        Nuclear = 1,
        Neutron = 2,
        Fusion = 3,
        Tandem = 4,
        Kinetic = 5,
        Ion = 6,
        Plasma = 7,
        Sabot = 8,
        EMP = 9,
        AntiMatter = 10,
        ThermoNuclear = 11,
    }
    TorpedoGenerator.WarheadType = WarheadType
    
    
    local Warheads = {}
    table.insert(Warheads, {type = WarheadType.Nuclear,     name = "Nuclear"%_T,        hull = 1,     shield = 1,       size = 1.0, color = ColorRGB(0.8, 0.8, 0.8)})
    table.insert(Warheads, {type = WarheadType.Neutron,     name = "Neutron"%_T,        hull = 3,     shield = 1,       size = 1.0, color = ColorRGB(0.8, 0.8, 0.3)})
    table.insert(Warheads, {type = WarheadType.Fusion,      name = "Fusion"%_T,         hull = 1,     shield = 3,       size = 1.0, color = ColorRGB(1.0, 0.4, 0.1)})
    table.insert(Warheads, {type = WarheadType.Tandem,      name = "Tandem"%_T,         hull = 1.5,   shield = 2,       size = 1.5, color = ColorRGB(0.8, 0.2, 0.2), shieldAndHullDamage = true})
    table.insert(Warheads, {type = WarheadType.Kinetic,     name = "Kinetic"%_T,        hull = 2.5,   shield = 0.25,    size = 1.5, color = ColorRGB(0.7, 0.3, 0.7), damageVelocityFactor = true})
    table.insert(Warheads, {type = WarheadType.Ion,         name = "Ion"%_T,            hull = 0.25,  shield = 3,       size = 2.0, color = ColorRGB(0.2, 0.7, 1.0), energyDrain = true})
    table.insert(Warheads, {type = WarheadType.Plasma,      name = "Plasma"%_T,         hull = 1,     shield = 5,       size = 2.0, color = ColorRGB(0.2, 0.8, 0.2)})
    table.insert(Warheads, {type = WarheadType.Sabot,       name = "Sabot"%_T,          hull = 2,     shield = 0,       size = 3.0, color = ColorRGB(1.0, 0.1, 0.5), penetrateShields = true})
    table.insert(Warheads, {type = WarheadType.EMP,         name = "EMP"%_T,            hull = 0,     shield = 0.025,   size = 3.0, color = ColorRGB(0.3, 0.3, 0.9), deactivateShields = true})
    table.insert(Warheads, {type = WarheadType.AntiMatter,  name = "Anti-Matter"%_T,    hull = 80,    shield = 60,      size = 25, color = ColorRGB(0.2, 0.2, 0.2), storageEnergyDrain = 50000000})
    table.insert(Warheads, {type = WarheadType.ThermoNuclear,  name = "ThermoNuclear"%_T,    hull = 80,    shield = 60,      size = 25, color = ColorRGB(0.2, 0.2, 0.2), storageEnergyDrain = 50000000})
    
    
    function TorpedoGenerator.initialize(seed)
        if seed then
            rand = Random(seed)
        end
    end
    
    function TorpedoGenerator.getBodyProbability(x, y)
        local distFromCenter = length(vec2(x, y)) / Balancing_GetMaxCoordinates()
    
        local data = {}
    
        data[bodyType.Orca] =       {p = 1.0}
        data[bodyType.Hammerhead] = {d = 0.8, p = 1.5}
        data[bodyType.Ocelot] =     {d = 0.8, p = 1.5}
        data[bodyType.Stingray] =   {d = 0.6, p = 2.0}
        data[bodyType.Lynx] =       {d = 0.6, p = 2.0}
        data[bodyType.Osprey] =     {d = 0.6, p = 2.0}
        data[bodyType.Panther] =    {d = 0.45, p = 2.5}
        data[bodyType.Eagle] =      {d = 0.45, p = 2.5}
        data[bodyType.Hawk] =       {d = 0.35, p = 3.0}
    
        local probabilities = {}
    
        for t, specs in pairs(data) do
            if not specs.d or distFromCenter < specs.d then
                probabilities[t] = specs.p
            end
        end
    
        return probabilities
    end
    
    function TorpedoGenerator.getWarheadProbability(x, y)
        local distFromCenter = length(vec2(x, y)) / Balancing_GetMaxCoordinates()
    
        local data = {}
    
        data[WarheadType.Nuclear] =    {p = 1.0}
        data[WarheadType.Neutron] =    {d = 0.8, p = 1.5}
        data[WarheadType.Fusion] =     {d = 0.8, p = 1.5}
        data[WarheadType.Tandem] =     {d = 0.65, p = 2.0}
        data[WarheadType.Kinetic] =    {d = 0.65, p = 2.0}
        data[WarheadType.Ion] =        {d = 0.5, p = 2.5}
        data[WarheadType.Plasma] =     {d = 0.5, p = 2.5}
        data[WarheadType.Sabot] =      {d = 0.35, p = 3.0}
        data[WarheadType.EMP] =        {d = 0.35, p = 3.0}
        data[WarheadType.AntiMatter] = {d = 0.25, p = 3.5}
        data[WarheadType.ThermoNuclear] = {d = 0.15, p = 5.5}
    
        local probabilities = {}
    
        for t, specs in pairs(data) do
            if not specs.d or distFromCenter < specs.d then
                probabilities[t] = specs.p
            end
        end
    
        return probabilities
    end
    
    function TorpedoGenerator.generate(x, y, offset_in, rarity_in, warhead_in, body_in) -- server
    
        local offset = offset_in or 0
        local seed = rand:createSeed()
        local sector = math.floor(length(vec2(x, y))) + offset
    
        local dps, tech = Balancing_GetSectorWeaponDPS(sector, 0)
        dps = dps * Balancing_GetSectorTurretsUnrounded(sector, 0) -- remove turret bias
    
        local rarities = {}
        rarities[5] = 0.1 -- legendary
        rarities[4] = 1 -- exotic
        rarities[3] = 8 -- exceptional
        rarities[2] = 16 -- rare
        rarities[1] = 32 -- uncommon
        rarities[0] = 128 -- common
    
        local rarity = rarity_in or Rarity(getValueFromDistribution(rarities))
    
        local bodyProbabilities = TorpedoGenerator.getBodyProbability(sector, 0)
        local body = Bodies[selectByWeight(rand, bodyProbabilities)]
        if body_in then body = Bodies[body_in] end
    
        local warheadProbabilities = TorpedoGenerator.getWarheadProbability(sector, 0)
    local gottya=selectByWeight(rand, warheadProbabilities)
        local warhead = Warheads[gottya]
        if warhead_in then warhead = Warheads[warhead_in] end
    -- if warhead.size==9.9 then
        local torpedo = TorpedoTemplate()
    
    
        -- normal properties
        torpedo.rarity = rarity
        torpedo.tech = tech
        torpedo.size = round(body.size * warhead.size, 2)
    
        -- body properties
        torpedo.durability = (2 + tech / 10) * (rarity.value + 1) + 4;
        torpedo.turningSpeed = 0.3 + 0.1 * ((body.agility * 2) - 1)
        torpedo.maxVelocity = 250 + 100 * body.velocity
        torpedo.reach = (body.reach * 4 + 3 * rarity.value) * 150
    
        -- warhead properties
        local damage = dps * (1 + rarity.value * 0.25) * 10
    
        torpedo.shieldDamage = round(damage * warhead.shield / 100) * 100
        torpedo.hullDamage = round(damage * warhead.hull / 100) * 100
        torpedo.shieldPenetration = warhead.penetrateShields or false
        torpedo.shieldDeactivation = warhead.deactivateShields or false
        torpedo.shieldAndHullDamage = warhead.shieldAndHullDamage or false
        torpedo.energyDrain = warhead.energyDrain or false
        torpedo.storageEnergyDrain = (warhead.storageEnergyDrain or 0.0) * tech
        torpedo.damageType = DamageType.Physical
        torpedo.acceleration = 0.5 * torpedo.maxVelocity * torpedo.maxVelocity / 1000 -- reach max velocity after 10km of travelled way
    
        if warhead.damageVelocityFactor then
            -- scale to normal dps damage dependent on maxVelocity
            torpedo.damageVelocityFactor = damage * warhead.hull / torpedo.maxVelocity
            torpedo.maxVelocity = torpedo.maxVelocity * 2.0
            torpedo.hullDamage = 0
        end
    
        -- torpedo visuals
        torpedo.visualSeed = rand:getInt()
        torpedo.stripes = body.stripes
        torpedo.stripeColor = body.color
        torpedo.headColor = warhead.color
        torpedo.prefix = warhead.name
        torpedo.name = "${speed}-Class ${warhead} Torpedo"%_T % {speed = body.name, warhead = warhead.name}
        torpedo.icon = "data/textures/icons/missile-pod.png"
    
        -- impact visuals
        torpedo.numShockwaves = 1
        torpedo.shockwaveSize = 60
        torpedo.shockwaveDuration = 0.6
        torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        -- torpedo.shockwaveColor = ColorRGB(0.1, 0.3, 1.2) -- this looks cool :)
        torpedo.explosionSize = 6
        torpedo.flashSize = 25
        torpedo.flashDuration = 1
    if gottya == 1 then
        -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.8, 0.8, 0.8) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 2 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.8, 0.8, 0.3) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 3 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(1.0, 0.4, 0.1) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 4 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.8, 0.2, 0.2) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 5 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.7, 0.3, 0.7) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 6 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.2, 0.7, 1.0) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 7 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(1.0, 0.1, 0.5) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 8 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.2, 0.8, 0.2) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 9 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.2, 0.2, 0.2) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 10 then
    -- impact visuals
        torpedo.numShockwaves = gottya
        torpedo.shockwaveSize = 15^gottya
        torpedo.shockwaveDuration = gottya
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.2, 0.2, 0.2) -- this looks cool :)
        torpedo.explosionSize = (6*gottya)^gottya
        torpedo.flashSize = 15^gottya
        torpedo.flashDuration = gottya
    elseif gottya == 11 then
    
        -- normal properties
    
        torpedo.size = round(body.size * warhead.size, 2)
    
        -- body properties
    
        torpedo.maxVelocity = 350
        torpedo.reach = 15000
    
        -- warhead properties
        local damage = dps^rarity.value
    
        torpedo.shieldDamage = round(damage * warhead.shield / 100) * 100
        torpedo.hullDamage = round(damage * warhead.hull / 100) * 100
        torpedo.shieldPenetration = false
        torpedo.shieldDeactivation = false
        torpedo.shieldAndHullDamage = true
        torpedo.energyDrain = warhead.energyDrain or false
        torpedo.storageEnergyDrain = (warhead.storageEnergyDrain or 0.0) * tech
        torpedo.damageType = DamageType.Fragments
    torpedo.explosionRadius=600
        torpedo.acceleration = 0.5 * torpedo.maxVelocity * torpedo.maxVelocity / 1000 -- reach max velocity after 10km of travelled way
    
        if warhead.damageVelocityFactor then
            -- scale to normal dps damage dependent on maxVelocity
            torpedo.damageVelocityFactor = damage * warhead.hull / torpedo.maxVelocity
            torpedo.maxVelocity = torpedo.maxVelocity * 2.0
            torpedo.hullDamage = 0
        end
    
        -- torpedo visuals
        torpedo.visualSeed = rand:getInt()
        torpedo.stripes = body.stripes
        torpedo.stripeColor = body.color
        torpedo.headColor = warhead.color
        torpedo.prefix = warhead.name
        torpedo.name = "${speed}-Class ${warhead} Torpedo"%_T % {speed = body.name, warhead = warhead.name}
        torpedo.icon = "data/textures/icons/missile-pod.png"
    
        -- impact visuals
        torpedo.numShockwaves = 15
        torpedo.shockwaveSize = 2200
        torpedo.shockwaveDuration = 5
        -- torpedo.shockwaveColor = ColorRGB(0.9, 0.6, 0.3)
        torpedo.shockwaveColor = ColorRGB(0.1, 0.3, 1.2) -- this looks cool :)
        torpedo.explosionSize = 600
        torpedo.flashSize = 2200
        torpedo.flashDuration = 5
    
    
    end
    
        return torpedo
    end
    
    return TorpedoGenerator
    

     

     

    And here are the pics of the torpedo I added.

    How to install ? just overwrite the torpedo generator file and don't forget to keep a copy of the original.

    To do :

    Fine tune the torpedoes and add an effect which look like the type of torpedo

    Add AOE damages

    Pictures

     

    20180916132805_1.jpg

    20180916132811_1.jpg

    20180916132811_2.jpg

    20180916132812_1.jpg

    20180916132813_1.jpg

    20180916132815_1.jpg

    20180916132817_1.jpg

    20180916132818_1.jpg

     

  11. Hello guys,

     

    I'm trying to implement two features, "real" thermonuclear torpedoes and block explosion upon destruction (energy container)

     

    But I struggle on two things, first for the torpedoes but is also useful for the other, how can I make explosion impact all the ship in the area, I changed explosionsize of the torpedoes but nothing seems to do it so far :/

    And for the block particularly, how can I spawn an explosion (the ones of the torpedoes would allow the "waves" which are pretty nice) ?

     

    Thanks guys

     

    EDIT : Founds that I should tweak somewhere with the callbacks but I don't really understand how to use it , like there is the lines 

    Entity():registerCallback("onShotHit", "onShotHit")
            Entity():registerCallback("onCollision", "onShotHit")

    But I don't find what's done on callback

  12. So, I went for the shield at first (I'll post the chunk of code about shipyard later) what I found : you can change the color in the shield.frag (in the shader folder) prettry straight forward http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/colors/colors_picker.asp-colorhex=F08080.html is a good way to change the color. But seems others colors can create a but, i'm looking into that.I added this https://www.avorion.net/forum/index.php/topic,3263.0.html and I'm trying to find who is responsible for the shield modification upon impacts, think it's around line 50, not really sure tho.

     

     

     

    Edit : Ship color ain't working correctly, It should have been red , it's green ... still can be changed , it's easy and straight forward too, as soon as you are on the file it's easy to find.

    Edit2 : this time it's better but I need to work on the smoothing because it look like the ship blink when the shields appear.

     

    Edit2 : this wwebsite may be better http://www.december.com/html/spec/colorper.html

  13. Hello fella,

     

    If you want to help I'll write where I'm stuck on the ideas

     

    I played a bit of this cubic game lately and as rts player/code geek I went looking in the LUA to see what can be tweaked.

     

    At first I went there for turrets you know .... But as I used other modification (kinda scavenged some mod really) I decided to make a post where I could share my tweaks.

     

    For now there is no files just the idea/tweaks done.

     

     

     

    Done :

     

    -Improve turrets number

    -Improve loot collection range

    -Improved turret range (still work to be done because it's not work for all the turrets sources only buying and crafting)

    -Improved hyperspace cooldown reduction (lazy me..)

    -Added more strength to pirates and Xsotans (I play in creative so it felt a bit too easy)

     

    -Added the advancedshipyard but I took of the "take time to build a ship" thingy

     

     

     

    Now what I plan to work on :

    -Create a base turret (both kinds) and it goes with the size of the ship, which mean big ship , big base turret number. The upgrade would "only" add xx% of armed or unarmed turret for you to specialize the ship , but no more 10 turret on a capital ship or 600 on the frigate ..... Haven't looked so far so no problems

     

    -I came across a mod which made the shield less bright, i planed on tweaking this one to have a shield which shows vanilla brightness only when and where it's shot (like a good scifi one) Added the mod for less brightness some fine tuning for the color and effect (maybe a color depending on the material?) but I don't know how to locate weapons impacts on the shield

     

    -Wanted to also add to shield the (front, back, sides) shield focus but I thinks it's a bit hard  Haven't looked so far so no problems

     

    -There is existing mods for advanced commands, plan to add more inspired from turret orders like attack torpedoes and figther and also formations, like one you could save your own personal formation you know . Haven't looked so far so no problems

     

    -Had in the idea to make generators hits (or energy containers) a bit more realistic as it goes boom when a railgun hit your 23TW generator bloc. Or like if it's just a part of your ship you got damages like a range of explosion depending on the size of the lost bloc. (Starwars fan need to create some death star with cooling vents on the workshop aye) I know where to add it, it's when the game decide to make wreckage or not of the block but I don't know what function would create a explosion there

     

    -I also want a real thermonuclear torpedos , like one which go kaboom for real, and perk of space don't even need to make a sound. Testing phase

     

    -Maybe if I could, that collision first goes on the shield then on the ship, like you have "impenetrable shields" which stop a torpedo or a blast of cannon but an asteroid you hit at 4km/s will rip your face ... I want to use the asteroid field as a shield/projectiles for a big entrance you know. Haven't looked so far so no problems

     

    -Sector entry point, it feels like cheat that there is only one freaking point of entry, you put your space complex 150km from that point and your fleet in between and you're save for life. just need to switch sectors to go on your city. Haven't looked so far so no problems

     

    -I saw some auto docking mod, which is a nice feature. Haven't looked so far so no problems

     

    -Maybe play with unspeakable weapons like a crazy laser beam which can cut your destroyer in half but take 300 spots 2k crew and a shit load of energy plus you know 50sec to shoot again of something. Haven't looked so far so no problems

     

    -Maybe faster rockets (from the turrets not torpedoes) like it's nice a bit faster would seems more nice and realistic. Haven't looked so far so no problems

     

    -Sellers with a slider on the side and way more turrets/upgrades Haven't looked so far so no problems

     

    -hardcore to do I think but worth the lookup, a frigate attachable to your ship, like a real carrier with like frigates , cargo, miners this kind. Late on the game you have huge fleet but you'd like something else than the drone. An other way is to make possible to improve the drone as you advance in the game like 25M credits to change the drone and it's limited to like 1/100th of your bigger ship (numbers not defined) Haven't looked so far so no problems

     

    -Maybe a upgrade for distance commerce, like you have a legendary 20km fake docking , so no need to bring your huge capital ship that throw the poor station in another sector with a wrong mouse mouvement... Haven't looked so far so no problems

     

    -Another feature also could be to tweak the shipyard as you get a ship (frigate, corvette) loaded with upgrades and turrets but it cost like a awful price to do so like 1000 time the turret seller price. It would be nice for creative and like end game when you'll want to go against my revamped Xsotans Haven't looked so far so no problems

     

    -As said I want to add the capability to the "bad guys" to match you long enough so you can really enjoy a scaled battle where you have to engage all your forces. Could be on the form of an event triggered by the Guardian death where like some sectors in the centers are filled with Xsotans sectors but like city you don't want to attack without preparation and each of them enable Attacks events and each X times a new sector is conquered and so on, so basically you kill the big one and that trigger a massive conter action you'll need to stop if you want to stay in the center. I'm gonna let guys that like to create lore to find a nice sweet story. Haven't looked so far so no problems

     

    -May implement the only one factory, the asteroid mover, and some others mods I come across the forum. Haven't looked so far so no problems

     

     

     

    As of today that's all I have in mind, I'm pretty sure as I fool around in the game or in the code I'll find others idea. You can post yours too it may create others ideas.

     

     

     

    Final point and a bit disappointment source (sorry), as I'm busy IRL nothing insure i'll finish this ever, but as it may never come as a mod package I'm going to try to post my codes as I write them.

     

    For sure I cannot always remember where I scavenged the codes so I don't own the credit for a lot of lines and sorry to the original writes that I don't keep your names in mind.... But it is appreciated !

     

    Have fun and all

    I also started a thread in reddit :

×
×
  • Create New...