GithubHelp home page GithubHelp logo

dimencia / du-orbital-hud Goto Github PK

View Code? Open in Web Editor NEW
134.0 134.0 57.0 29.55 MB

Dual Universe HUD and Autopilot, with Atmospheric and Space features, and automatic interplanetary autopilot that will put you in a safe orbit for when you wake up

License: GNU General Public License v3.0

Lua 99.25% Shell 0.75%
autopilot dual-universe dualuniverse hud

du-orbital-hud's People

Contributors

archaegeo avatar badman74 avatar chronosws avatar dimencia avatar jdelgado-dtlabs avatar loneboco avatar rubensayshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

du-orbital-hud's Issues

Script error

Version 3.81. I loaded the script onto a simple atmospheric flyer, no space elements. I got a script error and no HUD showed up. I traced the problem to lines 413 and 414 which I commented out. The script seemed to work fine after that. Here are the line I commented:

                    gearExtended = true -- Show warning message and set behavior
                    Nav.axisCommandManager:setTargetGroundAltitude(targetGroundAltitude)

I don't know what these lines do, so I don't know if I am missing some feature.

Downward facing engines

when going to land the downward facing engines dont shut off like the hovers is there a way to keep the downward facing engines and have them work like the hovers

[Feature Request]

Should make something that works with the ECU right now I have found that the ECU wont work.

Autopilot Spinning out.

Hey the original Full_Hud would Align properly but the latest two archeago and button makes my ship spin and waste fuel when i try to align. Now im sure its the way i built my ship and me needing to tweak some settings in the lua but i have no clue what to tinker with.

[Feature Request] Maneuver Mode

I have small thrusters pointing in every direction using ALT to Maneuver is fine but the down thrusters are always on and wasting fuel is there a way to designate thrusters as Maneuvering thrusters that only work in a Maneuver mode using the Shift key to toggle.

This feature would be great for aligning and landing on a space station that does not have vertical landing pads but rather a hanger design.

Auto Door / Ramp not working

I have not been able to get this feature to work, I have tried both linked to the seat and un-linked I have also had a couple people ask me about this feature in my DM's and video comments with the same issue

[Question]

What lines do i need to disable to not have the kerbel space window? When near a planet I feel like I get a lot of lag when that thing is up could be a coincidence but honestly I don't need the window anyway.

Changelog

A changelog would help us quickly ID what has changed in the latest version.

[Feature Request] Vector to Waypoint

For the ultimately lazy. Lines up on a waypoint entered manually via a variable or ingame. Set vector to get you within an arbitrary distance for piloting in atmosphere.

pitch is calculated in wrong way

current behaviour:
We look down relative to the ship and measure angle. when we roll angle increases.

expected behaviour:
We look down towards ground and measure angle. when we roll angle stays the same.

error lies in getPitch, here is changed function that solves this:

function getPitch(gravityDirection, forward)
	return ((math.acos(gravityDirection:dot(forward)) * constants.rad2deg)-90)	
end

Note lack of right vector. It's not needed in pitch calculations, only roll

[Feature Request] Manual Booster Action

The Dodgin's Rocket Governor is good when using Cruise Control mode, but would it be possible to update the code to allow for manual boosting (if desired) when in Travel Mode?

[Feature Request]

The ability to display the name of the tanks instead of "[type]Fuel [n]". It might be best if it were an option via params. I often use tanks for specific tasks so in my case, it's really handy to know what tanks are low. Some can be ignored if they are low, some can't. I don't have that info with the current default iteration.

[Feature Request] Companion Display Board Module

I would love a LUA module to display the Autopilot/Target Destination data on a Small or Medium display. This would be great for when multiple people are traveling together so the passenger can see orbital ETA, time to Brake, etc... I was looking at the code to see if I could make heads or tails of it and so far, I have been unable.

Someone on the DU Discord mentioned that one should be able to take that piece of LUA from the autopilot script and paste it to the display board... I'm not certain it's that easy though.

[Feature Request] Toggle Vertical Boosters / Hovers

Hey,

First on I really love your project and I think it's coming along very nicely!

I would love to see an option where you can tell the construct to only use Vertical Boosters, when there is no atmosphere. VB are super inefficient and it's always a waste of fuel when they activate on Alioth even if the Hover engines alone would be quite enough to hold the ship up. It would be amazing if it could automatically activate the Boosters if that's not the case, but I could live without that.

The problem is, that I didn't find a convenient way to deactivate the booster engines without adding all boosters to the control unit. But with large ships having many fuel tanks and many Boosters you would run out of connections pretty fast. Maybe you have more luck with that problem.

keep up the good work!

[Feature Request] - Auto level toggle

It would be extremely handy to have an auto-level hotkey with this, something that will ... well, automatically levels your ship to the ground. There are other nav scripts (BetterNav, for example) that have this feature on the "g" key to auto-level your construct, and it's become quite an indispensable feature to have for many heavy ships to leave the atmosphere on any given planet easier.

If there's already a hotkey for that, I apologize because I didn't see it in the documentation.

Max Speed, and too early braking

Hio, it would be nice i i could edit the max speed of the autopilot in the lua parameter.
I flew with your new version to alioth from thades and came out 10su before the planet, i guess this is a bug? :)

Vertical speed

New to LUA and DU, mainly work in Python, C# or Java. Has someone written a vertical speed indicator? I want to build an auto orbit and I want someone smarter than I to make an auto lander. But vertical speed will be needed. What would I need to call to get something like this to work.

alt = getAltitude() sleep(1) newAlt = getAltitude() verticalSpeed = newAlt - alt
Ideally drop sleep() to 0.01 or something and multiply verticalSpeed to compensate but I'm not sure how laggy it would be. Then it would just be a matter of basically locking the pitch to +8 degrees, keeping the speed below 1000 while in atmo. Then burning prograde until Ap is at the desired altitude and waiting for Ap to circularize. Although a better implementation could be to just burn prograde until Ap is well above desired alt and then burn anti-normal until circularized to save some time at the expense of fuel. OFC a really basic implementation but it should work for most usecases until someone comes up with something that takes the individual ship's lift and TWR into account.

Losing braking metrics

I've seen this in 3.5 and 3.6
When exiting the seat while "Cruising"
On reentry to the seat and setting back up auto pilot, all braking data is lost
Screenshot (7)

Big update = big issue

Currently (V3.6) shortly after take off script stops working. Graphic of HUD is frozen - joystick control doesn't work

Rocket booster

can find the way to turn them on
the UI says press B but to no end sadly
ok i have been able to make it work but i just don't understand how i did it
would you plz explain more because my english ok but not that good sadly

script error...

throwing a script error when pitchSpeedFactor is set at 0.8, changing it to .8 seems to work though (was default)

Altitude Hold Button

Would be awesome to be able to set an altitude, or AGL and with a button, have the ship maintain that FL.

Unwanted yaw or pitch from time to time, if it happens it's unstoppable

Sometimes, the script suddenly causes the ship to yaw or pitch. If that happens, it can't be stopped. Relogging, reapplying the script, nothing helps. I had the yawing four times, the pitching only once (but that one crashed me into the ground).

If I remove the script by applying "(Pilot) Flying Construct", the yawing/pitching stops immediately. Reactivating any of the ButtonHUD versions I have (3.88, 3.94, 3.96 and 3.97) cause the ship to yawn/pitch again. This happens regardless of whether I choose Virtual Joystick or Keyboard.

I noticed this problem can happen when I approach crowded areas which cause a lag spike. I don't know, maybe the script saves some values and tries to correct yaw/pitch then?

If it helps I can make a video of it or stream it to you guys on Discord.

Newest update

Hi I found and fixed a problem in the code on unit stop line 8 and 13 was missing a closed bracket here is my fix it now the code works.

if door and (atmo > 0 or (atmo == 0 and core_altitude < 10000) then ----- Original code
if door and (atmo > 0) or (atmo == 0 and core_altitude < 10000) then ----- My fix
and
if forcefield and (atmo > 0 or (atmo == 0 and core_altitude < 10000) then ----- Original Code
if forcefield and (atmo > 0) or (atmo == 0 and core_altitude < 10000) then ------ My fix

it wasn't causing any problems really just my door was not auto opening but now it does when I'm on land.

Option to use remote control with hud

Would be great to have an option to use the HUD on the hoverboard. Having the HUD and be able to control normally with keyboard, mouse. Maybe an option at the parameters to set remote control with follow (which is great by the way) or normal remote control (that freezes the player).

What do you think?

And congratulations, fantastic stuff here.

Control schema

vehicle assumes control schema is mouse or keyboard+mouse , not keyboard only

Problem with Cockpit Controller

Does the HUD not work with the cockpit? The HUD shows up as a tiny unreadable display towards the lower right of my screen in 1st person view. In 3rd I don't see it at all. I've run default config and than back to the HUD. Just wondering if its a game bug, I know the default widgets don't show at all in 3rd person view with the cockpit.

FPS drop during Autopilot

System: Ryzen 9 3900X, Nvidia 2080 Super, 32GB RAM
Situation: Using the autopilot to fly to another planet

During the acceleration period the FPS drop to 8-10, one CPU Core goes up to around 95% while the overall stays around 10%, the GPU is the same time around 25-30%... As soon as the acceleration is finished (ship reaches 29 999km/h and the HUD remarks to Autopilot Cruising) the FPS go up to 70+ stable.
The moment it starts to slow down (Autopilot Braking), the fps go back down to 8 and the very same core again up to around 95%...
I assume that this is based on a LUA-Implementation problem (using only one core or whatever) but wanted to ask if this is the same for others or if it's only me and maybe you can do something against it ;)

Framerate Drops after clicking

I still expirience extreme Framerate drops after klicking anywhere when the HUD is active.

Everything works perfectly until I hit Tab and klick anywhere, after that it is just lagging and unplayable. Leaving and entering the Control unit solves the problem imidiatly. I can reliably reproduce this every single time.

Running Version: 3.84 (Downloaded just a few minutes ago)

[Feature Request] Auto Pilot Fuel Economy Mode

Would you be willing to add a couple of buttons to toggle a fuel economy mode to the autopilot?
Currently, the AP burns at 100% thrust until the max velocity is achieved, I usually limit mine to around 70% as it makes you fuel last much longer but takes longer. Anything above 50% has major diminishing returns for the burn to thrust ratios.
Id appreciates a 50%, and a 75% setting.

When I go to thades on my own I usually have 5 - 10% space fuel when I get back to sanc, but AP used all of it accelerating on the return trip to sanc, and now I have no fuel for maneuvering on reentry.

When using keyboard mode, you are unable to use the on-screen buttons.

The shift key does not show the buttons when you set the control scheme to keyboard. I was able to fix it by always allowing the lshift action when in Keyboard mode:

DU-Orbital-Hud/ButtonHUD.conf

Lines 4128 to 4132 in 4825ad1

if system.isViewLocked() == 1 then
HoldingCtrl = true
PrevViewLock = system.isViewLocked()
system.lockView(1)
end

DU-Orbital-Hud/ButtonHUD.conf

Lines 4136 to 4141 in 4825ad1

if system.isViewLocked() == 1 then
HoldingCtrl = false
simulatedX = 0
simulatedY = 0 -- Reset for steering purposes
system.lockView(PrevViewLock)
end

if system.isViewLocked() == 1 or userControlScheme == "Keyboard" then
    HoldingCtrl = true
    PrevViewLock = system.isViewLocked()
    system.lockView(1)
end

It seemed to work fine, but I haven't really tested things in-depth.

[Feature Request] Don't activate doors when leaving the control unit while the ship is moving

When exiting the seat after reaching cruising speeds on autopilot, don't automatically open doors and ramps (since we are flying through space).

Suggested code change for Unit->stop() Line 6 thru 16

-- Open door and extend ramp if available
if door and vec3(core.getVelocity()):len() < 2.7 then
    for _,v in pairs(door) do
        v.activate()
    end
end
if forcefield and vec3(core.getVelocity()):len() < 2.7 then
    for _,v in pairs(forcefield) do
        v.activate()
    end
end

Current code in Unit->stop() Line 6 thru 16

-- Open door and extend ramp if available
if door then
    for _,v in pairs(door) do
        v.activate()
    end
end
if forcefield then
    for _,v in pairs(forcefield) do
        v.activate()
    end
end

[Feature Request] Configurable speed increments

Currently scrolling the mouse wheel increments speed by 10% per tick, and using R/T increments by 25% per tap (I believe...). Whatever the exact current values are, it would be great to have these %'s configurable in the Lua parameters.

Account for negative altitudes in display

When under sea level, the altitude meter displays nothing because it assumes an altitude above 0. Would be great if support for negative altitudes could be added.

Framerate drop dramastically

When using the script, the framerate drops dramastically and the game become really slow, when I change lua configuration to default it's ok.

(nice job with this script btw)

[feature request] export parm for initial groundalt after liftoff

As I'm departing from a hangar, I need to set the initial altitude (after pressing G to launch) to a height which will fly through the door. Can you please set the initial alt as an external parm?
Thanks

actionStart:
args: [gear]
lua: |
gearExtended = not gearExtended
if gearExtended then
if AltitudeHold and (vBooster or hover) then -- If they extend while holding and we can get distance, land
AutoLanding = true
gearExtended = false -- Don't actually do it
else
Nav.control.extendLandingGears()
Nav.axisCommandManager:setTargetGroundAltitude(0)
end
else
Nav.control.retractLandingGears()
Nav.axisCommandManager:setTargetGroundAltitude(500) -- What's max? Req: make this a parm
end

Resolution fix

I'm not sure what the wording is for this.. I have one buddy who says the graphics and text are very small on his HD monitor. I have a 4K monitor and play in a 2560x1440 window.

image

radar gives nil error for those who dont have radar

                if (radar_1 and #radar_1.getEntries() > 0) then
                    if hasSpaceRadar and radarPanelID == nil then
                        ToggleRadarPanel()
                    elseif hasAtmoRadar and radarPanelID == nil then
                        ToggleRadarPanel()
                    end
                    local radarContacts = #radar_1.getEntries()
                    radarMessage = [[<g class="text"><g font-size=14><text x="1750" y="290" text-anchor="middle">Radar: ]]..radarContacts..[[ contacts</text></g></g>]]
                else
                    local data
                    data = radar_1.getData():find('worksInEnvironment":false')
                    if data then
                        radarMessage =  [[<g class="text"><g font-size=14><text x="1750" y="290" text-anchor="middle">Radar: Jammed</text></g></g>]]
                    else
                        radarMessage =  [[<g class="text"><g font-size=14><text x="1750" y="290" text-anchor="middle">Radar: No Contacts</text></g></g>]]
                    end
                    if hasSpaceRadar and radarPanelID ~= nil then
                        ToggleRadarPanel()
                    elseif hasAtmoRadar and radarPanelID ~= nil then
                        ToggleRadarPanel()
                    end
                end

Gives nil value for those who dont have radar.

I was able to fix that moving data = radar_1.getData():find('worksInEnvironment":false') to the if statement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.