Jump to content

[Help] Turret recoil reduction/Turret Resizing


Unlucky

Recommended Posts

Turret size is a property of the turret entity, and recoil is a property of the weapons that make up the turret.

 

 

Stick this in a command and play around with it to make any turret you want.

 

package.path = package.path .. ";data/scripts/lib/?.lua"
require ("turretgenerator")


function execute(sender, commandName, ...)

--(seed,weaponType,dps,techLevel,rarity,material)
local TurretTemplate T = GenerateTurretTemplate(random():createSeed(), WeaponType.Bolter, 150, 40, Rarity(4), Material(MaterialType.Ogonite))

--table containing the weapons that make up the turret
local weapons = {T:getWeapons()}

--clear old weapons from turret
T:clearWeapons()

--modify weapons
for _,weapon in pairs(weapons) do
	weapon.damage = 1000
	weapon.fireRate = 3
	weapon.recoil = weapon.recoil*0.2

	--add mofidied weapons to turret
	T:addWeapon(weapon)
end



--change properties of turret
T.automatic = true
T.size = 0.5

Player(sender):getInventory():add(InventoryTurret(T))
end

function getDescription()
    return ""
end

function getHelp()
    return ""
end

 

Link to comment
Share on other sites

for _,weapon in pairs(weapons) do
	weapon.damage = 1000
                weapon.reach = 100 -- visual works only in the description

	--add mofidied weapons to turret
	T:addWeapon(weapon)
end

 

weapon.reach changes the distance only in the description, in the turret remains the standard distance, bug?

Link to comment
Share on other sites

  • 2 months later...

I found out how to make a tractor beam.

 

package.path = package.path .. ";data/scripts/lib/?.lua"
require ("turretgenerator")


function execute(sender, commandName, ...)

--(seed,weaponType,dps,techLevel,rarity,material)
local TurretTemplate T = GenerateTurretTemplate(random():createSeed(), WeaponType.ForceGun, 0, 100, Rarity(5), Material(MaterialType.Avorion))

--table containing the weapons that make up the turret
local weapons = {T:getWeapons()}

--clear old weapons from turret
T:clearWeapons()

--modify weapons
for _,weapon in pairs(weapons) do
	weapon.recoil = weapon.recoil*0.01
	weapon.blength = weapon.blength*5.0
	weapon.reach = 500
	weapon.otherForce = -1500000
	weapon.selfForce = 0
	--add mofidied weapons to turret
	T:addWeapon(weapon)
end



--change properties of turret
T.automatic = true
T.size = 1
Player(sender):getInventory():add(InventoryTurret(T))
end

function getDescription()
    return ""
end

function getHelp()
    return ""
end

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...