Avorion Forum

General => Mods => Topic started by: lyravega on February 09, 2017, 06:10:49 AM

Title: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 09, 2017, 06:10:49 AM
Detailed Turret Tooltips - v0.023
Alters the turret tooltips to give much more information to the player, aiming to make weapon comparisons easy. There are so many changes, take a look at the screenshot under features if you haven't! Some users of the mod have stated that this is required only on the clients, for your information.

Spoiler: "Features & Terminology" • show
(http://images.akamai.steamusercontent.com/ugc/158027122742938355/F086EFC062D406BC82E999A50B39622FAF229BED/)

DPS Calculations
• DPS: Your usual DPS. Shown for weapons that do not overheat
• EDPS (Effective DPS): Takes cooldown into account, and replaces DPS stat for any weapon that can overheat

Turrets with Heat Mechanic
• Uses EDPS
• Buildup: Heat per shot stat in the middle, and "time to heat" (0 > 100+) in seconds on the right
• Cooldown: Cooling per second in the middle, and "time to cooldown" (100+ > 0) in seconds on the right

Burstfire Turret Stats
• Uses EDPS
• Burst Damage: Displays "projectiles per burst"x"damage per projectile", replaces "damage"
• Burst Cycle: Time between bursts (overheat + cooldown), replaces "fire rate"

Energy Turret Stats
• Split into two; energy turrets that drain battery, and energy turrets that consume power directly - at the end both has the same effect but the way they do it is different)
• Base Drain/Demand: Initial usage for the energy weapons, recalculated to reflect the actual usage
• Accumulation Rate: Cost increase per second/shot, recalculated to reflect the actual increase
• Normalization Rate: Cost decrease per second, added as an extra stat
note: as you keep firing the energy weapons, their cost will increase (accumulation as I call it), and when you stop firing them, their cost will return back to base (normalization as I call it)

Beam Turret Stats
• Tick Rate: Replaces "Fire Rate", how many times the beam will strike the target in a second. For fluff mostly
• Tick Damage: How much damage each tick will do to the target. For fluff mostly

Shield/Hull bonuses
• If present, these will split the damage values into two, displaying both values instead of a single value

Extra Stats
• Velocity: Muzzle Velocity; how fast the projectile travels
• Tracking Speed: How fast the turret turns (unit unknown)
• Range: Range is calculated instead of taken for granted
• Shield Penetration: The vanilla shield penetration chance, moved to a relative position
• Hull Penetration: The somewhat hidden value for Railguns; how many blocks they can penetrate
• Multiple Projectiles (if applicable): How many projectiles each weapon will fire (from vanilla, you saw this as DMGx2 etc...)
• Synchronized Weapons (if applicable): How many weapons that the turret will fire (was missing from vanilla, NOT the same as above)

Merged Stats
• If a Salvaging beam has "+hull damage%" then this is added to the "Salvaging" stat
• Mining beams include the +20000% bonus in their "Mining" stat

Some extra info
• Like, if the weapon consumes power or generates heat (duh)
• Or, that the mining/salvaging beams deals no damage to shields

Look Overhaul
• WIP. So far looks alright in my opinion, but as I've said: WIP. Any suggestions are welcome!
• Moved "Tech" and "Material" above
• Painted stuff a little bit
• Renamed a lot of stuff
• Added units (if known)
• etc... etc... a picture tells a thousand words they say, so check the screenshot out if you haven't!

...and a few more that I forgot while writing/editing this

Spoiler: "Notes" • show
-There are 2 cases where EDPS is slightly inaccurate. But from 0 to 100, or 100 to 0, I'd say accuracy of calculations are over 99%. The first case is, latency/game tickrate (?) causing you to fire an extra or a less shot. The second case is, overheated weapons do not have to fully cooldown in order to fire again.

• Energy weapons are weird. Especially the continuous ones. I tried my best to figure them out, and result portrays closer stats to the ship stats that you can see by checking power consumption and such.

• Force turrets are weird as well. I displayed my own results instead of the game's results because vanilla tooltips can show positive force for the turret as a whole while the individual weapons may have negative force which makes absolutely no sense.

Spoiler: "Change Log" • show
v0.024
• Fixed cargo / crew shuttles

v0.023
• Mirrored lines from the vanilla tooltipmaker.lua

v0.021
• For cases where a turret/fighter is spawned without any weapons, added a failsafe that'd keep the mod from getting set to invalid by the game
• Mirrored an (so far) unused line from the vanilla tooltipmaker.lua

v0.020
• Added "Shield Penetration" and "Hull Penetration" stats
• Added info for weapons that are ineffective against stone (basically, all lightning weapons)
• Fixed "Tick Damage" showing incorrect values for applicable weapons (apparently, Tesla Guns can have "Synchronized Weapons", unlike any other continuous beam)
• "Range" is now calculated (it'll show correct range values for crafted weapons; a bug prevents real range from being altered for them, I'll make a fix/mod for turretfactory.lua later on fix for turretfactory.lua (http://www.avorion.net/forum/index.php/topic,1984.0.html))
• "Force" stats now display the individual weapon force; for some reason turret stats show wildly different things (different things as in tooltip showing positive turret force while the weapon force is actually negative)

v0.012
• Corrected DPS for turrets that overheat in one shot, also these turrets display "Instant" for "Buildup" stat instead of 0
• Moved some stuff to the bottom of tooltips (colorful-special stuff like "Independent Targeting")

v0.011
• Hull Damage icon is not a shield icon anymore
• (Hopefully) Some weapons that caused an issue (blank tooltips, no buy/sell options) shouldn't cause them anymore

v0.010
• Cleaned the code up a little bit
• Renamed stuff in, cleaned and beautified the tooltip a little bit
• Added Hull/Shield damage calculations if the weapon has any bonus for those
• Merged some stats; the stone damage bonus is added to "Mining", and hull damage bonus (if the turret has any) is added to "Salvaging"
• Added a few (just two) info tooltips; Mining and Salvaging turrets are ineffective against shields, energy weapons use the energy in different ways
• Corrected energy drain/demand calculations
• Changed how burst damage looks; instead of showing total damage, now shows #projectiles fired before overheating and damage per projectile
• Corrected a potential bug related to overheating weapons
• etc... a few more stuff under the hood

Spoiler: "Known Issues" • show
• When adjusting turret parameters for a turret with eDPS in a turret factory, it may look weird when the fire rate goes up but eDPS stays the same. This is not an issue; the turret overheats faster, and enters the cooldown period quicker, and as the eDPS also takes these cooldown periods into account, the overall DPS for one firing cycle actually doesn't change. I thought this was a mistake that I made at first, but ran a few calculations with hand and was surprised to see the results.

• If you are trying to create a fighter and the fighter creation UI locks up, it's possible you are using the wrong version. As stated in the last sentence, if you are on the beta branch, use the latest version, if you are on the normal (default, stable) branch, use the previous version.

• If the game is crashing when looking at a tooltip, it is a game bug, not a mod bug. When the game detects that something is wrong in a mod, it'll simply set it to invalid and that part of the game won't function. For example, as this mod deals with weapon tooltips, if something was wrong, it'd show a blank tooltip but everything else would work fine.

TL;DR: Game crashes related to tooltips are not caused by this mod.

Spoiler: "Report a Bug" • show
• Take a look at the "Known Issues". It might be something I've written there.

• If not, the best you can do is providing as much information as you can also with a game log attached to it. You can find the game logs in %AppData%\Avorion folder, either query it on Windows Search (from Start Menu) or enter it as a location on Windows Explorer. You can see multiple text files, grab the latest one, and upload it over here so I can take a look at it.


NOTE: The mod is outdated, and will not show "Slots" value for turrets. Will show nothing for torpedoes. An update is slowly coming.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Kane Hart on February 09, 2017, 06:14:42 AM
Oh damn another one. Yours seems a bit more detailed but also a bit harder on the eyes to follow but sweet stuff.

There was another one today but it's not as detailed:
http://www.avorion.net/forum/index.php/topic,1626.0.html

Glad to see you guys and girls pumping out the mods :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 09, 2017, 06:20:13 AM
Oh damn another one. Yours seems a bit more detailed but also a bit harder on the eyes to follow but sweet stuff.

There was another one today but it's not as detailed:
http://www.avorion.net/forum/index.php/topic,1626.0.html

Glad to see you guys and girls pumping out the mods :)

I had to put some unnecessary stuff in to keep the stats aligned from weapon type to weapon type. Put the most important stat on the top though; DPS. For now I'm happy because I wasn't able to play the game for 2 days as I was trying to finish this up heheh. But I'll clean it up later on. So far, as I've said in the title, happy with the progress to share.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Kane Hart on February 09, 2017, 07:35:10 AM
Yup I think it's great. Everything will get adjusted overtime. I know the longest time I was so confused from weapon a to weapon b etc. I just put them on and watch how bad they were and then just went with whatever I felt was good.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: WARGAMES on February 09, 2017, 07:50:06 AM
I love this in all the info gleaned.  it's amazing.  it's like looking at game ini files but in-game all over again from C&C games but with dps perspectives.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: LoSboccacc on February 09, 2017, 08:11:56 AM
Is this client only right?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 09, 2017, 09:17:46 AM
Some progress on the cleanup, could use your opinion
http://steamcommunity.com/sharedfiles/filedetails/?id=860138389

Yup I think it's great. Everything will get adjusted overtime.
Any opinion on the cleanup progress linked above?

I love this in all the info gleaned.  it's amazing.  it's like looking at game ini files but in-game all over again from C&C games but with dps perspectives.
Heheh, thanks.

Is this client only right?
Don't know how multiplayer works for this game, so I'm not sure. This mod only alters 1 file that generates tooltips.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Kane Hart on February 09, 2017, 09:34:22 AM
Looking better but there is so much info that it makes a bit hard to know what your looking at. Maybe color code some the more critical information like the main dps is what most want to see for example.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: LordHavoc on February 09, 2017, 02:55:18 PM
YES!
A way to determine which guns are good or not!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: WARGAMES on February 09, 2017, 11:43:22 PM
what's with the "damage x" and the next line "/shot"?  mostly the /shot part as it looks confusing after reading damage x
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Berkys32 on February 10, 2017, 08:22:07 AM
So synchronized weapon means its DPS is divided into all shots? And same for multiple projectiles?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: eastwood6510 on February 10, 2017, 10:24:06 AM
Love this. Going to test it out now

Edit: Been testing this, this is perfect!

All we need now is a way to sort our turrets automatically by the actual 'dps' instead of just having to sort by "damage" (which more often than not as it turns out, is extremely unreliable)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 10, 2017, 05:09:21 PM
what's with the "damage x" and the next line "/shot"?  mostly the /shot part as it looks confusing after reading damage x

It is a typo. "Damage"..."/shot" means damage per shot for example.

So synchronized weapon means its DPS is divided into all shots? And same for multiple projectiles?

The topmost damage number includes all extra shots. The second damage number may have "4xDMG"; this is either due to Synchronized Weapons or Multiple Projectiles or combination of both.

Love this. Going to test it out now

Edit: Been testing this, this is perfect!

All we need now is a way to sort our turrets automatically by the actual 'dps' instead of just having to sort by "damage" (which more often than not as it turns out, is extremely unreliable)

I'll look into that!



I've been playing the game and encountered a turret factory cluster, good for testing. I noticed that increasing fire rate doesn't change weighted damage, so I ran through my calculations again to double check and found out this is correct but I feel like I need to point this out somehow. Less fire rate means the turret will cooldown more between each shot, allowing more shots to be fired, but it'll also increase the length of a cycle (cycle being "time to overheat" + "time to cooldown") resulting in same weighted damage numbers.

Also, turret factories are fun. You can get weapons with 0 fire rate, -damage, -mining, etc... Good stuff :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: FreddyAVO on February 10, 2017, 09:18:55 PM
Nice mod deffinitly going to use. very handy with my own modified dps weapons and stuff
For those that areactually interrested in what the change is
https://www.diffchecker.com/QJjNR6eJ (https://www.diffchecker.com/QJjNR6eJ)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 11, 2017, 07:22:34 AM
New version up!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: LoSboccacc on February 11, 2017, 11:15:09 AM
what changed? btw in previous version the popup for turrets also opened when hovering on an enemy turret, don't know if it's intended or not
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 11, 2017, 05:47:08 PM
what changed? btw in previous version the popup for turrets also opened when hovering on an enemy turret, don't know if it's intended or not

Uhh... I don't know what causes that, never noticed it myself while playing. Could be a vanilla bug?

Changes are:
-Cleaned the code up a little bit
-Renamed stuff in and cleaned the tooltip a little bit
-Added Hull/Shield damage calculations if the weapon has any bonus for those
-Merged some stats; the stone damage bonus is added to "Mining", and hull damage bonus (if the turret has any) is added to "Salvaging"
-Added a few (just two) info tooltips; Mining and Salvaging turrets are ineffective against shields, energy weapons use the energy in different ways
-Corrected energy drain/demand calculations
-Changed how burst damage looks; instead of showing total damage, now shows #projectiles fired before overheating and damage per projectile
-Corrected a potential bug related to overheating weapons (haven't seen any, but if a weapon can overheat in one shot, code covers it as well but it had a bug)
-etc... a few more stuff under the hood
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 11, 2017, 10:08:16 PM
Appreciate the effort. Just want to give you a heads up that your mod does not work with the current beta. I just get blank tooltips unfortunately. Attached is the tooltipmaker.lua from the beta for reference.

Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 12:05:28 AM
Appreciate the effort. Just want to give you a heads up that your mod does not work with the current beta. I just get blank tooltips unfortunately. Attached is the tooltipmaker.lua from the beta for reference.

The file you attached matches the current version's original "tooltipmaker.lua". I am already on beta branch on Steam, I haven't seen blank tooltips popping. Any other mods you're using?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Tiberiumkyle on February 12, 2017, 12:07:51 AM
On beta branch, while I'm not getting blank tooltips, the mod only appears to work on stuff in shops, not stuff in build mode, personal inventory, or ship info.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 12:10:05 AM
On beta branch, while I'm not getting blank tooltips, the mod only appears to work on stuff in shops, not stuff in build mode, personal inventory, or ship info.

It should work the same everywhere; there is one "tooptipmaker.lua" that handles all the turret tooltip generations. Just checked the game again, on build mode, personal inventory, shop, turret factory, etc... works everywhere for me?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 12:15:18 AM
I'm going to go back to normal branch, verify stuff, grab the .lua file, go to beta, verify again, grab the beta's .lua file and compare them again then do the same with the mod to be sure.

edit: Nah. Everything is working fine on my end, on both the current and the beta versions.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Tiberiumkyle on February 12, 2017, 12:34:29 AM
This is quite strange, then. I don't have anything else that should be messing with tooltips, so idk wtf is going wrong. Nothing in logs.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 12, 2017, 01:24:09 AM
I just started a new game, still using current beta (there was an update today to the beta btw, and I am using the newest version), and still having the blank tooltips in several modes. It did seem to work when viewing turrets in the equipment shop though. Now I do have a ton of stuff modded, both others plus my own changes. But I cant think of anything that would touch tooltipmaker. Also, your mod was the most recent I installed.  I also tried full screen versus windowed, no difference. Mystery for sure.

Update, log shows tooltip errors related to it. See attached.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 01:54:48 AM
Thanks for the log
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 12, 2017, 02:05:28 AM
I suspect it is related to this mod:  http://www.avorion.net/forum/index.php/topic,781.0.html

When I put your tooltipmaker.lua in, it messes up the equipment dock for some reason. Now, I used his mod to build that equipment dock, and with your tooltipmaker installed, it changes the equipment dock interface so I cannot even buy turrets. I am guessing his mod alters the interaction somehow, but I am no lua expert, just a hacker heh. Just a theory though, but if I am one of the only one ones with issues, I assume it is one of my mods messing it up.

Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 02:08:16 AM
I just started a new game, still using current beta (there was an update today to the beta btw, and I am using the newest version), and still having the blank tooltips in several modes. It did seem to work when viewing turrets in the equipment shop though. Now I do have a ton of stuff modded, both others plus my own changes. But I cant think of anything that would touch tooltipmaker. Also, your mod was the most recent I installed.  I also tried full screen versus windowed, no difference. Mystery for sure.

Update, log shows tooltip errors related to it. See attached.

Alright, I've put up a new version, saw my error on that line, again thanks for the log. Though, what kind of a weapon is that? Overheats in one shot? If I can get your save with that turret with broken tooltip, I'd really appreciate that - I mean I've never encountered such a weapon, I tried to account for such but while renaming stuff in the code forgot one line apparently and hopefully it is the one that is causing all these issues.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 02:14:44 AM
I suspect it is related to this mod:  http://www.avorion.net/forum/index.php/topic,781.0.html

When I put your tooltipmaker.lua in, it messes up the equipment dock for some reason. Now, I used his mod to build that equipment dock, and with your tooltipmaker installed, it changes the equipment dock interface so I cannot even buy turrets. I am guessing his mod alters the interaction somehow, but I am no lua expert, just a hacker heh. Just a theory though, but if I am one of the only one ones with issues, I assume it is one of my mods messing it up.

Nah it is probably my mod. When the tooltips are broken, anyone selling a turret with a broken tooltip won't have a buy/sell option. I saw my mistake and fixed it hopefully, but I really wish I could get my hands on such a weapon for testing purposes.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 12, 2017, 02:33:58 AM
Great job, you fixed it!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 03:07:58 AM
Great job, you fixed it!

Oh I'm glad to hear! By the way, if you encounter a weapon that overheats in one shot, please take a screenshot of it for me :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 12, 2017, 10:05:15 AM
Maybe this is the one. See attached pic.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 10:31:47 AM
Maybe this is the one. See attached pic.

Yup, that's it alright. Thanks, nice to know these exist :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 12, 2017, 10:35:04 AM
Here is a link to my save game if you want to test it. I stripped out all the sectors except the current, as well as faction data, to cut down on file size. Not sure it will work for you though since I have a bunch of mods running.

http://www.filedropper.com/operationsstorm


Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 10:45:04 AM
Here is a link to my save game if you want to test it. I stripped out all the sectors except the current, as well as faction data, to cut down on file size.

http://www.filedropper.com/operationsstorm

Thanks, I will look at it when I am able to. Also noticed another bug from that screenshot. Since the weapon overheats instantly, its cooldown time can become its fire rate but apparently I forgot to recalculate dps. That weapon definitely isnt powerful :d
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MonsterMod on February 12, 2017, 02:36:21 PM
Ya it is not a very good weapon in reality. It was hitting salvage for about 3-4k and had a long cooldown time...time for the scrapheap!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 08:29:06 PM
Ya it is not a very good weapon in reality. It was hitting salvage for about 3-4k and had a long cooldown time...time for the scrapheap!

Yep :) I fixed it but I'll upload the fix tomorrow, would like to play a bit and see if I can catch another bug/incorrect value before posting another update.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Devious on February 12, 2017, 08:44:12 PM
I like the changes you made, it looks a lot better now!
Will give it a try now you fixed the issue with the equipment docks.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: LoSboccacc on February 12, 2017, 09:33:57 PM
would it be possible to add some energy efficiency lines for energy consuming weapons? like dps/energy at max power draw?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: WARGAMES on February 12, 2017, 09:44:11 PM
I see I missed out on some stuff, and it looks much cleaner now.  who knows maybe this could come in handy for the dev to rebalance weapon rng stats that drop in the future.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 10:07:23 PM
Uploaded v0.012 with some minor visual changes, and fixes for some specific weapons (turrets that overheat in one shot)

would it be possible to add some energy efficiency lines for energy consuming weapons? like dps/energy at max power draw?

The thing is, there is no max power draw :D They can shoot as long as you have the energy generation & reserves to supply them. And there is no way I can get the ship power stats unfortunately. Best way to check them out is looking at your energy consumption, and not just the base energy drain but accumulation. Accumulation is more important in my opinion, high accumulation means it'll reach a higher energy usage in shorter time. You can sustain energy weapons with low accumulation without any issues.

I see I missed out on some stuff, and it looks much cleaner now.  who knows maybe this could come in handy for the dev to rebalance weapon rng stats that drop in the future.

Thanks. Weapons that generate heat usually seems to be on the weak side. Best weapons I've found are chainguns without heat mechanics or never overheat, and laser turrets with miniscule energy costs.

I like the changes you made, it looks a lot better now!
Will give it a try now you fixed the issue with the equipment docks.

Thanks :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 12, 2017, 10:55:45 PM
*sigh* Gotta love finding new stuff after I post a new version. Not something I caused this time though, look at this screenshot (at the bottom, something is in a red box).

http://images.akamai.steamusercontent.com/ugc/158026921452974105/4EF437E91E0FE0A7EE33CBAB65ACF23BF85ED73E/

This turret has negative "accumulation"; its energy cost is always the same. Just a vanilla bug, but I'll hide weird numbers in mod's next version sometime later, enough versions for a day. I need to figure out how these type of energy weapons exactly work anyway. It is very similar to heat, but the vanilla numbers and what I can tell are different and it is very confusing.

edit: Yeah, no accumulation. The weapon always uses the same energy, it doesn't increase. Not sure if bug or intended though, maybe a "hidden feature" of some sorts heheh :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: LoSboccacc on February 13, 2017, 12:32:56 AM
I do think energy consumption flats out at some point
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 13, 2017, 01:45:40 AM
I do think energy consumption flats out at some point

Nah, it keeps accumulating. The bar caps out, but it keeps going on. On previous patch, you could see it as well. The same goes to your boost, it doesn't cap and keeps building up till you run out of energy.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 16, 2017, 05:04:38 AM
New version up:

v0.020
-Added "Shield Penetration" and "Hull Penetration" stats
-Added info for weapons that are ineffective against stone (basically, all lightning weapons)
-Fixed "Tick Damage" showing incorrect values for applicable weapons (apparently, Tesla Guns can have "Synchronized Weapons", unlike any other continuous beam)
-"Range" is now calculated (it'll show correct range values for crafted weapons; a bug prevents real range from being altered for them, I'll make a fix/mod for turretfactory.lua later on fix for turretfactory.lua (http://www.avorion.net/forum/index.php/topic,1984.0.html))
-"Force" stats now display the individual weapon force; for some reason turret stats show wildly different things (different things as in tooltip showing positive turret force while the weapon force is actually negative)

Shield Penetration: Your usual shield penetration as shown in vanilla tooltips; % chance to bypass the shields
Hull Penetration: A hidden weapon stat, specificly for Railguns. Railguns can penetrate blocks and deal additional damage; a railgun with 5 penetration for example, can hit 6 blocks in a straight line (in tooltip, it'll be shown as 6)

I'm trying to find the explosion values for cannons and launchers; they deal area of effect damage, capable of hitting multiple blocks (and thus dealing more damage, similar to railguns). Later on I'll move shield/hull penetration to somewhere else I guess.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Quellcrest on February 16, 2017, 09:50:30 PM
Latest version, getting lots of blank tooltips. Debug console shows this (http://i.imgur.com/6SGQAZL.jpg).
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Revant on February 16, 2017, 10:59:26 PM
Do you think it would be possible to add an additional sort option in the player inventory menu so that you could sort by eDPS instead of Damage?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 16, 2017, 11:40:25 PM
Latest version, getting lots of blank tooltips. Debug console shows this (http://i.imgur.com/6SGQAZL.jpg).

Can I get your save by any chance? Because either you have a turret with no weapons, or I have no idea. Unless I can get your save or you check all of your turrets one by one yourself, can't be sure, but that value cannot be nil unless the turret lacks weapons.

For now you can replace line 26 with this.
Code: [Select]
if not wpn then return end; local lyr = {}
Do you think it would be possible to add an additional sort option in the player inventory menu so that you could sort by eDPS instead of Damage?

That is out of our reach as far as I can tell.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Quellcrest on February 17, 2017, 01:13:16 AM
Ya, I'm not really sure. I made a new game in creative mode and just added a crap load of random weapons with the /turret mod, worked just fine.

That fix you provided worked for my current game too. Tooltips look just like they're supposed to.

Weird custom weapons? too many mods? dunno. Oh well.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 17, 2017, 02:35:39 AM
Ya, I'm not really sure. I made a new game in creative mode and just added a crap load of random weapons with the /turret mod, worked just fine.

That fix you provided worked for my current game too. Tooltips look just like they're supposed to.

Weird custom weapons? too many mods? dunno. Oh well.

Need to check the /turret mod. It may be spawning turrets without weapons on them somehow. Or it is a rare occurence in the vanilla game as well. Because the error says "wpn" is nil, and that cannot happen unless turret:getWeapons() returns nothing; meaning the turret has no weapons on it. It may be a vanilla bug as said
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Kane Hart on February 17, 2017, 06:55:58 AM
!remind me to do a videos in the next day or 2 :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Zeronutty on February 17, 2017, 05:31:49 PM
I hope you don't mind, i am skinning your mod to look the way i like it, whilst getting used to the way that avorion modding works. All copyright goes to you I just wanted to make it look a little better for me :)

Excellent mod btw, really really helpful :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 18, 2017, 02:21:57 AM
I hope you don't mind, i am skinning your mod to look the way i like it, whilst getting used to the way that avorion modding works. All copyright goes to you I just wanted to make it look a little better for me :)

Excellent mod btw, really really helpful :)

Thanks :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Minamitsu on February 18, 2017, 06:03:36 AM
So, I am new here and I have absolutely no idea how to add/install this thing...
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 18, 2017, 08:17:50 AM
So, I am new here and I have absolutely no idea how to add/install this thing...

Wherever you installed Avorion, extract the zip; merge the Avorion folders. When asked to, overwrite the "tooltipmaker.lua".
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Zeronutty on February 18, 2017, 08:42:21 AM
So, I am new here and I have absolutely no idea how to add/install this thing...

You have to navigate to, steamapps/common/Avorion/data/scripts/lib folder
Find the file called tooltipmaker.lua, make a copy of it call it something like tooltipmakercopy.lua
and replace the file ^ with the one you download for this mod author. :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 18, 2017, 09:10:04 AM
So, I am new here and I have absolutely no idea how to add/install this thing...

You have to navigate to, steamapps/common/Avorion/data/scripts/lib folder
Find the file called tooltipmaker.lua, make a copy of it call it something like tooltipmakercopy.lua
and replace the file ^ with the one you download for this mod author. :)

Yeah, backups are always useful. Verifying works too, when you need to get rid of some stuff :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Minamitsu on February 18, 2017, 09:42:35 AM
Huh. Well I don't seem to have a data folder in the first place, or that file. (playing on steam if that helps)
I did try and just put the data folder and lua file in my Avorion folder but nothing happened.
Edit: Through steam it seperates the game files so the data folder is in a totally different location for me.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on February 19, 2017, 02:38:15 PM
Huh. Well I don't seem to have a data folder in the first place, or that file. (playing on steam if that helps)
I did try and just put the data folder and lua file in my Avorion folder but nothing happened.
Edit: Through steam it seperates the game files so the data folder is in a totally different location for me.

Hmm not sure. My data folder is where my game is installed, under ...\steamapps\common\Avorion\ folder in my case.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Martin Levac on March 09, 2017, 10:30:31 AM
Can you add recoil please? I figured out we can change size with turretfactory.lua, and I would eventually like to scale recoil (and basically everything else related to size as well, i.e. dps, firerate, psize, etc) with size but I'm not that good with lua code for that. Anyways, if recoil is shown, we can see the effect of changing size, and the modder who's gonna try scaling recoil with size will see immediately if his mod works at least visually if not in game mechanics.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: imnotalan on March 09, 2017, 09:14:16 PM
Hey... I am not entirely sure how to install and use this mod could you break it down barney style for a poor dumb noob... I really need this mod in my life. However, my ability to translate computer speak is a work in progress. I just built my first rig and am trying to adapt to this new world of awesome.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on March 10, 2017, 03:18:24 AM
Can you add recoil please? I figured out we can change size with turretfactory.lua, and I would eventually like to scale recoil (and basically everything else related to size as well, i.e. dps, firerate, psize, etc) with size but I'm not that good with lua code for that. Anyways, if recoil is shown, we can see the effect of changing size, and the modder who's gonna try scaling recoil with size will see immediately if his mod works at least visually if not in game mechanics.

I couldn't make any sense from recoil values so I skipped it. If you manually want to add it, duplicate a line (for example, Range; duplicate lines 339-344) then change ltext to something you want to see. Something like this;

Code: [Select]
local line = TooltipLine(lineHeight, fontSize)
line.ltext = "Recoil"
line.rtext = round(wpn.recoil, 2) --can't remember if recoil is recoil or anything else
line.icon = "data/textures/icons/target-shot.png";
line.iconColor = iconColor
tooltip:addLine(line)

Hey... I am not entirely sure how to install and use this mod could you break it down barney style for a poor dumb noob... I really need this mod in my life. However, my ability to translate computer speak is a work in progress. I just built my first rig and am trying to adapt to this new world of awesome.

More the Avorion folder in the .zip file or extract the zip to your "..\steam\steamapps\common" folder, where Avorion is located at.

(http://i.imgur.com/CKSr2cF.jpg)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: hurrrr on March 17, 2017, 04:24:07 PM
Thank you so much for this!  So tired of having calc up trying to do the math on all of my turrets trying to figure out which one is actually best to use.  Turns out my burst turrets I thought were amazing have such low effective DPS they aren't worth using at all. 
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on March 19, 2017, 11:52:11 AM
Thank you so much for this!  So tired of having calc up trying to do the math on all of my turrets trying to figure out which one is actually best to use.  Turns out my burst turrets I thought were amazing have such low effective DPS they aren't worth using at all.

Oh yeah, burst turrets usually have insane DPS on paper but when you factor in the cooldown it really brings down the effective DPS. The only burst turrets I use are crafted ones if I can find a good one, if you lower their rate of fire sometimes they become good "normal" turrets.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Schakar on June 07, 2017, 07:50:14 PM
I have a problem with some Laser eDPS numbers (don't understand them).

The one below has 323.1 damage/tick and 1 tick every 20 seconds. How can it have 64xx eDPS ?
Isn't it (damage/tick) / (seconds peer tick)  => 323 / 20 in this case?
Or is it damage/tick * seconds >= 323 * 20 ?


HAHA, now I got it :). This laser ticks 20 times each second. God damit, me stupid, me mea culpa.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Tampa_Gamer on June 08, 2017, 02:48:59 PM
Just want to say thank you for this mod, it is really helpful - please keep up the great work
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Raith on June 09, 2017, 12:08:00 AM
Great mod, devs should merge it (or a variation inspired by it) into the actual game.

I have a question and a request/suggestion. First of all, does anyone know how Ohm value of the turret is calculated? It seemed to me that it was pretty close to DPS, but this mod throws that theory out of the window. I am asking since Ohm in the context of the game should represent the power of the turret (even if it's arbitrary, maybe it takes range into account, or whatever), so I would like to know, if possible, the formula to calculate Ohm value and it's relation to DPS.
And: is it possible to fetch the Ohm value (the Ohm value you see added in build mode) of the turret and add it to the tooltip? For research purposes to asnwer my previous questions and for general comparison, DPS is fine, but I'd enjoy having Ohm value there aswell.

Thanks a lot.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Hammelpilaw on June 17, 2017, 09:13:21 AM
Great mod, devs should merge it (or a variation inspired by it) into the actual game.

Try this file. I'm not the author, but merged this file into the modpack for our server for current beta 0.12.1.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Hammelpilaw on June 21, 2017, 10:04:47 PM
Great mod, devs should merge it (or a variation inspired by it) into the actual game.

Try this file. I'm not the author, but merged this file into the modpack for our server for current beta 0.12.1.

Incompatible with 0.12.2! Don't use it on server side, client side only still work. I will try to fix it sooner or later.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Raith on June 21, 2017, 10:17:12 PM
Great mod, devs should merge it (or a variation inspired by it) into the actual game.

Try this file. I'm not the author, but merged this file into the modpack for our server for current beta 0.12.1.

Incompatible with 0.12.2! Don't use it on server side, client side only still work. I will try to fix it sooner or later.

Thanks for the info.

EDIT: actually if added as is, your file makes trading posts not sell anything (including licenses). The original mod however is still compatible with 0.12.2 it seems?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Hammelpilaw on June 26, 2017, 05:42:59 PM
Yes thats the point, the trading posts stop selling when you use this file for a long time. I edited the orignal mod file cause the vanilla file was modified in 0.12 or later.

Code: [Select]
require ("cargotransportlicenseutility")
This line was added in current patches, but when i add this line to the mod something gets broken. If the original mod still works its fine. But the modified mod file works too for some time until the error appears, please tell us if it still works in some days  :P

What you can do at least: use vanilla file on server side, and mod file on client side, this works cause the issues with trading posts are on server side.
At all I dont understand why cargotransportlicenseutility was added in this file... shouldnt it be anywhere else?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on June 26, 2017, 11:56:52 PM
Yes thats the point, the trading posts stop selling when you use this file for a long time. I edited the orignal mod file cause the vanilla file was modified in 0.12 or later.

Code: [Select]
require ("cargotransportlicenseutility")
This line was added in current patches, but when i add this line to the mod something gets broken. If the original mod still works its fine. But the modified mod file works too for some time until the error appears, please tell us if it still works in some days  :P

What you can do at least: use vanilla file on server side, and mod file on client side, this works cause the issues with trading posts are on server side.
At all I dont understand why cargotransportlicenseutility was added in this file... shouldnt it be anywhere else?

After every patch, I skim through the changes and see if I need to push an update. As you also asked, I have no idea why "cargotransportlicenseutility" is required in this file as none of the functions on that Lua is not used over here as far as I can tell (but consider that I only skimmed through the changes). Actually, the only function from that file that is used in any of the Lua files is the "createLicense" function, and it is only used in the "cargotransportlicensemerchant".

Anyway, long story short, after seeing that, I didn't push any updates. However if any errors are being throw and you suspect it is related to this mod, please provide me with a log so I can track the issue and fix it if possible.

Regarding to the file you've provided, you have one extra function in your file, that may be the problem.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Raith on July 02, 2017, 03:32:14 AM
After every patch, I skim through the changes and see if I need to push an update.

does that imply the mod is and will be compatible with 0.12.4 and beyond, unless you post an update?

Bonus question: can someone tell me how to get the turret's OHM value or how it is calculated (best case: in what file I could find that)? This related to my previous question where I wanted to add an additional line showing OHM value (exactly as with adding recoil, example few post back).
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Devious on July 03, 2017, 04:14:32 PM
The recent patches affected tooltipmaker.lua, we also started experiencing client crashes when players opened their inventory and hovered over a tooltip sometimes.
This happened without an error as far as I know.
Comparing the code is also pretty difficult, in my text editor it looks like half of the code is at the wrong place.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on July 05, 2017, 02:13:23 AM
After every patch, I skim through the changes and see if I need to push an update.

does that imply the mod is and will be compatible with 0.12.4 and beyond, unless you post an update?

Bonus question: can someone tell me how to get the turret's OHM value or how it is calculated (best case: in what file I could find that)? This related to my previous question where I wanted to add an additional line showing OHM value (exactly as with adding recoil, example few post back).

It is currently compatible. But may not be with a new patch. I'll update if/when necessary.

And I don't understand what you mean by OHM value. You need to explain your terminology, because the weapons do not have any kind of OHM value.

The recent patches affected tooltipmaker.lua, we also started experiencing client crashes when players opened their inventory and hovered over a tooltip sometimes.
This happened without an error as far as I know.
Comparing the code is also pretty difficult, in my text editor it looks like half of the code is at the wrong place.

As I've stated previously, the only change is just one line. Also, when you are comparing the code for the changes, compare the previous game version's file with the current game version's file. The only change is one additional line, however it doesn't affect anything.

Tooltip crashes are game bugs. If this mod is bugged, it'll cause a blank tooltip, it won't cause a crash. Nevertheless, I put another update which includes that unused line. But as I've said, crashes are game bugs, a faulty mod will be set to invalid and simply stop functioning. Seeing that the patch notes for 0.12.3 (for example) states that a crash related to tooltips has been fixed, there still may be a few more.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Entity on July 10, 2017, 07:44:50 PM
nice mod. wonder why this isn't in the game
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Devious on July 10, 2017, 09:34:40 PM
Quote
Tooltip crashes are game bugs. If this mod is bugged, it'll cause a blank tooltip, it won't cause a crash. Nevertheless, I put another update which includes that unused line. But as I've said, crashes are game bugs, a faulty mod will be set to invalid and simply stop functioning. Seeing that the patch notes for 0.12.3 (for example) states that a crash related to tooltips has been fixed, there still may be a few more.

Ah didn't think of comparing the vanilla files, thanks for your work tho! :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Pyrax on July 25, 2017, 05:33:21 AM
Has anyone used this mod since the Alliance Update? Mine hasn't worked since the game update pushed last week...
Title: Re: [Mod] Detailed Turret Tooltips
Post by: nDervish on July 25, 2017, 11:48:55 AM
Has anyone used this mod since the Alliance Update? Mine hasn't worked since the game update pushed last week...

I haven't played much since then, but I'm pretty sure it was still working for me.  Did you reinstall the mod after updating?  At this point, Avorion mods work by overwriting the vanilla files, so it's common for the files to revert to vanilla during updates.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Fox on July 28, 2017, 05:03:13 PM
Has anyone used this mod since the Alliance Update? Mine hasn't worked since the game update pushed last week...
Same here after fresh install on the new update, seems alot of mods got affected lately... The Gate Icons still working great btw!  8)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on August 01, 2017, 11:54:22 PM
Has anyone used this mod since the Alliance Update? Mine hasn't worked since the game update pushed last week...
Same here after fresh install on the new update, seems alot of mods got affected lately... The Gate Icons still working great btw!  8)

I'm not really sure what's causing that as it is working fine on my end. If you are seeing blank tooltips, then something is breaking the mod which I'll need to fix.

If you can check the log files and see anything related to tooltipmaker.lua is giving an error, that'd help me. Logs are located here:
Code: [Select]
%appdata%\avorion Put this on your search bar in the start menu (or folder path on windows explorer) and hit enter.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Fox on August 02, 2017, 01:07:09 AM
not blank, but rather the basic vanilla tooltips... and sorry i cant find anything related in my latest logs, actually there isnt a single line containing ".lua", neither in the latest client-log nor in server-log, even tho me uses multiple mods!?

I backed up the original file as "tooltipmaker bckp.lua" and left it in the same folder, but i dont think that can be an issue, no? I mean like, it wasnt before...
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on August 02, 2017, 05:12:41 AM
not blank, but rather the basic vanilla tooltips... and sorry i cant find anything related in my latest logs, actually there isnt a single line containing ".lua", neither in the latest client-log nor in server-log, even tho me uses multiple mods!?

I backed up the original file as "tooltipmaker bckp.lua" and left it in the same folder, but i dont think that can be an issue, no? I mean like, it wasnt before...

If you are seeing the vanilla tooltip then the mod isn't installed :P Maybe there is a different folder to install mods now that I'm not aware of yet, but on single player all is working fine for me as I've mentioned. Put the backup file to somewhere else just in case, maybe that'll fix it somehow?!? I have no clue on this issue, as this would've affected all mods not just this one...
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Fox on August 02, 2017, 07:25:52 AM
- i freshly installed all used mods after the alliance update went live, including:
Avorion Command Package (working)
Clear Shields (working)
Compass-like Gate Icons (working)
Detailed Turret Tooltips (not working, as stated)
findstation (not working)
Fleetcontrol (not working)
showdist (working)

- the file in question is twice the size of the vanilla one and full of "lyr" comments (like you stated in the other topic), so im pretty sure i installed it correctly (it worked in the past, so pretty pretty sure), folder in question is within "steamapps\common\Avorion\data\scripts\lib\", as per instructions...

- when installing the mod "collection" i followed the same procedures as before the alliances update, so i would exclude a different folder for mods in general (cant say from a coding point of view tho, just what i would expect)

-removing the backup file from the folder had nno effect as expected

Any way to provide more info for you to track down the issue? is there a way ingame to see which scripts are used at a given point (since the client-/serverlogs were inconclusive)?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on August 02, 2017, 05:47:10 PM
Any way to provide more info for you to track down the issue? is there a way ingame to see which scripts are used at a given point (since the client-/serverlogs were inconclusive)?

I still have no clue... Are you playing on a server, or playing solo? I'm not sure how this game handles mods on servers; what happens when there is a file mismatch and so on so to speak. I play local/solo, maybe this happens when playing on a server. Other than that, I really have no clue, I mean it's practically impossible for you to see the vanilla tooltip when you have a modified tooltip mod. Curious... I'll try to look around, mind you share your save file meanwhile?

edit: I noticed how big the save files can get, so how about you start a new different game, check if the mod is working, and if it is not working, share that? Don't know what I can do with that, but as I've said, I am literally clueless as to why this is happening :(
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Pyrax on August 03, 2017, 05:37:07 AM
My issue was fixed per the recommendation of re-replacing the appropriate tooltip.lua after the update. The update obviously reverted that file to the vanilla so dropping in the modded one again got it working.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Fox on August 03, 2017, 07:10:01 AM
My issue was fixed per the recommendation of re-replacing the appropriate tooltip.lua after the update. The update obviously reverted that file to the vanilla so dropping in the modded one again got it working.
- i freshly installed all used mods after the alliance update went live, including:
Spoiler: show
(http://i.imgur.com/gl340pw.png)


Any way to provide more info for you to track down the issue? is there a way ingame to see which scripts are used at a given point (since the client-/serverlogs were inconclusive)?

I still have no clue... Are you playing on a server, or playing solo? I'm not sure how this game handles mods on servers; what happens when there is a file mismatch and so on so to speak. I play local/solo, maybe this happens when playing on a server. Other than that, I really have no clue, I mean it's practically impossible for you to see the vanilla tooltip when you have a modified tooltip mod. Curious... I'll try to look around, mind you share your save file meanwhile?

edit: I noticed how big the save files can get, so how about you start a new different game, check if the mod is working, and if it is not working, share that? Don't know what I can do with that, but as I've said, I am literally clueless as to why this is happening :(
All feedback were provided from solo singleplayer gameplay... also tried to remove the backup file from the folder, restarted game and still same result... (it shows on the screenshot above because i put it back there AFTER testing)

When i read the disclaimer window about compatibily problems with old saves and about changes to the shipfiles i thought "F*k it, my ships are saved and progress isnt much, lets start all new", and made a new creative galaxy in which i tested so far, so i guess there isnt much to help in my save-file... nevertheless, here you go:
Click me hard! (https://www.dropbox.com/sh/ruizyt6o9vg8jcc/AABSGYG8IVX_uxitrIRUEr3_a?dl=0)
(it refused to let me upload the empty files blacklist.txt, group-whitelist.txt, ipblacklist.txt and whitelist.txt, hopefully that doesnt disturb functionality of the savegame)


EDIT: OMG, now i feel so stupid... using version 0.12.+ instead of my old one helped alot... who had guessed... ... ty nevertheless for the effort and sorry for wasting your time :/
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on August 03, 2017, 04:21:12 PM
EDIT: OMG, now i feel so stupid... using version 0.12.+ instead of my old one helped alot... who had guessed... ... ty nevertheless for the effort and sorry for wasting your time :/

That's... still interesting, because I cannot explain why you would see the vanilla tooltips. And the difference between that version and the previous one is one added line, which does nothing so far from what I can tell. I just added that line and a failsafe for a very rare problem, meanwhile working on some other little things and re-evaluating my calculations.

Nevertheless, I'm glad its working again :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Fenrir on October 06, 2017, 10:39:18 PM
update please?  :'(
The fighter ui has problems since the 0.14 update (example: missing building cost)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on November 08, 2017, 01:42:31 AM
update please?  :'(
The fighter ui has problems since the 0.14 update (example: missing building cost)

Sorry for late update. Like 1 month late.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on November 10, 2017, 10:43:38 PM
Apparently I pushed an update at the same day? Kinda glad that I added something to prevent the mod from trying to calculate the DPS of an nonexistent weapon. I have a fix for cargo and crew shuttles, after I'm sure it is working properly I'll post it.

edit: Put the update up, download 0.024 if you are on beta. Fixed the crew/cargo shuttles.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: sebyg666 on December 01, 2017, 12:38:09 AM
the version 0.024 brakes the fighter creation UI for me. i can add craft, i click a turret and the UI locks up. cannot create fighter, change turret, increase or decrease stats, when i exit the station i cannot re-entre and have to reload game. i tested it isnt another mod, its the only one i have loaded, ran game vanilla and was able to make the fighter.

edit
the other version fixes the issue
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 03, 2017, 06:11:13 PM
the version 0.024 brakes the fighter creation UI for me. i can add craft, i click a turret and the UI locks up. cannot create fighter, change turret, increase or decrease stats, when i exit the station i cannot re-entre and have to reload game. i tested it isnt another mod, its the only one i have loaded, ran game vanilla and was able to make the fighter.

edit
the other version fixes the issue

Can you take a screenshot of the weapon you are trying to create a fighter from? Or is it any turret? More importantly, after that happens, it should say something in the logs; after it happens, can you close the game, and go to %appdata%\avorion\ and grab the latest log file, and then upload it over here so I can take a look at it?

I've tried to replicate the issue, but on my end it seems all fine so I have no clue.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: klush on December 04, 2017, 02:19:34 PM
Great mod, but i have the same problem, I cant build any fighters, I cant buy them too, and when i exit the equipament dock, the "press F to interact" disapears
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 04, 2017, 06:52:52 PM
Great mod, but i have the same problem, I cant build any fighters, I cant buy them too, and when i exit the equipament dock, the "press F to interact" disapears

Yep, it's a sign that the mod is broken due to something, but I cannot reproduce it on my own, I've visited several docks, boughts tens of weapons, etc... but wasn't able to reproduce it.

When that happens, it should say something in the logs; after it happens, can you close the game, and go to %appdata%\avorion\ and grab the latest log file, and then upload it over here so I can take a look at it?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 04, 2017, 09:53:24 PM
Ok, I've PM'd the folks experiencing the fighter creation UI lock-up, and it turns out one of them was using the wrong version :) If you are on stable (default) branch, use the older version of the mod, if you are on beta branch, use the latest version.

But as always, if you are experiencing any issues and suspect my mods are the issue, after closing the game, navigate to %Appdata%\Avorion folder, and upload the latest log here and I can check it out and locate the issue. Any help & suggestions are welcome!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: multox on December 06, 2017, 04:44:55 AM
Is the "Guided Missiles" trait at the bottom the same as Seeker or is there some difference?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: multox on December 06, 2017, 04:51:49 AM
Does this mod calculate correctly in Turret Factories?  I'm looking at a turret factory right now and the numbers don't look right to me.

-------------------------------
According to the mod:
Double Launcher Turret
DPS: 83.8
Damage: 2x138.4
Fire Rate: 0.3/s
(No heat build up)
+64% Fire Rate
Synchronized Weapons
Guided Missiles
---------------------------------

So 2 x 138.4 * 0.3 = 83.04  (close)
But the +64% Fire Rate would bring it up to 136.2 DPS, not the stated 83.8. 
What am I missing?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Ravien on December 06, 2017, 08:23:32 AM
Does this mod calculate correctly in Turret Factories?  I'm looking at a turret factory right now and the numbers don't look right to me.

-------------------------------
According to the mod:
Double Launcher Turret
DPS: 83.8
Damage: 2x138.4
Fire Rate: 0.3/s
(No heat build up)
+64% Fire Rate
Synchronized Weapons
Guided Missiles
---------------------------------

So 2 x 138.4 * 0.3 = 83.04  (close)
But the +64% Fire Rate would bring it up to 136.2 DPS, not the stated 83.8. 
What am I missing?

The weapon damage and fire rates shown on tooltips is after any damage and fire rate bonuses. The +64% fire rate just means that this particular turrets shoots that much faster than the "base" version of the same turret normally would.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: multox on December 07, 2017, 01:33:11 AM
So I dug into the modding docs and took a look at this mod.  There were a few things that bothered me in that the calculations didn't seem correct.  For example, there were times that adding more components to a turret in the Turret Builder would actually decrease the DPS.  In the process of investigating these issues I ended up building an entirely new mod. 

This isn't meant to imply that the OP's work isn't excellent!  I thank him very much for his mod.  However, the mod that I've attached is more tuned to my personal tastes and resolves the issues that I noticed.  Please feel free to include in the original mod or not.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 08, 2017, 06:42:44 AM
Does this mod calculate correctly in Turret Factories?  I'm looking at a turret factory right now and the numbers don't look right to me.

-------------------------------
According to the mod:
Double Launcher Turret
DPS: 83.8
Damage: 2x138.4
Fire Rate: 0.3/s
(No heat build up)
+64% Fire Rate
Synchronized Weapons
Guided Missiles
---------------------------------

So 2 x 138.4 * 0.3 = 83.04  (close)
But the +64% Fire Rate would bring it up to 136.2 DPS, not the stated 83.8. 
What am I missing?

The bonus to fire rate is already included in that fire rate you see, as it is in the vanilla. The little deviation is caused by numbers getting rolled up or down; either the fire rate, or the damage. Fire rate could be something between 0.296 and 0.304 and ends up being displayed as 0.3.

And adding more components to a turret should never decrease the DPS unless turret factories are still bugged; there was a time increasing/decreasing components had the opposite effect but I don't think that's the case. For eDPS, it should stay as it is as eDPS always takes cooldown and heat-up times into calculation. eDPS always assumes you keep firing without stopping, and firing faster in a cycle (from 0 to 100 and then back to firing again) actually doesn't make any difference due to a few factors.

It looks weird I admit, you see fire rate going up but eDPS staying as it is, however when you consider some other stuff it is like that. To be honest, when I first saw that value not changing, I thought I had a miscalculation somewhere, but when I looked at it with some examples, seeing that not changing at all was actually surprising for a bit.

Also, a few things for your mod, if you'd like to develop it more:
• The heat is generated per weapon, and some turrets fire all weapons at once. Unless you factor that in, you'll have wrong stats for such turrets
• You should pay attention to heatPerShot more, as a weapon can go beyond 100% heat, instead of capping at 100% unless a patch has changed it. Otherwise you'll have incorrect stats for anything that can heat
• I think you are incorrectly showing the DPS of a weapon if it is one of those that can cooldown faster than it can heat-up. If obj.coolingRate is 1 and stats.heatPerSecond is 0.5, then the overall DPS you have shows 2x the amount

Keep it up!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: multox on December 09, 2017, 05:54:46 AM
Hey Lyravega, thanks for your comments. 

I eventually got that about Fire Rate.  I asked that question before I had yet looked at any code.  :)

"adding more components to a turret should never decrease the DPS..." I specifically saw the eDPS going *down* when adding additional parts to a launcher.  I couldn't understand why it was happening due to the limited amount of data present in the UI.  That was my original reason for looking into the code anyway, but while digging through that reason became less important to me than all the other cool things that could be done.  At one point I did notice the same thing happening in my code.  In my case it was being caused by not capping generated heat to max heat.  If a weapon can actually get hotter than max heat then I do indeed need to revisit that. 

That brings me to the Entity:getTurret()/getTurrets() API.  I was trying to call those today from another script so that I could query the current heat of a weapon.  For some reason all I get back is another Entity object from either of those calls.  Is this a bug or am I supposed to be casting/converting the returned object somehow?  Sorry, I'm new to this.

So, regarding your three points.  (Thank you very much, by the way!)
1) So one thing I noticed is that there's turret totals and weapon totals.  The turret shots per second value already seems to take into account the total of the weapons.  This led me to the conclusion that the turret data can be used rather than calculating out the totals via active weapons, and individual barrel damage.  (At least for the weapons I looked at it was correct and it matched 100% with the developer's DPS calculations.).  As for simultaneous weapons, it appears to me as if that may not affects DPS.  My understanding is that it just means all of the weapons fire at the same time and the same rate, but they don't actually fire faster.  So 4 barrels with 3 shots/per second each will still fire at a total of 12 shots per second regardless of whether they are coordinated to shoot simultaneously or not.

2) I'm trying to dig further into max heat, but having trouble verifying it one way or the other due to the API problem that I mentioned earlier.  You're correct in that I made the assumption that a weapon couldn't get hotter than max heat.

3) In this case my calculations appear to be correct.  Where a weapon cools down faster than it heats up then my script sets the heatCoolRatio to 1.  So anything that doesn't accumulate heat has no impact on DPS.

Hey, I like this collaboration thing!  I didn't really want to go into competition with your script, but I also did want a few things slightly different.  One thing that I realize now is that I really liked how your script highlighted Independent Targeting at the bottom.  I missed that when I went back to playing the game.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 09, 2017, 10:31:36 AM
*snip*

You can notice the max heat thing if you have a super-heat-generating turret that generates like 90% heat with one shot. The 2nd shot will take it beyond 100%, lets assume it has a 10% cooling between shots, the next shot will take it to 170% heat. If you can get the turretfactory seed for that particular example where adding components decreases DPS, I'd like to check that out though.

Entity() differs from script to script, I think the best way to find the turrets is to get player, then player's ship and so on. Never used those though, at one time I tried to so that I could provide better stats for energy weapons, but I wasn't able to access to the player ship stats. As I've said though, after failing to access those stuff, I didn't try again. Be cautious about where/when you execute your script though, you don't want to execute stuff unnecessarily.

You probably have noticed, instead of "obj" (turret or fighter) I use "wpn" in some cases (wpn is obj:getWeapons(), I only need the first weapon as all weapons are identical on a turret). The reason for this is to simplify some stuff for me, and I had a case once when a turret spawned without any weapons. Then I realized I could use it instead of obj for most cases. Anyway, back to the point...

If a multi-weapon (multi-barrel) turret doesn't have anything special on it, the weapons take turns actually, except the continuous stuff which gave me a headache back in the day. Lets say it is a turret with 4 barrels, and the turret states 1/s for its fire rate, the individual weapons actually has 0.25s fire rate. But if the turret has "simultaneousShooting", when you fire, all of the weapons fire at the same time. This is shown on the vanilla UI as well, however there is another type of multi-shot.

"shotsFired" is normally 1 for most weapons, but for some it can be 2 or 3. For these turrets, when you fire, you fire multiple projectiles at the same time. So a damage value of 1000 actually becomes 2x1000. This was missing in the vanilla UI I think. I really can't remember right now but I think simultaneousShooting is included in the vanilla calculations, but this multi-shot is not. Heat generation stays the same since it is still just one weapon shooting (multiple at once). For simultaneousShooting it is a different case though; if a turret's heatPerShot is 0.2, and the turret has simultaneousShooting, the actual heat generation is 0.2*weaponAmount.

If you want to test max heat properly, I suggest you to find a weapon with massive heat generation. I was a hoarder, I had hundreds of loot when I was writing this mod, and some of the weapons surprised me. I've seen weapons that overheat with just one shot, simultaneous+multishot weapons that fired 12 projectiles with one shot, and so on. Unless the developers hard-capped it to 100%, I'm pretty sure they go beyond 100% as I've stated earlier.

Also, don't think it as a competition or anything like that. This is perhaps my 15th game that I've made mods for, and for any game that I worked on, whenever I or someone else made a mod that had similar functionality to another, I have always seen it as an opportunity to learn or to teach or just to work together.

You want to provide extra information in your mod for example, my first iterations of the mod was a colossal wall of text per tooltip believe me :) I had to dilute the information somehow, and compress it in a way. I used to use heat:cooling ratio as well but decided not to use it as shooting faster meant overheating sooner, and some weapons have way long cooldown periods. eDPS staying the same looks funny and incorrect till you include those cooldown periods and it surprises you.

Still, it's much better and correct than what vanilla offers though. At the very least, you get to see heat/cooldown stuff, which was the main point of the mod :) I'll go over all of my calculations someday, but thinking of the headaches I've suffered trying to figure out some stuff, it's not any day soon!
Title: Re: [Mod] Detailed Turret Tooltips
Post by: multox on December 09, 2017, 06:59:31 PM
*snip*

Entity() differs from script to script, I think the best way to find the turrets is to get player, then player's ship and so on. Never used those though, at one time I tried to so that I could provide better stats for energy weapons, but I wasn't able to access to the player ship stats. As I've said though, after failing to access those stuff, I didn't try again. Be cautious about where/when you execute your script though, you don't want to execute stuff unnecessarily.

I wrote a different small mod to create a "Watch Window" for debugging purposes in which I intended to view certain variables such as heat.  For heat, I actually did exactly what you're suggesting here which is to get the player then his craft then the array of turrets.  Both getTurret() and getTurrets() returned a single entity rather than a TurretTemplate. 
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 09, 2017, 07:36:24 PM
*snip*

Entity() differs from script to script, I think the best way to find the turrets is to get player, then player's ship and so on. Never used those though, at one time I tried to so that I could provide better stats for energy weapons, but I wasn't able to access to the player ship stats. As I've said though, after failing to access those stuff, I didn't try again. Be cautious about where/when you execute your script though, you don't want to execute stuff unnecessarily.

I wrote a different small mod to create a "Watch Window" for debugging purposes in which I intended to view certain variables such as heat.  For heat, I actually did exactly what you're suggesting here which is to get the player then his craft then the array of turrets.  Both getTurret() and getTurrets() returned a single entity rather than a TurretTemplate.

getTurrets() should return multiple stuff, but if the assignment is like "turrets = X:getTurrets()" only the first entity will be assigned, "turrets = {X:getTurrets()}" should work. That might be what you are experiencing.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: multox on December 10, 2017, 11:02:13 PM
That's an excellent tip, thanks!

Here's the problem though, the getTurret() and getTurrets() functions both return an Entity (as documented), not a TurretTemplate which is what I was hoping for.  I can't seem to find any way to retrieve the run-time data from a turret.  Once I retrieve the turret's entity I don't know how to dig any further.

Code: [Select]
function test()
print("player is " .. player.name)
    local craft = player.craft

    if not craft then return end
print("craft is " .. craft.name)
local numTurrets = craft.numTurrets
if (numTurrets < 1) then return end
   
local turrets = { craft:getTurrets() }
for k,turret in pairs(turrets) do
if (turret.isTurret) then
print("This IS a turret.")
end
ShowMetaTable(turret)               <--- Inspecting this shows it is an Entity
end
end
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on December 11, 2017, 12:06:54 PM
*snip*

I remember that I was trying to access the ship power generation and battery size, but I didn't find a way to dig further either. There is a chance that some stuff might not be exposed to the modders. I didn't dig it that much though, there can be a way but I wasn't able to find it.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Solid on December 23, 2017, 12:55:49 AM
Forgive my newb question but where is the link to the latest download for beta branch?

Never mind...... had to register and login in I guess.....
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Seik on December 23, 2017, 02:02:02 PM
Forgive my newb question but where is the link to the latest download for beta branch?

Never mind...... had to register and login in I guess.....
Yapp.  ;)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Zaflis on January 06, 2018, 10:49:44 PM
I'm getting a bunch of these in the clientlog:

Code: [Select]
2018-01-06 20-30-30| could not execute function 'FighterMerchant.renderUI' in '"data/scripts/entity/merchants/fightermerchant.lua"':
2018-01-06 20-30-30| data/scripts/lib/tooltipmaker.lua:29: attempt to index local 'wpn' (a nil value)
2018-01-06 20-30-30| stack traceback:
2018-01-06 20-30-30| data/scripts/lib/tooltipmaker.lua:29: in function 'fillWeaponTooltipData'
2018-01-06 20-30-30| data/scripts/lib/tooltipmaker.lua:651: in function 'makeFighterTooltip'
2018-01-06 20-30-30| data/scripts/lib/sellablefighter.lua:37: in function 'getTooltip'
2018-01-06 20-30-30| data/scripts/lib/shop.lua:844: in function <data/scripts/lib/shop.lua:829>
2018-01-06 20-30-30| (...tail calls...)

Everything seems to be working, but i don't really know. Just saw them accidentally. I added the mod just less than week ago.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Pasukaru on January 09, 2018, 01:10:58 AM
Awesome mod!
Would it also be possible to add the sorting by eDPS/Hull eDPS/Shield eDPS?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on January 14, 2018, 02:36:48 PM
I'm getting a bunch of these in the clientlog:

Code: [Select]
2018-01-06 20-30-30| could not execute function 'FighterMerchant.renderUI' in '"data/scripts/entity/merchants/fightermerchant.lua"':
2018-01-06 20-30-30| data/scripts/lib/tooltipmaker.lua:29: attempt to index local 'wpn' (a nil value)
2018-01-06 20-30-30| stack traceback:
2018-01-06 20-30-30| data/scripts/lib/tooltipmaker.lua:29: in function 'fillWeaponTooltipData'
2018-01-06 20-30-30| data/scripts/lib/tooltipmaker.lua:651: in function 'makeFighterTooltip'
2018-01-06 20-30-30| data/scripts/lib/sellablefighter.lua:37: in function 'getTooltip'
2018-01-06 20-30-30| data/scripts/lib/shop.lua:844: in function <data/scripts/lib/shop.lua:829>
2018-01-06 20-30-30| (...tail calls...)

Everything seems to be working, but i don't really know. Just saw them accidentally. I added the mod just less than week ago.

Seems like a fighter had no weapons on it. I'll fix it soon.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Ulrich_Rüstungjäger on January 14, 2018, 03:45:18 PM
Yea, it's only the merchant fighters/cargo fighters or whatever they are called. I was meaning to report that but it slipped my mind :P
Title: Re: [Mod] Detailed Turret Tooltips
Post by: gorodoff on January 14, 2018, 07:04:11 PM
Very nice mod I gave it a try yesterday and will keep it
There is just a little bug that prevent to view the tooltip for the new cargo "fighter" that has no turret
The mod detects it and the tooltip just show a invalidity warning so we loose the non turret related information (speed size ...)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: gorodoff on January 14, 2018, 08:06:02 PM
cargo problem solved in last version thks
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on January 18, 2018, 05:13:52 PM
Awesome mod!
Would it also be possible to add the sorting by eDPS/Hull eDPS/Shield eDPS?

Unfortunately that is not possible due to several reasons.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Zaflis on March 29, 2018, 12:39:34 AM
I guess this mod would need a complete rewrite now that update added dps in tooltips. What devs didn't add though is "dps per slot". Even if you find an awesome turret with 3000 dps with 4 slots, it is worse than 2 turrets of 2000 dps and 2 slots each.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: voltoth on April 21, 2018, 04:26:54 PM
Love the mod however, any chance of adding stats for torpedoes? I know this is a beta feature but still, would be nice to know what I'm dealing with when using torpedoes.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Mattoropael on April 23, 2018, 09:10:41 AM
I guess this mod would need a complete rewrite now that update added dps in tooltips. What devs didn't add though is "dps per slot". Even if you find an awesome turret with 3000 dps with 4 slots, it is worse than 2 turrets of 2000 dps and 2 slots each.

The official turret tooltip is still not offering separate shield/hull DPS for weapons with shield/hull bonuses, or effective DPS for overheating weapons either.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: maxfire on April 23, 2018, 02:07:23 PM
The official turret tooltip is still not offering separate shield/hull DPS for weapons with shield/hull bonuses, or effective DPS for overheating weapons either.
As far as I know, official tooltip calculates eDPS. Still not usefull enough w/o eDPS per slot.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Raio_Verusia on April 26, 2018, 04:55:01 AM
This is for anyone missing their torpedo tooltips.

Edit: You just throw this into the tooltipmaker.lua, at the very bottom.

Code: [Select]
function makeTorpedoTooltip(torpedo)
    -- create tool tip
    local tooltip = Tooltip()
    tooltip.icon = torpedo.icon

    -- title
    local title

    local line = TooltipLine(25, 15)
    line.ctext = torpedo.name
    line.ccolor = torpedo.rarity.color
    tooltip:addLine(line)

    -- primary stats, one by one
    local fontSize = 14
    local lineHeight = 20

    -- rarity name
    local line = TooltipLine(5, 12)
    line.ctext = tostring(torpedo.rarity)
    line.ccolor = torpedo.rarity.color
    tooltip:addLine(line)

    -- primary stats, one by one
    local fontSize = 14
    local lineHeight = 20

    local line = TooltipLine(lineHeight, fontSize)
    line.ltext = "Tech"%_t
    line.rtext = torpedo.tech
    line.icon = "data/textures/icons/circuitry.png";
    line.iconColor = iconColor
    tooltip:addLine(line)

    -- empty line
    tooltip:addLine(TooltipLine(15, 15))

    if torpedo.hullDamage > 0 and torpedo.damageVelocityFactor == 0 then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Damage"%_t
        line.rtext = toReadableValue(round(torpedo.hullDamage), "")
        line.icon = "data/textures/icons/screen-impact.png";
        line.iconColor = iconColor
        tooltip:addLine(line)
    elseif torpedo.damageVelocityFactor > 0 then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Hull Damage"%_t
        line.rtext = "up to ${damage}"%_t % {damage = toReadableValue(round(torpedo.maxVelocity * torpedo.damageVelocityFactor), "")}
        line.icon = "data/textures/icons/screen-impact.png";
        line.iconColor = iconColor
        tooltip:addLine(line)
    end

    if torpedo.shieldDamage > 0 and torpedo.shieldDamage ~= torpedo.hullDamage then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Shield Damage"%_t
        line.rtext = toReadableValue(round(torpedo.shieldDamage), "")
        line.icon = "data/textures/icons/screen-impact.png";
        line.iconColor = iconColor
        tooltip:addLine(line)
    end

    -- empty line
    tooltip:addLine(TooltipLine(15, 15))

    -- maneuverability
    local line = TooltipLine(lineHeight, fontSize)
    line.ltext = "Maneuverability"%_t
    line.rtext = round(torpedo.turningSpeed, 2)
    line.icon = "data/textures/icons/dodge.png";
    line.iconColor = iconColor
    tooltip:addLine(line)

    local line = TooltipLine(lineHeight, fontSize)
    line.ltext = "Speed"%_t
    line.rtext = round(torpedo.maxVelocity * 10.0)
    line.icon = "data/textures/icons/afterburn.png";
    line.iconColor = iconColor
    tooltip:addLine(line)

    if torpedo.acceleration > 0 then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Acceleration"%_t
        line.rtext = round(torpedo.acceleration * 10.0)
        line.icon = "data/textures/icons/blaster.png";
        line.iconColor = iconColor
        tooltip:addLine(line)
    end

    local line = TooltipLine(lineHeight, fontSize)
    line.ltext = "Range"%_t
    line.rtext = "${range} km" % {range = round(torpedo.reach * 10 / 1000, 2)}
    line.icon = "data/textures/icons/target-shot.png";
    line.iconColor = iconColor
    tooltip:addLine(line)

    if torpedo.storageEnergyDrain > 0 then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Storage Energy"%_t
        line.rtext = toReadableValue(round(torpedo.storageEnergyDrain), "W")
        line.icon = "data/textures/icons/electric.png";
        line.iconColor = iconColor
        tooltip:addLine(line)
    end

    -- empty line
    tooltip:addLine(TooltipLine(15, 15))

    -- size
    local line = TooltipLine(lineHeight, fontSize)
    line.ltext = "Size"%_t
    line.rtext = round(torpedo.size, 1)
    line.icon = "data/textures/icons/missile-pod.png";
    line.iconColor = iconColor
    tooltip:addLine(line)

    -- durability
    local line = TooltipLine(lineHeight, fontSize)
    line.ltext = "Durability"%_t
    line.rtext = round(torpedo.durability)
    line.icon = "data/textures/icons/health-normal.png";
    line.iconColor = iconColor
    tooltip:addLine(line)

    -- empty line
    tooltip:addLine(TooltipLine(15, 15))
    tooltip:addLine(TooltipLine(15, 15))

    -- specialties
    local extraLines = 0

    if torpedo.damageVelocityFactor > 0 then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Damage Dependent on Velocity"%_t
        tooltip:addLine(line)

        extraLines = extraLines + 1
    end

    if torpedo.shieldDeactivation then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Briefly Deactivates Shields"%_t
        tooltip:addLine(line)

        extraLines = extraLines + 1
    end

    if torpedo.energyDrain then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Drains Target's Energy"%_t
        tooltip:addLine(line)

        extraLines = extraLines + 1
    end

    if torpedo.shieldPenetration then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Penetrates Shields"%_t
        tooltip:addLine(line)

        extraLines = extraLines + 1
    end

    if torpedo.shieldAndHullDamage then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Damages Both Shield and Hull"%_t
        tooltip:addLine(line)

        extraLines = extraLines + 1
    end

    if torpedo.storageEnergyDrain > 0 then
        local line = TooltipLine(lineHeight, fontSize)
        line.ltext = "Requires Energy in Storage"%_t
        tooltip:addLine(line)

        extraLines = extraLines + 1
    end

    for i = 1, 3 - extraLines do
        -- empty line
        tooltip:addLine(TooltipLine(15, 15))
    end


    return tooltip

end
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on April 26, 2018, 06:57:05 PM
Love the mod however, any chance of adding stats for torpedoes? I know this is a beta feature but still, would be nice to know what I'm dealing with when using torpedoes.

Check this post (http://www.avorion.net/forum/index.php/topic,1635.msg26171.html#msg26171) by Raio_Verusia, he provided a small snippet in the meanwhile.

I guess this mod would need a complete rewrite now that update added dps in tooltips. What devs didn't add though is "dps per slot". Even if you find an awesome turret with 3000 dps with 4 slots, it is worse than 2 turrets of 2000 dps and 2 slots each.

From what I can tell, turret slots are more of a static value, and also a balancing factor for the devs. The more slots that a turret has, the more damage it deals and the higher reach it has. Everything related to the slots are already included in the calculations though. "DPS per slot" could be useful to decide what turret has highest DPS per slot though, I'll keep that in mind when I'm updating the mod.

The official turret tooltip is still not offering separate shield/hull DPS for weapons with shield/hull bonuses, or effective DPS for overheating weapons either.

Actually, the official tooltips show eDPS now. For like 95% of the weapons I checked out (thank you, debug menu), I'm proud to say that my calculations were right on spot. I'm also glad that developers chose to calculate eDPS off of a full cycle as well. However, there are some weird stuff going on which I'm trying to figure out. Such as this (https://steamcommunity.com/sharedfiles/filedetails/?id=1370823257), the vanilla tooltip is reporting a DPS of 2218 while my calculations report a DPS of 554.5, and there is a pattern to this issue.

Certain weapons with "Independent Targeting" (such as Railguns and Bolters) multiply their DPS with their weapon count for some reason, and I think it is a bug for the vanilla. The screenshot I linked for example, it is a quad turret; it has 4 weapons and if you multiply my result with 4, you get the vanilla tooltip's result. But I bet it is a bug.

Also, the vanilla "Time until overheated" and "Cooling time" are still inaccurate. What I don't understand is, for a weapon like this (https://steamcommunity.com/sharedfiles/filedetails/?id=1370838993) for example, the difference between "time until overheated" and my "(Heat) Buildup" is quite different, yet the eDPS result is the same. There should've been a variance, because that difference is enough to push the vanilla eDPS to a much higher value. I think vanilla eDPS does its calculations like I do but for some reason it shows the wrong "time until overheated" values? Dunno, I never trusted that value and did things the hard way anyway :)



As for an official word on this mod, an update is coming, slowly. Since there are many changes, and additions, I'm trying to double check everything, go over my calculations and stuff which is taking time, but to be honest, it takes more time than usual because as my interest has shifted to other games. Still, don't just want to slap the torpedo additions and release an update, and then realize there is a bug that I could've avoided. I don't want to force people visiting this topic daily to see if there is an update, so to speak. If they add Steam Workshop support someday, I'll go with it, but as long as we're doing things on the forums, I'd rather avoid uploading updates as soon as I finish one.

When I have spare time, and not playing another game, I try to work on it. Also, I'm trying to decide whether or not to alter the way the tooltip looks, and leaning on something like a table to display the values and avoid adding more lines on top of more lines. But a table-like look with multiple rows & columns might not look that great, so a bit on the fence about it. Nevertheless, have been trying to learn more about the UI for that case.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Devious on April 30, 2018, 08:29:40 PM
Just wanted to say thank you for all the effort you've already put in the mod, and we certainly appreciate you still continuing it :)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MrMors on May 20, 2018, 03:00:27 AM
I made some updates to the script. Due note that a majority of this script is still the same as v24 from lyravega

lyravega I hope you don't mind me re-posting this here. Feel free to incorporate any my changes into your next update.

v24.2 Updates
* Includes core game Torpedo code that Raio_Verusi posted (http://www.avorion.net/forum/index.php/topic,1635.msg26171.html#msg26171) earlier in thread.
* Includes Turret slot size info
* Includes Turret per slot size eDPS/DPS info
* Includes Fighter per volume size eDPS/DPS info

Notes:
* Still using same eDPS/DPS calculations as @lyravega, so concerns about calculations from his last post (https://www.avorion.net/forum/index.php/topic,1635.msg26177.html#msg26177) still exist.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Kampfkrapfn on June 06, 2018, 02:21:06 AM
I made some updates to the script. Due note that a majority of this script is still the same as v24 from lyravega

lyravega I hope you don't mind me re-posting this here. Feel free to incorporate any my changes into your next update.

v24.2 Updates
* Includes core game Torpedo code that Raio_Verusi posted (http://www.avorion.net/forum/index.php/topic,1635.msg26171.html#msg26171) earlier in thread.
* Includes Turret slot size info
* Includes Turret per slot size eDPS/DPS info
* Includes Fighter per volume size eDPS/DPS info

Notes:
* Still using same eDPS/DPS calculations as @lyravega, so concerns about calculations from his last post (https://www.avorion.net/forum/index.php/topic,1635.msg26177.html#msg26177) still exist.

let me throw in an idea/wish: how about adding per-slot-eDPS as sorting option in inventory? is this (im-)possible?
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Oldking on July 18, 2018, 04:43:05 PM
From what I can tell, turret slots are more of a static value, and also a balancing factor for the devs. The more slots that a turret has, the more damage it deals and the higher reach it has. Everything related to the slots are already included in the calculations though. "DPS per slot" could be useful to decide what turret has highest DPS per slot though, I'll keep that in mind when I'm updating the mod.
Slots are not static, especially now that they included low slot number in higher level sectors. In fact slot numbers is the single most important factor deciding (fighter) damage when creating from a turret, it divides by slots and multiplies by .3
I would highly suggest it to be included, you could have a 10k dps weapon producing 200dps fighters after burst fire calculations with a 2k dps weapon producing 600dps fighters.
As of now the DPS tooltip in vanilla only serves as a very inaccurate estimation.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Pasukaru on July 22, 2018, 03:15:43 PM
---I'm stupid---
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Raio_Verusia on October 20, 2018, 10:32:24 AM
I made some updates to the script. Due note that a majority of this script is still the same as v24 from lyravega

lyravega I hope you don't mind me re-posting this here. Feel free to incorporate any my changes into your next update.

v24.2 Updates
* Includes core game Torpedo code that Raio_Verusi posted (http://www.avorion.net/forum/index.php/topic,1635.msg26171.html#msg26171) earlier in thread.
* Includes Turret slot size info
* Includes Turret per slot size eDPS/DPS info
* Includes Fighter per volume size eDPS/DPS info

Notes:
* Still using same eDPS/DPS calculations as @lyravega, so concerns about calculations from his last post (https://www.avorion.net/forum/index.php/topic,1635.msg26177.html#msg26177) still exist.

I haven't played in a while and the torpedo code doesn't seem to work for me currently in the lastest stable branch build, unless I've forgotten how I did it last time. I will download your version and see, I was talking to Lyra when we worked on that snippet of code.

Edit: By the way, don't be shy, if you have Steam go ahead and have a chat with Lyravega if it concerns their mod, like I did. They're quite friendly and helpful.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MassCraxx on November 28, 2018, 11:21:00 PM
I made some updates to the script. Due note that a majority of this script is still the same as v24 from lyravega

lyravega I hope you don't mind me re-posting this here. Feel free to incorporate any my changes into your next update.
...
Notes:
* Still using same eDPS/DPS calculations as @lyravega, so concerns about calculations from his last post (https://www.avorion.net/forum/index.php/topic,1635.msg26177.html#msg26177) still exist.

I updated the script some more, the same applies. Tested with Avorion v0.19.1 r12932.

v0.024.3

Turret Tooltip Preview
Spoiler: show
(http://i65.tinypic.com/29cow9l.png) (http://i67.tinypic.com/1zd7ixk.png)  (http://i66.tinypic.com/mindxf.png)


Fighter Tooltip Preview
Spoiler: show
(http://i66.tinypic.com/2dc8wtf.png) (http://i67.tinypic.com/w5pxe.png)


Torpedo Tooltip Preview
Spoiler: show
(http://i67.tinypic.com/tash1c.png) (http://i66.tinypic.com/34rjcbn.png)
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Umbral Reaver on February 28, 2019, 12:07:02 PM
I had a go at trying to update this to the latest version (with the fancy new mining/salvaging lasers) and it turns out that maybe actual knowledge of lua is required. I thought I could just identify the patterns in where things should fit in the code and just slide it in. :I
Title: Re: [Mod] Detailed Turret Tooltips
Post by: Mp70 on March 20, 2019, 06:14:12 PM
Small update for new mining/salvaging turrets.

Updated  from MassCraxx a few posts up.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MassCraxx on May 22, 2019, 05:00:53 PM
Fixed some icons as they were missing in 0.22
Title: Re: [Mod] Detailed Turret Tooltips
Post by: lyravega on May 25, 2019, 10:11:58 PM
I gave MassCraxx my permission to maintain the mod.
Title: Re: [Mod] Detailed Turret Tooltips
Post by: MassCraxx on May 26, 2019, 12:03:12 AM
The mod will be continued on the Steam Workshop (https://steamcommunity.com/sharedfiles/filedetails/?id=1751636748).