Skip to content

Commit

Permalink
Bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianTheGrey committed Nov 22, 2020
1 parent 2ad09e8 commit e12a64a
Show file tree
Hide file tree
Showing 6 changed files with 3,771 additions and 23 deletions.
452 changes: 452 additions & 0 deletions DamageReport_3_03.conf

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

![Standard View](https://github.com/DorianTheGrey/DU-DamageReport/blob/main/img/DR_Logo1.png)

# Damage Report v3.02 (DU-DamageReport)
# Damage Report v3.03 (DU-DamageReport)

### A multi-screen (and HUD) capable, touch enabled, easy to install ship damage reporting script for **Dual Universe**.

Expand All @@ -25,10 +25,12 @@ Very soon we will be linking a YouTube video here explaning the installation and
![5](https://github.com/DorianTheGrey/DU-DamageReport/blob/main/img/5.png)
![6](https://github.com/DorianTheGrey/DU-DamageReport/blob/main/img/6.png)

### Important Note
### Important Notes

This script is comparably intense in regards to DU CPU resources required. Using many screens, using it on a ship with many (1000+) elements, clicking rapidly on the settings page, and/or having many damaged elements will most likely cause a script shutdown due to the limited CPU time we get. Using less screens and clicking a tiny bit slower during color selection will help. For now, I am not limiting the number of screens you can use (up to 8), but you will see that 1-3 screens works a lot smoother than more. - Finally, all scripts you run in parallel share one CPU limit, so I advise to switch this script off while you are using e.g. a heavy flight hud script. You have been warned. :)

The "Fuel Tank Optimization" talent in "Stock Control" is currently not doing what it says. It should reduce the weight of your fuel by 5 percent, but it's more like 9.1-something percent. As we do not know the exact number, we put 9 percent into the formula. Your tanks will seem a tiny bit emptier than they actually are, this will be fixed as soon as I know the exact data.

Having said all of this, I successfully used the script on a 1100 element L core ship (on one screen) without problems.

### Installation
Expand Down
29 changes: 8 additions & 21 deletions src/DamageReport_3_02_UnitStart_2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ function UpdateTypeData()
local weightSpaceFuel = 6
local weightRocketFuel = 0.8

if StatFuelTankOptimization > 0 then
weightAtmosphericFuel = weightAtmosphericFuel - 0.09 * StatFuelTankOptimization * weightAtmosphericFuel
weightSpaceFuel = weightSpaceFuel - 0.09 * StatFuelTankOptimization * weightSpaceFuel
weightRocketFuel = weightRocketFuel - 0.09 * StatFuelTankOptimization * weightRocketFuel
end

for i, id in ipairs(typeElements) do
local idName = core.getElementNameById(id) or ""
local idType = core.getElementTypeById(id) or ""
Expand Down Expand Up @@ -396,12 +402,7 @@ function UpdateTypeData()
baseVol = 0.2 * StatAtmosphericFuelTankHandling * baseVol + baseVol
end
cMass = idMass - baseMass
if cMass <=10 then cMass = 0
else
if StatFuelTankOptimization > 0 then
cMass = 0.05 * StatFuelTankOptimization * cMass + cMass
end
end
if cMass <=10 then cMass = 0 end
cVol = string.format("%.0f", cMass / weightAtmosphericFuel)
cPercent = string.format("%.1f", math.floor(100/baseVol * tonumber(cVol)))
table.insert(FuelAtmosphericTanks, {
Expand Down Expand Up @@ -435,19 +436,11 @@ function UpdateTypeData()
baseMass = 182.67
baseVol = 400
end
if StatFuelTankOptimization > 0 then
cMass = 0.05 * StatFuelTankOptimization * cMass + cMass
end
if StatSpaceFuelTankHandling > 0 then
baseVol = 0.2 * StatSpaceFuelTankHandling * baseVol + baseVol
end
cMass = idMass - baseMass
if cMass <=10 then cMass = 0
else
if StatFuelTankOptimization > 0 then
cMass = 0.05 * StatFuelTankOptimization * cMass + cMass
end
end
if cMass <=10 then cMass = 0 end
cVol = string.format("%.0f", cMass / weightSpaceFuel)
cPercent = string.format("%.1f", (100/baseVol * tonumber(cVol)))
table.insert(FuelSpaceTanks, {
Expand Down Expand Up @@ -489,12 +482,6 @@ function UpdateTypeData()
baseVol = 0.2 * StatRocketFuelTankHandling * baseVol + baseVol
end
cMass = idMass - baseMass
if cMass <=10 then cMass = 0
else
if StatFuelTankOptimization > 0 then
cMass = 0.05 * StatFuelTankOptimization * cMass + cMass
end
end
if cMass <=10 then cMass = 0 end
cVol = string.format("%.0f", cMass / weightRocketFuel)
cPercent = string.format("%.1f", (100/baseVol * tonumber(cVol)))
Expand Down
Loading

0 comments on commit e12a64a

Please sign in to comment.