Jump to content

[INFO] turretfactory.lua Parameters Info for Modders


Martin Levac

Recommended Posts

-EDIT- TurretTemplate and WeaponTemplate pages from modding wiki

http://avorion-modding.wikia.com/wiki/TurretTemplate

http://avorion-modding.wikia.com/wiki/Weapon

-EDIT-

 

On this page is all the parameters that are used by turretfactory.lua to make turrets: http://stonelegion.com/Avorion/Documentation/TurretTemplate.html

 

There's one called "accuracy". It works fine, but it takes a bit of knowledge of the calculations that are done.

 

For all weapons (except mining and salvaging lasers), the calc is:

 

(True for "ChangeType = StatChanges.Percentage". I'm not sure about "*.Flat", and I don't really care because "*.Percentage" is good enough.)

(indicated = the stats shown in the window to the right)

 

1 point of investable = (indicated / investable) * investFactor

new indicated = indicated + ((indicated / investable) * investFactor * indicated * 0.01 * invested points)

 

So, for example:

 

Indicated = 80

investable = 6

investFactor = 0.5

 

1 point of investable = (80 / 6) * 0.5 = 6.66_%

 

This means for each point invested, indicated will change by 6.66_% of itself. In this case, for 1 point invested, indicated would now be:

 

new indicated = 80 + ((80 / 6) * 0.5 * 80 * 0.01 * 1)

new indicated = 85.33_ (rounded to 85.3)

 

 

 

I used "accuracy" for all appropriate weapons like this:

 

{name = "Steel",  amount = 5,  investable = 100,  minimum = 3,  weaponStat = "accuracy",  investFactor = 0.1,  changeType = StatChanges.Percentage}

The above gives us approximately 0.1% indicated per invested point, because usually accuracy is around 95% more or less.

 

===

 

For mining and salvaging lasers, the calc is different.

 

(True for "ChangeType = StatChanges.Percentage")

 

1 point of investable = indicated * investFactor * 0.1

new indicated = indicated + (indicated * investFactor * 0.1 * invested points)

 

Example modified code:

{name = "High Capacity Lens",  amount = 2,  investable = 10,  minimum = 0,  weaponStat = "reach",  investFactor = 25.0,  changeType = StatChanges.Percentage}

The above gives us, for a common rarity mining laser with a stock 0.75km range, if we invest all 10 points:

 

new indicated = 0.75 + (0.75 * 25 * 0.1 * 10)

new indicated = 19.5km range

 

 

If instead we use "changeType = StatChanges.Flat" (which is default when it's not explicit for mining and salvaging lasers), the calc is:

 

1 point of investable = (indicated * investFactor) / investable

new indicated = indicated + (((indicated * investFactor) / investable) * invested points)

 

Default code:

{name = "High Capacity Lens",  amount = 2,  investable = 6,  minimum = 0,  weaponStat = "reach",  investFactor = 2.0,}

The above gives us, for a common mining laser with a stock range of 0.75km, if we invest all 6 points:

 

new indicated = 0.75 + (((0.75 * 2) / 6) * 6)

new indicated = 2.25km range

 

===

 

I tried to use several other variables, none have worked for me but I don't know why. "heat" and everything related to heat or cooling doesn't work. "turningSpeed" doesn't work, but oh how I wish I could make it work. "tech" and everything related to tech doesn't work. "size" doesn't work. Didn't try the others like energy consumption stuff so I can't say if they work. Didn't fool around with "rarityFactor", or "*.toNextLevel" or any other stuff in that file, I'm not that knowledgeable.

Link to comment
Share on other sites

Been playing with this today myself, I've been reducing the potential of turret factories to not make stupid powerful turrets however still can make very good exceptional level stuff but exotic / legendary found stuff can be better so finding stuff is still an option and not ruined.

 

I just dunno how to fix the problem where stats are decreased when you add more materials. That lame bug lol

 

I'm also trying to figure out how to mod the dropped items to have more potential to them making good drops more desired

Link to comment
Share on other sites

The fix for decreasing stats is to add "changeType = StatChanges.Percentage" to the stat with the problem. For example, mining lasers have this line for damage:

 

{name = "Laser Compressor",     amount = 5,    investable = 6,  minimum = 1,    weaponStat = "damage", }

Add "changeType = StatChanges.Percentage" like this:

{name = "Laser Compressor",     amount = 5,    investable = 6,  minimum = 1,    weaponStat = "damage",   changeType = StatChange.Percentage }

And it will fix the problem.

Link to comment
Share on other sites

So it seems the negative stats havent been fixed in latest patch? My Turret factory script never changed when the game updated.

 

So I have just been fixing it myself with the stat percent thing. Also I been making turret factories not stupid powerful however can still produce very strong weapons at much more cost but finding / researching exotic / legendary that can possibly surpass turret factories is possible (hopefully) lol, some screens of this tech 35 factory with my changes.

 

 

2yju060.jpg

 

 

245124p.jpg

 

 

e7e2k3.jpg

 

 

125on40.jpg

 

 

mhyq8h.jpg

 

 

rjf508.jpg

 

 

So far no more bazillion omnicron weapon cheating lol. Still some very good weapons, but was way to cheesy to get 4k dps lasers and just go build 40+ of them.

 

Although thats a sweet Launcher but as you can see, would take quite a bit of work to go and mass that :) .. I didn't really touch launcher to much yet, trying to get a good feel for each weapon where a good balance would be for it by a turret factory to make it still worth making but not the holy grail of weapons.

 

I also buffed Xsotan / pirates lol, use to fight 100k hp aliens at tech 35 area.. now a few so far were 350-400k hp, with triple the weapons. Hooraw!

 

Edit: I think I know whats changed.. the crazy bonuses have been reduced. I am no longer getting crazy high bonuses on stuff, my salvage turrets I was going to build had crazy bonus to efficiency giving it 49%.. thats gone now and gets 39%. Perhaps this was the "fix"

 

Edit2: I tinkered with launcher, now its 900.4dmg, 3.4 fire rate, 9.32 range. It started with very high base and is much superior to other launchers I am seeing at other factories. So this seems fair, its really costly anyways but is 3,061dps. The base to max increase was fair and not overpowered. Just the weapon itself was overpowered to begin with lol

Link to comment
Share on other sites

I figured out why some parameters didn't work. There's two sets of parameters for turrets, weaponStat and turretStat.

 

weaponStat info page: http://stonelegion.com/Avorion/Documentation/Weapon.html

turretStat info page: http://stonelegion.com/Avorion/Documentation/TurretTemplate.html

 

-EDIT- Pages above no longer work. Updated first post with working pages. - EDIT-

 

See example here with default code:

{name = "High Capacity Lens",   amount = 2,   investable = 4,   weaponStat = "reach",   investFactor = 2.0, }

{name = "Laser Modulator", amount = 2, investable = 4, turretStat = "energyIncreasePerSecond", investFactor = -0.2, changeType = StatChanges.Percentage }

The above is for lasers. Note "reach" is weaponStat, while "energyIncreasePerSecond" is turretStat.

 

When I tried "turningSpeed", it was "weaponStat" and it didn't work it broke the game:

{name = "Aluminium",   amount = 7,   investable = 10,   minimum = 3,   weaponStat = "turningSpeed",   investFactor = 0.1,   changeType = StatChanges.Percentage }

I just tried this below with "turretStat", it works, but I didn't test if it actually changes tracking speed so I'll do that and report back:

{name = "Aluminium",   amount = 7,   investable = 10,   minimum = 3,   turretStat = "turningSpeed",   investFactor = 0.1,   changeType = StatChanges.Percentage }

 

I believe that the other parameters I tried didn't work for the same reason, so I'll try those with "turretStat" when I get to it and report back.

Link to comment
Share on other sites

I tried "turningSpeed" and it works really nice, but if it's too high the twitch problem is made much worse. When the turret twitches, one or two bullets fly off at absurd angles even when "accuracy" is 99.9%. I figure the other parameters should work too, so I won't be reporting on those unless I find one that doesn't work.

Link to comment
Share on other sites

  • 2 weeks later...

Turret Size Works!!!!

 

I just made a size 2 railgun, installed it, works just like a normal size 0.5 railgun. Code I used:

{name = "Copper",   amount = 2,   investable = 50,   minimum = 1,   turretStat = "size",   investFactor = 10.0,   changeType = StatChanges.Percentage }

 

Code above can make a size 5.5 turret, if indicated size is 0.5. Normally default size is determined by tech level and weapon type. For example, mining lasers are smaller than salvage lasers at same tech level, i.e. 0.3 vs 0.5 at TL36.

 

All other variables remained the same, i.e. it didn't change tech level or dps or anything else, just size changed to indicated. I don't know if recoil is affected so that's something to test.

Link to comment
Share on other sites

The size parameter code I used in the previous post is for the window on the right. I'd prefer to do it with the window on the left (where type and rarity is changed), and size scaled everything else related to size. The left side menu stuff is in the file but somebody else would need to figure that out.

 

Bear in mind that size changes everything cubed, so if it's 2x the size, it's 8x the volume/mass(for ingredients maybe?)/etc. This means a great deal of difference for heat/energy weapons like cannons and lasers for example. It should affect firerate for cannons especially because of heat, but it should also affect it for other weapons, so that even though dps scales up, firerate scales down. So, while we could make bigger guns, total dps output would not scale in a linear fashion.

Link to comment
Share on other sites

 

I just dunno how to fix the problem where stats are decreased when you add more materials. That lame bug lol

 

 

Call me a math noob...but can't you just whack a '-' somewhere in the calc to flip it around (or remove one thats breaking it)?

Link to comment
Share on other sites

I've used the size parameter for a while now and I found a problem with it. The turret and weapon(s) change size, but the lateral (side to side) position of the weapons, when more than one, doesn't change so that if it's big enough, the weapons merge/clip into each other to become just one, misshaped larger weapon. I thought it was a fluke at first, then I made two of the same turrets (double cannon type) in different sizes and noticed that the bigger one looked pretty much like a single barrel while the smaller one had these tiny slits on each side of the barrel, then it hit me - changing size does not change weapon position on the turret. The weapon's height does change so vertical position appears to scale properly. Otherwise the turrets/weapons work normally, so it's just an aesthetics problem.

 

I guess when somebody decides to make a mod that scales other parameters with size, this would have to be addressed as well if possible.

Link to comment
Share on other sites

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...