Jump to content

Lua API Suggestions


Recommended Posts

Just spitballing a bunch of ideas for Ligo to consider with the new API changes.  Some are more viable than others, but my main thought was that there's all these new functions - but we can't use them because they require us to link to things.  Ship controllers can never reasonably link to all of any given element type, which is why the engine commands exist, so more things along those line would be great


Take them as you will, if anything can't be done then no big deal, but just posting it in case Ligo might see something useful


  • Element.getWorldPosition
  • Core.getElementWorldPositionById
  • Construct.getMaxSpaceBrakes, Construct.getMaxAtmoBrakes
  • Modify System.lockView - Previously it didn't work if not sitting in a seat; but a frozen player should also be able to have their view locked - if it doesn't already work that way with the new API.  This is important for custom UIs to work with the new click controls, when not in a seat
  • Construct.getMinimumStallAngles - Returns a vec3 of the smallest of all stall angles for the construct's airfoils along each of its local axes; for example, if someone is using both airfoils and ailerons for pitch, it would show the stall angle of the ailerons along that axis
  • Construct.getMaximumStallAngles
  • Construct.getLiftEfficiency(vec3 axis) - Returns a 0..1 value indicating the average efficiency of all airfoils along that axis, determined by currentLift/maxLift.  Can be used to optimize turns toward the highest efficiency, which implies the maximum speed/angle at which it can turn along that axis in the current conditions
    • Might be better as Construct.getEngineEfficiency(taglist, vec3 axis), which could also work on airfoils
  • Construct.getSustenationSpeed
  • Modify Library.getPointOnScreen - take a local position
  • Library.getWorldPointOnScreen
  • Improve efficiency of getPointOnScreen - apparently it is less efficient than our current methods, regarding overloads
  • Construct.getObstructionFactor(engineTagList) - returns the average(or total?) obstruction factor of all engines in the taglist
  • Modify Construct.getCurrentBrake - Ensure it includes obstruction (if it doesn't already, I haven't been able to check).  So should any other 'current' engine readings, again, if they don't already
  • Construct.getCurrentThrustAlongAxis
  • Construct.getPitch, getYaw, getRoll - In degs or rads, and possibly return these values relative to the velocity vector when not near a gravity source, since at that point they have no meaning - or relative to galaxy center would work.  It would be nice to have a consistent value across all ships, instead of each AP possibly choosing a different way to calculate it
  • Core.getWorldNorth - Returns a vector pointing north from the core for the current planet, normal to gravity, in world coordinates.  Currently we can sort of guess this by assuming the north pole is the point on the planet at the highest global Y (or is it Z?), but a tilted planet would mess that up, if there ever were one.  0 when not in planet influence
  • Player.getRaycastObject - Gets some sort of info about what the player is currently looking at.  Particularly I'd like it to be able to detect whether or not the player is 'aiming' at another player, for VR shooting games, but construct info (looking at a ship in space), itemIds, and/or local element IDs could all be useful
    • The main goal of detecting player 'hit' is so that these games could involve complex (real) arenas and rely on line of sight, rather than always being able to 'shoot' through walls
Link to comment
Share on other sites

One thing I would also love to see is something like:

controlUnit.enableEngineTorque(taglist, state)

as we now have engine.enableTorque(state) but this is not really useful due to links limitations.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...