I've got a couple of ideas for workshop mods, but I'm having trouble finding any traction on them. I'm new to Lua although I've had a reasonable amount of experience with Python and Javascript.
First, I want to modify the mining system arrows so that they're more visually distinguishable from other arrows. However, every time I try to override the onPreRenderHud function it breaks the Mining System upgrade modules entirely (i.e. they don't function and their tooltips are empty).
I copied the entire method, added a couple of `local`s to make adjustments easier, and changed exactly one line in the function:
local arrowLength = 10 // default is 30
local arrowWidth = 30 // default is 10
local oldOnPreRenderHud = onPreRenderHud
function onPreRenderHud()
-- omitted lines were copied verbatim from the original
-- this next line is the only change I made
renderer:renderEntityArrow(tuple.asteroid, arrowLength, arrowWidth, 250, tuple.material.color);
-- omitted lines were copied verbatim from the original
end
Can anyone tell me what I'm doing wrong? Is there a cleaner way to override or wrap the function so that I don't have to copy most of it verbatim? I saw docssy's mod that made similar edits to the miningsystem.lua script, but his method required replacement of the entire file. https://www.avorion.net/forum/index.php/topic,5605.msg30327.html
My other idea is to move the pickup notifications elsewhere on screen. When I'm in build mode, the stats of the ship I'm currently building are frequently covered up by pickups made by other ships in our alliance fleet. Turrets are particularly irritating to edit because when I add a turret to a ship, the "removed that turret from your inventory" message covers up the section of the stats relating to turret slots.
That one has given me more trouble; I suspect that the location of those notifications is not modifiable via Lua scripts. Am I wrong? If so, can anyone point me to where such a thing might be accomplished?
adeilt