Mattoropael Posted March 9, 2018 Share Posted March 9, 2018 Simply put, something similar to [MOD][OPW] Overpowered Weaponry but for torpedoes. I tried jury-rigging a command script from entitydbg.lua without much success. Didn't even get to mixing in customized elements like OPW - I failed at the stage of separating the "Add Torpedo" spawn script from entitydbg.lua into a functional chat command. Link to comment Share on other sites More sharing options...
Laserzwei Posted March 10, 2018 Share Posted March 10, 2018 Create 2 new files: /scripts/commands/torpedo.lua /scripts/player/torpedo.lua /scripts/commands/torpedo.lua : package.path = package.path .. ";data/scripts/lib/?.lua" package.path = package.path .. ";data/scripts/player/?.lua" function execute(sender, commandName, warhead) local ship = Player(sender).craft ship:addScriptOnce("data/scripts/player/torpedo.lua") ship:invokeFunction("data/scripts/player/torpedo.lua", "start", sender, commandName, warhead) return 0, "", "" end function getDescription() return "/torpedo [type]" end function getHelp() return "soo many torpedos" end /scripts/player/torpedo.lua : package.path = package.path .. ";data/scripts/lib/?.lua" local torps = { Nuclear = 1, Neutron = 2, Fusion = 3, Tandem = 4, Kinetic = 5, Ion = 6, Plasma = 7, Sabot = 8, EMP = 9, AntiMatter = 10, } function initialize() end function start(sender, commandName, warhead) if not torps[warhead] then warhead = "Nuclear" end local ship = Player(sender).craft local TorpedoGenerator = require("torpedogenerator") local x, y = Sector():getCoordinates() local torpedo = TorpedoGenerator.generate(0, 0, nil, nil, torps[warhead]) --stats ---general properties torpedo.rarity = Rarity(RarityType.Legendary) torpedo.tech = torpedo.tech torpedo.size = torpedo.size -- body properties torpedo.durability = torpedo.durability torpedo.turningSpeed = torpedo.turningSpeed torpedo.maxVelocity = torpedo.maxVelocity torpedo.reach = torpedo.reach -- warhead properties torpedo.shieldDamage = torpedo.shieldDamage torpedo.hullDamage = torpedo.hullDamage * 100 torpedo.shieldPenetration = torpedo.shieldPenetration --[true or false] torpedo.shieldDeactivation = torpedo.shieldDeactivation --[true or false] torpedo.shieldAndHullDamage = torpedo.shieldAndHullDamage --[true or false] torpedo.energyDrain = torpedo.energyDrain --[true or false] torpedo.storageEnergyDrain = torpedo.storageEnergyDrain torpedo.damageType = DamageType.Physical torpedo.acceleration = torpedo.acceleration -- reach max velocity after 10km of travelled way if warhead.damageVelocityFactor then -- scale to normal dps damage dependent on maxVelocity torpedo.damageVelocityFactor = torpedo.damageVelocityFactor torpedo.maxVelocity = torpedo.maxVelocity torpedo.hullDamage = 0 end -- torpedo 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 -- see /lib/torpedogenerator.lua for more local launcher = TorpedoLauncher() if launcher == nil then return end local shafts = {launcher:getShafts()} for _, shaft in pairs(shafts) do for i = 1, launcher:getMaxTorpedoes(shaft) do launcher:addTorpedo(torpedo, shaft) end end --torpedo storage --[[for j = 1, 50 do launcher:addTorpedo(torpedo) end]] terminate() end Ingame type /torpedo enjoy Link to comment Share on other sites More sharing options...
Mattoropael Posted March 10, 2018 Author Share Posted March 10, 2018 Create 2 new files: /scripts/commands/torpedo.lua /scripts/player/torpedo.lua /scripts/commands/torpedo.lua : package.path = package.path .. ";data/scripts/lib/?.lua" package.path = package.path .. ";data/scripts/player/?.lua" function execute(sender, commandName, warhead) local ship = Player(sender).craft ship:addScriptOnce("data/scripts/player/torpedo.lua") ship:invokeFunction("data/scripts/player/torpedo.lua", "start", sender, commandName, warhead) return 0, "", "" end function getDescription() return "/torpedo [type]" end function getHelp() return "soo many torpedos" end /scripts/player/torpedo.lua : package.path = package.path .. ";data/scripts/lib/?.lua" local torps = { Nuclear = 1, Neutron = 2, Fusion = 3, Tandem = 4, Kinetic = 5, Ion = 6, Plasma = 7, Sabot = 8, EMP = 9, AntiMatter = 10, } function initialize() end function start(sender, commandName, warhead) if not torps[warhead] then warhead = "Nuclear" end local ship = Player(sender).craft local TorpedoGenerator = require("torpedogenerator") local x, y = Sector():getCoordinates() local torpedo = TorpedoGenerator.generate(0, 0, nil, nil, torps[warhead]) --stats ---general properties torpedo.rarity = Rarity(RarityType.Legendary) torpedo.tech = torpedo.tech torpedo.size = torpedo.size -- body properties torpedo.durability = torpedo.durability torpedo.turningSpeed = torpedo.turningSpeed torpedo.maxVelocity = torpedo.maxVelocity torpedo.reach = torpedo.reach -- warhead properties torpedo.shieldDamage = torpedo.shieldDamage torpedo.hullDamage = torpedo.hullDamage * 100 torpedo.shieldPenetration = torpedo.shieldPenetration --[true or false] torpedo.shieldDeactivation = torpedo.shieldDeactivation --[true or false] torpedo.shieldAndHullDamage = torpedo.shieldAndHullDamage --[true or false] torpedo.energyDrain = torpedo.energyDrain --[true or false] torpedo.storageEnergyDrain = torpedo.storageEnergyDrain torpedo.damageType = DamageType.Physical torpedo.acceleration = torpedo.acceleration -- reach max velocity after 10km of travelled way if warhead.damageVelocityFactor then -- scale to normal dps damage dependent on maxVelocity torpedo.damageVelocityFactor = torpedo.damageVelocityFactor torpedo.maxVelocity = torpedo.maxVelocity torpedo.hullDamage = 0 end -- torpedo 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 -- see /lib/torpedogenerator.lua for more local launcher = TorpedoLauncher() if launcher == nil then return end local shafts = {launcher:getShafts()} for _, shaft in pairs(shafts) do for i = 1, launcher:getMaxTorpedoes(shaft) do launcher:addTorpedo(torpedo, shaft) end end --torpedo storage --[[for j = 1, 50 do launcher:addTorpedo(torpedo) end]] terminate() end Ingame type /torpedo enjoy This works well for my purposes, thanks a lot. Link to comment Share on other sites More sharing options...
NovaBreaker Posted March 30, 2018 Share Posted March 30, 2018 I'm just gonna grab this, you should upload this as a mod file. Link to comment Share on other sites More sharing options...
NovaBreaker Posted April 1, 2018 Share Posted April 1, 2018 RETRACTED, i had a stupid moment. Link to comment Share on other sites More sharing options...
NovaBreaker Posted February 20, 2019 Share Posted February 20, 2019 So others don't make the same mistake, this no longer works. Link to comment Share on other sites More sharing options...
fordhamflash Posted April 13, 2019 Share Posted April 13, 2019 I would love something like this. But doesn't look like that posted code is currently working. I tried playing around with torpedos and got nowhere. Link to comment Share on other sites More sharing options...
fordhamflash Posted July 9, 2019 Share Posted July 9, 2019 P.S. with a little modification, the above mod works like a champ in the current version. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now