Starbound

Starbound

Mech Overhaul
Possible improvement
It's possible to add a modded fuel by patching the \interface\mechfuel\mechfuel.config file, but the fuel gauge that displays above the mech while inside it is hard-coded in the \scripts\deployment\playermechdeployment.lua file (specifically in the drawEnergyBar function) via a chain of if ifelse checks

I propose to add a config file (probably called "mechfuelbar.config" or something in the same folder) that contains an array of types with each element of the array having a type, frame, and bar, then have the lua check via a loop (while, return until, or for loop) that once it finds a match, it assigns the frame and bar to the respective strings in the config file, then use a break to break out of the loop, so you don't have to check the rest. The default "/null.png" would be assigned before the loop, and simply overwritten if found (if not it stays the same.

I would do it myself, but this is your mod, and I don't have much experience in writing in Lua.
Last edited by Material Defender; 20 Sep, 2024 @ 11:30am
< >
Showing 1-1 of 1 comments
Material Defender 29 Sep, 2024 @ 3:53pm 
Alternatively, have the playermechdeployment.lua file, in the drawEnergyBar function, have the default not be a null, but either one of the existing fuel bars or a new one so any that are added to the mechfuel.config file via a patch would end up with a visible fuel bar when deployed.
< >
Showing 1-1 of 1 comments
Per page: 1530 50